A powerful adaptive graphics settings system for Godot 4.5.1 that automatically adjusts visual quality based on performance to maintain a smooth framerate.
- Adaptive Quality: Automatically adjusts graphics settings to maintain target FPS
- Comprehensive Settings Management: Controls render scale, anti-aliasing, shadows, reflections, and more
- User-friendly UI: Built-in settings panel for players to customize their experience
- Performance Monitoring: Real-time FPS tracking and performance analysis
- Platform-specific Optimizations: Detects and applies optimal settings for different devices
- Fully Customizable: Extensive configuration options for developers
- Download or clone this repository
- Copy the
addons/smart_graphics_settingsfolder into your Godot project'saddonsdirectory - Enable the plugin in Project Settings → Plugins
- Add the SmartGraphicsSettings node to your main scene or use the autoload singleton
- Configure your desired target FPS and adjustment settings
- Run your game - graphics will automatically adjust to maintain performance
SmartGraphicsSettings.set_enabled(true)
SmartGraphicsSettings.set_target_fps(60)
SmartGraphicsSettings.toggle_ui()
When accessing SmartGraphicsSettings properties like adaptive_graphics or calling functions like set_target_fps immediately in your script's _ready() function, you might encounter issues because the addon performs some initialization steps deferred (after _ready() has finished).
To ensure the system is fully initialized before you interact with it at startup, connect to the SmartGraphicsSettings.initialized signal:
func _ready():
if SmartGraphicsSettings.get_adaptive_graphics(): # Check if already initialized
_on_graphics_ready()
else:
SmartGraphicsSettings.initialized.connect(_on_graphics_ready)
func _on_graphics_ready():
# Now it's safe to access SmartGraphicsSettings functions and properties
print("Smart Graphics Settings Ready!")
SmartGraphicsSettings.set_target_fps(90)See the technical documentation for more details.
The SmartGraphicsSettings autoload singleton provides the following methods and signals:
| Method | Description |
|---|---|
toggle_ui() |
Toggles the visibility of the settings UI. |
show_ui() |
Shows the settings UI. |
hide_ui() |
Hides the settings UI. |
apply_preset(preset: AdaptiveGraphics.QualityPreset) |
Applies a quality preset (e.g., ULTRA_LOW, LOW, MEDIUM, HIGH, ULTRA). |
set_enabled(enabled: bool) |
Enables or disables the adaptive graphics system. |
set_target_fps(fps: int) |
Sets the target FPS for the adaptive system to maintain. |
get_average_fps() -> float |
Returns the current average FPS. |
is_fps_stable() -> bool |
Returns true if the FPS is currently stable. |
set_match_refresh_rate(enabled: bool) |
Sets whether the target FPS should automatically match the display's refresh rate. |
set_target_fps_to_refresh_rate() |
Immediately sets the target FPS to match the display's refresh rate. |
get_display_refresh_rate() -> float |
Returns the display's refresh rate in Hz. |
set_vsync_mode(mode: int) |
Sets the VSync mode (see DisplayServer VSync constants). |
get_vsync_mode() -> int |
Returns the current VSync mode. |
get_status_info() -> Dictionary |
Returns a dictionary with detailed information about the current state of the system. |
get_adaptive_graphics() -> AdaptiveGraphics |
Returns the underlying AdaptiveGraphics node. |
| Signal | Description |
|---|---|
initialized |
Emitted when the AdaptiveGraphics node has been fully initialized and it's safe to interact with the system. |
A demo scene is included to showcase the functionality. Open addons/smart_graphics_settings/demo/demo_scene.tscn to try it out.
For detailed documentation on all features and configuration options, see the README in the addon directory.
This project is licensed under the MIT License - see the LICENSE file for details.
Created by Lucas Becker. Open to community-submitted issues and pull requests.
If you find this plugin useful, please consider:
- Starring the repository on GitHub
- Contributing to the project
- Reporting any issues you encounter