diff options
Diffstat (limited to 'servers/rendering_server.cpp')
-rw-r--r-- | servers/rendering_server.cpp | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index ae72f47a44..7a958546b6 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -2165,13 +2165,16 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("viewport_create"), &RenderingServer::viewport_create); ClassDB::bind_method(D_METHOD("viewport_set_use_xr", "viewport", "use_xr"), &RenderingServer::viewport_set_use_xr); - ClassDB::bind_method(D_METHOD("viewport_set_scale_3d", "viewport", "scale"), &RenderingServer::viewport_set_scale_3d); ClassDB::bind_method(D_METHOD("viewport_set_size", "viewport", "width", "height"), &RenderingServer::viewport_set_size); ClassDB::bind_method(D_METHOD("viewport_set_active", "viewport", "active"), &RenderingServer::viewport_set_active); ClassDB::bind_method(D_METHOD("viewport_set_parent_viewport", "viewport", "parent_viewport"), &RenderingServer::viewport_set_parent_viewport); ClassDB::bind_method(D_METHOD("viewport_attach_to_screen", "viewport", "rect", "screen"), &RenderingServer::viewport_attach_to_screen, DEFVAL(Rect2()), DEFVAL(DisplayServer::MAIN_WINDOW_ID)); ClassDB::bind_method(D_METHOD("viewport_set_render_direct_to_screen", "viewport", "enabled"), &RenderingServer::viewport_set_render_direct_to_screen); + ClassDB::bind_method(D_METHOD("viewport_set_scaling_3d_mode", "viewport", "scaling_3d_mode"), &RenderingServer::viewport_set_scaling_3d_mode); + ClassDB::bind_method(D_METHOD("viewport_set_scaling_3d_scale", "viewport", "scale"), &RenderingServer::viewport_set_scaling_3d_scale); + ClassDB::bind_method(D_METHOD("viewport_set_fsr_sharpness", "viewport", "sharpness"), &RenderingServer::viewport_set_fsr_sharpness); + ClassDB::bind_method(D_METHOD("viewport_set_fsr_mipmap_bias", "viewport", "mipmap_bias"), &RenderingServer::viewport_set_fsr_mipmap_bias); ClassDB::bind_method(D_METHOD("viewport_set_update_mode", "viewport", "update_mode"), &RenderingServer::viewport_set_update_mode); ClassDB::bind_method(D_METHOD("viewport_set_clear_mode", "viewport", "clear_mode"), &RenderingServer::viewport_set_clear_mode); ClassDB::bind_method(D_METHOD("viewport_get_texture", "viewport"), &RenderingServer::viewport_get_texture); @@ -2213,6 +2216,10 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("viewport_get_measured_render_time_gpu", "viewport"), &RenderingServer::viewport_get_measured_render_time_gpu); + BIND_ENUM_CONSTANT(VIEWPORT_SCALING_3D_MODE_BILINEAR); + BIND_ENUM_CONSTANT(VIEWPORT_SCALING_3D_MODE_FSR); + BIND_ENUM_CONSTANT(VIEWPORT_SCALING_3D_MODE_MAX); + BIND_ENUM_CONSTANT(VIEWPORT_UPDATE_DISABLED); BIND_ENUM_CONSTANT(VIEWPORT_UPDATE_ONCE); //then goes to disabled); must be manually updated BIND_ENUM_CONSTANT(VIEWPORT_UPDATE_WHEN_VISIBLE); // default @@ -2837,12 +2844,6 @@ RenderingServer::RenderingServer() { GLOBAL_DEF("rendering/vulkan/staging_buffer/texture_upload_region_size_px", 64); GLOBAL_DEF("rendering/vulkan/descriptor_pools/max_descriptors_per_pool", 64); - GLOBAL_DEF("rendering/3d/viewport/scale", 1.0); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/3d/viewport/scale", - PropertyInfo(Variant::FLOAT, - "rendering/3d/viewport/scale", - PROPERTY_HINT_RANGE, "0.25,2.0,0.01")); - GLOBAL_DEF("rendering/shader_compiler/shader_cache/enabled", true); GLOBAL_DEF("rendering/shader_compiler/shader_cache/compress", true); GLOBAL_DEF("rendering/shader_compiler/shader_cache/use_zstd_compression", true); @@ -2903,6 +2904,29 @@ RenderingServer::RenderingServer() { ProjectSettings::get_singleton()->set_custom_property_info("rendering/anti_aliasing/screen_space_roughness_limiter/amount", PropertyInfo(Variant::FLOAT, "rendering/anti_aliasing/screen_space_roughness_limiter/amount", PROPERTY_HINT_RANGE, "0.01,4.0,0.01")); ProjectSettings::get_singleton()->set_custom_property_info("rendering/anti_aliasing/screen_space_roughness_limiter/limit", PropertyInfo(Variant::FLOAT, "rendering/anti_aliasing/screen_space_roughness_limiter/limit", PROPERTY_HINT_RANGE, "0.01,1.0,0.01")); + GLOBAL_DEF_RST("rendering/scaling_3d/mode", 0); + GLOBAL_DEF_RST("rendering/scaling_3d/scale", 1.0); + GLOBAL_DEF_RST("rendering/scaling_3d/fsr_sharpness", 0.2f); + GLOBAL_DEF_RST("rendering/scaling_3d/fsr_mipmap_bias", 0.0f); + ProjectSettings::get_singleton()->set_custom_property_info("rendering/scaling_3d/mode", + PropertyInfo(Variant::INT, + "rendering/scaling_3d/mode", + PROPERTY_HINT_ENUM, "Bilinear (Fastest),FSR (Fast)")); + + ProjectSettings::get_singleton()->set_custom_property_info("rendering/scaling_3d/scale", + PropertyInfo(Variant::FLOAT, + "rendering/scaling_3d/scale", + PROPERTY_HINT_RANGE, "0.25,2.0,0.01")); + + ProjectSettings::get_singleton()->set_custom_property_info("rendering/scaling_3d/fsr_sharpness", + PropertyInfo(Variant::FLOAT, + "rendering/scaling_3d/fsr_sharpness", + PROPERTY_HINT_RANGE, "0,2,0.1")); + ProjectSettings::get_singleton()->set_custom_property_info("rendering/scaling_3d/fsr_mipmap_bias", + PropertyInfo(Variant::FLOAT, + "rendering/scaling_3d/fsr_mipmap_bias", + PROPERTY_HINT_RANGE, "-2,2,0.1")); + GLOBAL_DEF("rendering/textures/decals/filter", DECAL_FILTER_LINEAR_MIPMAPS); ProjectSettings::get_singleton()->set_custom_property_info("rendering/textures/decals/filter", PropertyInfo(Variant::INT, "rendering/textures/decals/filter", PROPERTY_HINT_ENUM, "Nearest (Fast),Nearest+Mipmaps,Linear,Linear+Mipmaps,Linear+Mipmaps Anisotropic (Slow)")); GLOBAL_DEF("rendering/textures/light_projectors/filter", LIGHT_PROJECTOR_FILTER_LINEAR_MIPMAPS); |