Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c6a2189
Integrate AMD Fidelity FX SDK
HydrogenC Oct 10, 2025
9c5778a
Apply godot patches to FSR2
HydrogenC Oct 10, 2025
e6bfa4a
Refactor FSR1
HydrogenC Oct 11, 2025
0234c02
Remove legacy FSR code
HydrogenC Oct 11, 2025
0be4548
Update third party readme and fix build
HydrogenC Oct 11, 2025
9195502
Fix coding style
HydrogenC Oct 11, 2025
944d4a0
Reduce branches in the logic
HydrogenC Oct 12, 2025
c124722
More code style fixes
HydrogenC Oct 12, 2025
95fa72c
Update FSR-related labels in editor
HydrogenC Oct 13, 2025
b5a6054
Push pipeline compilation to the worker thread pool.
HydrogenC Oct 15, 2025
5f633c0
Make scratch buffer per-effect
HydrogenC Oct 15, 2025
9176671
Fix code style
HydrogenC Oct 15, 2025
7f726f6
Fix GCC build
HydrogenC Oct 16, 2025
00e1357
Fix incorrect binding defs for FSR2
HydrogenC Oct 16, 2025
4f9a639
Fix linux build
HydrogenC Oct 16, 2025
2598cd0
Add missing headers
HydrogenC Oct 16, 2025
a365ab2
Remove BOM from files
HydrogenC Oct 17, 2025
e3fe48c
Attempt to fix non-Windows build
HydrogenC Oct 17, 2025
4760df9
Fix CI failure
HydrogenC Oct 17, 2025
88d8b6b
Fix -Wswitch
HydrogenC Oct 17, 2025
d0bef1b
Fix CI
HydrogenC Oct 17, 2025
37f4162
Fix various non-MSVC compiler warnings
HydrogenC Oct 17, 2025
8d02cce
Workaround for Mesa-NIR backend
HydrogenC Oct 21, 2025
7b3e910
Initial impl for FSR3 Upscale (untested)
HydrogenC Oct 12, 2025
84ed95e
Setup editor part of FSR3 Upscale
HydrogenC Oct 13, 2025
011a379
Fix rumtime error
HydrogenC Oct 14, 2025
5d263d0
Fix GLSL alignment problem
HydrogenC Oct 14, 2025
55e085b
Code style fixes
HydrogenC Oct 14, 2025
703a9d9
Adapt to upstream FSR changes
HydrogenC Oct 15, 2025
76056ec
Add option to auto-generate reactive mask
HydrogenC Oct 16, 2025
c4b20a7
Remove unnecessary resource creation
HydrogenC Oct 16, 2025
2952b2d
Fix FSR3 reactive generation failing
HydrogenC Oct 16, 2025
94439ea
Fix coding style
HydrogenC Oct 16, 2025
353259b
Apply suggestions about docs from code review
HydrogenC Oct 17, 2025
2102410
Remove BOM from files
HydrogenC Oct 17, 2025
20ecb6a
Resolve PR suggestions
HydrogenC Oct 18, 2025
8baf04e
Fix compile error due to upstream changes
HydrogenC Oct 24, 2025
a8f411d
Fixes for clang-cl
HydrogenC Nov 11, 2025
a2f49a1
Use compute texture copy over hardware copy
HydrogenC Nov 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/classes/ProjectSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3362,6 +3362,9 @@
A larger number is more efficient up to a limit, after that it will only waste RAM (maximum efficiency is achieved when there is no more than 1 pool per frame). A small number could end up with one pool per descriptor, which negatively impacts performance.
[b]Note:[/b] Changing this property requires a restart to take effect.
</member>
<member name="rendering/scaling_3d/fsr_auto_generate_reactive" type="bool" setter="" getter="" default="false">
Determines whether to automatically generate a reactive mask for FSR 2/3. Setting this to [code]true[/code] will reduce flickering when upscaling transparent objects, at a cost of one more rendering pass.
</member>
<member name="rendering/scaling_3d/fsr_sharpness" type="float" setter="" getter="" default="0.2">
Determines how sharp the upscaled image will be when using the FSR upscaling mode. Sharpness halves with every whole number. Values go from 0.0 (sharpest) to 2.0. Values above 2.0 won't make a visible difference.
</member>
Expand Down
3 changes: 3 additions & 0 deletions doc/classes/RenderSceneBuffersConfiguration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<member name="anisotropic_filtering_level" type="int" setter="set_anisotropic_filtering_level" getter="get_anisotropic_filtering_level" enum="RenderingServer.ViewportAnisotropicFiltering" default="2">
Level of the anisotropic filter.
</member>
<member name="fsr_auto_generate_reactive" type="bool" setter="set_fsr_auto_generate_reactive" getter="get_fsr_auto_generate_reactive" default="false">
If [code]true[/code], automatically generate a reactive mask for FSR 2/3.
</member>
<member name="fsr_sharpness" type="float" setter="set_fsr_sharpness" getter="get_fsr_sharpness" default="0.0">
FSR Sharpness applicable if FSR upscaling is used.
</member>
Expand Down
7 changes: 7 additions & 0 deletions doc/classes/RenderSceneBuffersExtension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
Implement this in GDExtension to change the anisotropic filtering level.
</description>
</method>
<method name="_set_fsr_auto_generate_reactive" qualifiers="virtual">
<return type="void" />
<param index="0" name="fsr_auto_generate_reactive" type="bool" />
<description>
Implement this in GDExtension to record a new FSR auto generate reactive value.
</description>
</method>
<method name="_set_fsr_sharpness" qualifiers="virtual">
<return type="void" />
<param index="0" name="fsr_sharpness" type="float" />
Expand Down
6 changes: 6 additions & 0 deletions doc/classes/RenderSceneBuffersRD.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@
If [param msaa] is [code]true[/code] and MSAA is enabled, this returns the MSAA variant of the buffer.
</description>
</method>
<method name="get_fsr_auto_generate_reactive" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if FSR automatically generates reactive mask during upscaling, [code]false[/code] otherwise.
</description>
</method>
<method name="get_fsr_sharpness" qualifiers="const">
<return type="float" />
<description>
Expand Down
23 changes: 17 additions & 6 deletions doc/classes/RenderingServer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4098,6 +4098,14 @@
Sets the viewport's environment mode which allows enabling or disabling rendering of 3D environment over 2D canvas. When disabled, 2D will not be affected by the environment. When enabled, 2D will be affected by the environment if the environment background mode is [constant ENV_BG_CANVAS]. The default behavior is to inherit the setting from the viewport's parent. If the topmost parent is also set to [constant VIEWPORT_ENVIRONMENT_INHERIT], then the behavior will be the same as if it was set to [constant VIEWPORT_ENVIRONMENT_ENABLED].
</description>
</method>
<method name="viewport_set_fsr_auto_generate_reactive">
<return type="void" />
<param index="0" name="viewport" type="RID" />
<param index="1" name="fsr_auto_generate_reactive" type="bool" />
<description>
Determines whether to automatically generate a reactive mask for FSR 2/3. Setting this to [code]true[/code] will reduce flickering when upscaling transparent objects, at a cost of one more rendering pass.
</description>
</method>
<method name="viewport_set_fsr_sharpness">
<return type="void" />
<param index="0" name="viewport" type="RID" />
Expand Down Expand Up @@ -5100,21 +5108,24 @@
<constant name="VIEWPORT_SCALING_3D_MODE_BILINEAR" value="0" enum="ViewportScaling3DMode">
Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than [code]1.0[/code] will result in undersampling while values greater than [code]1.0[/code] will result in supersampling. A value of [code]1.0[/code] disables scaling.
</constant>
<constant name="VIEWPORT_SCALING_3D_MODE_FSR" value="1" enum="ViewportScaling3DMode">
Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than [code]1.0[/code] will result in the viewport being upscaled using FSR. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] disables scaling.
<constant name="VIEWPORT_SCALING_3D_MODE_FSR1" value="1" enum="ViewportScaling3DMode">
Use AMD FidelityFX Super Resolution 1.2 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than [code]1.0[/code] will result in the viewport being upscaled using FSR1. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] disables scaling.
</constant>
<constant name="VIEWPORT_SCALING_3D_MODE_FSR2" value="2" enum="ViewportScaling3DMode">
Use AMD FidelityFX Super Resolution 2.2 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than [code]1.0[/code] will result in the viewport being upscaled using FSR2. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] will use FSR2 at native resolution as a TAA solution.
Use AMD FidelityFX Super Resolution 2.3 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than [code]1.0[/code] will result in the viewport being upscaled using FSR2. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] will use FSR2 at native resolution as a TAA solution.
</constant>
<constant name="VIEWPORT_SCALING_3D_MODE_FSR3" value="3" enum="ViewportScaling3DMode">
Use AMD FidelityFX Super Resolution 3.1 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than [code]1.0[/code] will result in the viewport being upscaled using FSR3. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] will use FSR3 at native resolution as a TAA solution.
</constant>
<constant name="VIEWPORT_SCALING_3D_MODE_METALFX_SPATIAL" value="3" enum="ViewportScaling3DMode">
<constant name="VIEWPORT_SCALING_3D_MODE_METALFX_SPATIAL" value="4" enum="ViewportScaling3DMode">
Use MetalFX spatial upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than [code]1.0[/code] will result in the viewport being upscaled using MetalFX. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] disables scaling.
[b]Note:[/b] Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS.
</constant>
<constant name="VIEWPORT_SCALING_3D_MODE_METALFX_TEMPORAL" value="4" enum="ViewportScaling3DMode">
<constant name="VIEWPORT_SCALING_3D_MODE_METALFX_TEMPORAL" value="5" enum="ViewportScaling3DMode">
Use MetalFX temporal upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than [code]1.0[/code] will result in the viewport being upscaled using MetalFX. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] will use MetalFX at native resolution as a TAA solution.
[b]Note:[/b] Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS.
</constant>
<constant name="VIEWPORT_SCALING_3D_MODE_MAX" value="5" enum="ViewportScaling3DMode">
<constant name="VIEWPORT_SCALING_3D_MODE_MAX" value="6" enum="ViewportScaling3DMode">
Represents the size of the [enum ViewportScaling3DMode] enum.
</constant>
<constant name="VIEWPORT_UPDATE_DISABLED" value="0" enum="ViewportUpdateMode">
Expand Down
12 changes: 9 additions & 3 deletions doc/classes/Viewport.xml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@
<member name="disable_3d" type="bool" setter="set_disable_3d" getter="is_3d_disabled" default="false">
Disable 3D rendering (but keep 2D rendering).
</member>
<member name="fsr_auto_generate_reactive" type="bool" setter="set_fsr_auto_generate_reactive" getter="get_fsr_auto_generate_reactive" default="false">
Determines whether FSR 2/3 runs an additional pass to generate an reactive mask. Enabling this will increase GPU time, but provide better upscaling results for transparent objects.
To control this property on the root viewport, set the [member ProjectSettings.rendering/scaling_3d/fsr_auto_generate_reactive] project setting.
</member>
<member name="fsr_sharpness" type="float" setter="set_fsr_sharpness" getter="get_fsr_sharpness" default="0.2">
Determines how sharp the upscaled image will be when using the FSR upscaling mode. Sharpness halves with every whole number. Values go from 0.0 (sharpest) to 2.0. Values above 2.0 won't make a visible difference.
To control this property on the root viewport, set the [member ProjectSettings.rendering/scaling_3d/fsr_sharpness] project setting.
Expand Down Expand Up @@ -559,21 +563,23 @@
<constant name="SCALING_3D_MODE_FSR2" value="2" enum="Scaling3DMode">
Use AMD FidelityFX Super Resolution 2.2 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than [code]1.0[/code] will result in the viewport being upscaled using FSR2. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] will use FSR2 at native resolution as a TAA solution.
</constant>
<constant name="SCALING_3D_MODE_METALFX_SPATIAL" value="3" enum="Scaling3DMode">
<constant name="SCALING_3D_MODE_FSR3" value="3" enum="Scaling3DMode">
</constant>
<constant name="SCALING_3D_MODE_METALFX_SPATIAL" value="4" enum="Scaling3DMode">
Use the [url=https://developer.apple.com/documentation/metalfx/mtlfxspatialscaler#overview]MetalFX spatial upscaler[/url] for the viewport's 3D buffer.
The amount of scaling can be set using [member scaling_3d_scale].
Values less than [code]1.0[/code] will result in the viewport being upscaled using MetalFX. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] disables scaling.
More information: [url=https://developer.apple.com/documentation/metalfx]MetalFX[/url].
[b]Note:[/b] Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS.
</constant>
<constant name="SCALING_3D_MODE_METALFX_TEMPORAL" value="4" enum="Scaling3DMode">
<constant name="SCALING_3D_MODE_METALFX_TEMPORAL" value="5" enum="Scaling3DMode">
Use the [url=https://developer.apple.com/documentation/metalfx/mtlfxtemporalscaler#overview]MetalFX temporal upscaler[/url] for the viewport's 3D buffer.
The amount of scaling can be set using [member scaling_3d_scale]. To determine the minimum input scale, use the [method RenderingDevice.limit_get] method with [constant RenderingDevice.LIMIT_METALFX_TEMPORAL_SCALER_MIN_SCALE].
Values less than [code]1.0[/code] will result in the viewport being upscaled using MetalFX. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] will use MetalFX at native resolution as a TAA solution.
More information: [url=https://developer.apple.com/documentation/metalfx]MetalFX[/url].
[b]Note:[/b] Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS.
</constant>
<constant name="SCALING_3D_MODE_MAX" value="5" enum="Scaling3DMode">
<constant name="SCALING_3D_MODE_MAX" value="6" enum="Scaling3DMode">
Represents the size of the [enum Scaling3DMode] enum.
</constant>
<constant name="MSAA_DISABLED" value="0" enum="MSAA">
Expand Down
1 change: 1 addition & 0 deletions drivers/gles3/storage/render_scene_buffers_gles3.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class RenderSceneBuffersGLES3 : public RenderSceneBuffers {

virtual void set_anisotropic_filtering_level(RS::ViewportAnisotropicFiltering p_anisotropic_filtering_level) override {}
virtual void set_fsr_sharpness(float p_fsr_sharpness) override {}
virtual void set_fsr_auto_generate_reactive(bool p_fsr_auto_generate_reactive) override {}
virtual void set_texture_mipmap_bias(float p_texture_mipmap_bias) override {}
virtual void set_use_debanding(bool p_use_debanding) override {}
void set_apply_color_adjustments_in_post(bool p_apply_in_post);
Expand Down
3 changes: 3 additions & 0 deletions editor/scene/3d/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3164,6 +3164,9 @@ void Node3DEditorViewport::_project_settings_changed() {
const float fsr_sharpness = GLOBAL_GET("rendering/scaling_3d/fsr_sharpness");
viewport->set_fsr_sharpness(fsr_sharpness);

const bool fsr_auto_generate_reactive = GLOBAL_GET("rendering/scaling_3d/fsr_auto_generate_reactive");
viewport->set_fsr_auto_generate_reactive(fsr_auto_generate_reactive);

const float texture_mipmap_bias = GLOBAL_GET("rendering/textures/default_filters/texture_mipmap_bias");
viewport->set_texture_mipmap_bias(texture_mipmap_bias);

Expand Down
23 changes: 22 additions & 1 deletion scene/main/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4890,6 +4890,21 @@ float Viewport::get_fsr_sharpness() const {
return fsr_sharpness;
}

void Viewport::set_fsr_auto_generate_reactive(bool p_fsr_auto_generate_reactive) {
ERR_MAIN_THREAD_GUARD;
if (fsr_auto_generate_reactive == p_fsr_auto_generate_reactive) {
return;
}

fsr_auto_generate_reactive = p_fsr_auto_generate_reactive;
RS::get_singleton()->viewport_set_fsr_auto_generate_reactive(viewport, p_fsr_auto_generate_reactive);
}

bool Viewport::get_fsr_auto_generate_reactive() const {
ERR_READ_THREAD_GUARD_V(0);
return fsr_auto_generate_reactive;
}

void Viewport::set_texture_mipmap_bias(float p_texture_mipmap_bias) {
ERR_MAIN_THREAD_GUARD;
if (texture_mipmap_bias == p_texture_mipmap_bias) {
Expand Down Expand Up @@ -5123,6 +5138,9 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_fsr_sharpness", "fsr_sharpness"), &Viewport::set_fsr_sharpness);
ClassDB::bind_method(D_METHOD("get_fsr_sharpness"), &Viewport::get_fsr_sharpness);

ClassDB::bind_method(D_METHOD("set_fsr_auto_generate_reactive", "fsr_auto_generate_reactive"), &Viewport::set_fsr_auto_generate_reactive);
ClassDB::bind_method(D_METHOD("get_fsr_auto_generate_reactive"), &Viewport::get_fsr_auto_generate_reactive);

ClassDB::bind_method(D_METHOD("set_texture_mipmap_bias", "texture_mipmap_bias"), &Viewport::set_texture_mipmap_bias);
ClassDB::bind_method(D_METHOD("get_texture_mipmap_bias"), &Viewport::get_texture_mipmap_bias);

Expand Down Expand Up @@ -5163,11 +5181,12 @@ void Viewport::_bind_methods() {

#ifndef _3D_DISABLED
ADD_GROUP("Scaling 3D", "");
ADD_PROPERTY(PropertyInfo(Variant::INT, "scaling_3d_mode", PROPERTY_HINT_ENUM, "Bilinear (Fastest),FSR 1.0 (Fast),FSR 2.2 (Slow),MetalFX (Spatial),MetalFX (Temporal)"), "set_scaling_3d_mode", "get_scaling_3d_mode");
ADD_PROPERTY(PropertyInfo(Variant::INT, "scaling_3d_mode", PROPERTY_HINT_ENUM, "Bilinear (Fastest),FSR 1.2 (Fast),FSR 2.3 (Slow),FSR 3.1 (Slow),MetalFX (Spatial),MetalFX (Temporal)"), "set_scaling_3d_mode", "get_scaling_3d_mode");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "scaling_3d_scale", PROPERTY_HINT_RANGE, "0.25,2.0,0.01"), "set_scaling_3d_scale", "get_scaling_3d_scale");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "texture_mipmap_bias", PROPERTY_HINT_RANGE, "-2,2,0.001"), "set_texture_mipmap_bias", "get_texture_mipmap_bias");
ADD_PROPERTY(PropertyInfo(Variant::INT, "anisotropic_filtering_level", PROPERTY_HINT_ENUM, String::utf8("Disabled (Fastest),2× (Faster),4× (Fast),8× (Average),16x (Slow)")), "set_anisotropic_filtering_level", "get_anisotropic_filtering_level");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "fsr_sharpness", PROPERTY_HINT_RANGE, "0,2,0.1"), "set_fsr_sharpness", "get_fsr_sharpness");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "fsr_auto_generate_reactive"), "set_fsr_auto_generate_reactive", "get_fsr_auto_generate_reactive");
ADD_GROUP("Variable Rate Shading", "vrs_");
ADD_PROPERTY(PropertyInfo(Variant::INT, "vrs_mode", PROPERTY_HINT_ENUM, "Disabled,Texture,XR"), "set_vrs_mode", "get_vrs_mode");
ADD_PROPERTY(PropertyInfo(Variant::INT, "vrs_update_mode", PROPERTY_HINT_ENUM, "Disabled,Once,Always"), "set_vrs_update_mode", "get_vrs_update_mode");
Expand Down Expand Up @@ -5224,6 +5243,7 @@ void Viewport::_bind_methods() {
BIND_ENUM_CONSTANT(SCALING_3D_MODE_BILINEAR);
BIND_ENUM_CONSTANT(SCALING_3D_MODE_FSR);
BIND_ENUM_CONSTANT(SCALING_3D_MODE_FSR2);
BIND_ENUM_CONSTANT(SCALING_3D_MODE_FSR3);
BIND_ENUM_CONSTANT(SCALING_3D_MODE_METALFX_SPATIAL);
BIND_ENUM_CONSTANT(SCALING_3D_MODE_METALFX_TEMPORAL);
BIND_ENUM_CONSTANT(SCALING_3D_MODE_MAX);
Expand Down Expand Up @@ -5369,6 +5389,7 @@ Viewport::Viewport() {
set_scaling_3d_mode((Viewport::Scaling3DMode)(int)GLOBAL_GET("rendering/scaling_3d/mode"));
set_scaling_3d_scale(GLOBAL_GET("rendering/scaling_3d/scale"));
set_fsr_sharpness((float)GLOBAL_GET("rendering/scaling_3d/fsr_sharpness"));
set_fsr_auto_generate_reactive((bool)GLOBAL_GET("rendering/scaling_3d/fsr_auto_generate_reactive"));
set_texture_mipmap_bias((float)GLOBAL_GET("rendering/textures/default_filters/texture_mipmap_bias"));
set_anisotropic_filtering_level((Viewport::AnisotropicFiltering)(int)GLOBAL_GET("rendering/textures/default_filters/anisotropic_filtering_level"));
#endif // _3D_DISABLED
Expand Down
5 changes: 5 additions & 0 deletions scene/main/viewport.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class Viewport : public Node {
SCALING_3D_MODE_BILINEAR,
SCALING_3D_MODE_FSR,
SCALING_3D_MODE_FSR2,
SCALING_3D_MODE_FSR3,
SCALING_3D_MODE_METALFX_SPATIAL,
SCALING_3D_MODE_METALFX_TEMPORAL,
SCALING_3D_MODE_MAX
Expand Down Expand Up @@ -314,6 +315,7 @@ class Viewport : public Node {
Scaling3DMode scaling_3d_mode = SCALING_3D_MODE_BILINEAR;
float scaling_3d_scale = 1.0;
float fsr_sharpness = 0.2f;
bool fsr_auto_generate_reactive = false;
float texture_mipmap_bias = 0.0f;
AnisotropicFiltering anisotropic_filtering_level = ANISOTROPY_4X;
bool use_debanding = false;
Expand Down Expand Up @@ -590,6 +592,9 @@ class Viewport : public Node {
void set_fsr_sharpness(float p_fsr_sharpness);
float get_fsr_sharpness() const;

void set_fsr_auto_generate_reactive(bool p_fsr_auto_generate_reactive);
bool get_fsr_auto_generate_reactive() const;

void set_texture_mipmap_bias(float p_texture_mipmap_bias);
float get_texture_mipmap_bias() const;

Expand Down
9 changes: 6 additions & 3 deletions servers/rendering/renderer_rd/effects/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ env_effects = env.Clone()

thirdparty_obj = []

thirdparty_dir = "#thirdparty/amd-fsr2/"
thirdparty_sources = ["ffx_assert.cpp", "ffx_fsr2.cpp"]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
thirdparty_dir = "#thirdparty/amd-ffx/"
thirdparty_sources = thirdparty_dir + "*.cpp"

if env.dev_build:
env_effects.Append(CPPDEFINES=["FFX_DEBUG"])

env_effects.Prepend(CPPPATH=[thirdparty_dir])

Expand Down Expand Up @@ -69,6 +71,7 @@ env.servers_sources += thirdparty_obj
module_obj = []

env_effects.add_source_files(module_obj, "*.cpp")
env_effects.add_source_files(module_obj, "ffx/*.cpp")
if env["metal"]:
env_effects.add_source_files(module_obj, "metal_fx.mm")
env.servers_sources += module_obj
Expand Down
Loading
Loading