You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +00:00
Add support for contrast-adaptive sharpening in 3D (GLES3 only)
This is an older, easier to implement variant of CAS as a pure fragment shader. It doesn't support upscaling, but we won't make use of it (at least for now). The sharpening intensity can be adjusted on a per-Viewport basis. For the root viewport, it can be adjusted in the Project Settings. Since `textureLodOffset()` isn't available in GLES2, there is no way to support contrast-adaptive sharpening in GLES2.
This commit is contained in:
@@ -1219,12 +1219,15 @@
|
||||
Sets the number of MSAA samples to use. MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware.
|
||||
[b]Note:[/b] MSAA is not available on HTML5 export using the GLES2 backend.
|
||||
</member>
|
||||
<member name="rendering/quality/filters/sharpen_intensity" type="float" setter="" getter="" default="0.0">
|
||||
If set to a value greater than [code]0.0[/code], contrast-adaptive sharpening will be applied to the 3D viewport. This has a low performance cost and can be used to recover some of the sharpness lost from using FXAA. Values around [code]0.5[/code] generally give the best results. See also [member rendering/quality/filters/use_fxaa].
|
||||
</member>
|
||||
<member name="rendering/quality/filters/use_debanding" type="bool" setter="" getter="" default="false">
|
||||
If [code]true[/code], uses a fast post-processing filter to make banding significantly less visible. In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger.
|
||||
[b]Note:[/b] Only available on the GLES3 backend. [member rendering/quality/depth/hdr] must also be [code]true[/code] for debanding to be effective.
|
||||
</member>
|
||||
<member name="rendering/quality/filters/use_fxaa" type="bool" setter="" getter="" default="false">
|
||||
Enables FXAA in the root Viewport. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K.
|
||||
Enables FXAA in the root Viewport. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K. Some of the lost sharpness can be recovered by enabling contrast-adaptive sharpening (see [member rendering/quality/filters/sharpen_intensity]).
|
||||
</member>
|
||||
<member name="rendering/quality/filters/use_nearest_mipmap_filter" type="bool" setter="" getter="" default="false">
|
||||
If [code]true[/code], uses nearest-neighbor mipmap filtering when using mipmaps (also called "bilinear filtering"), which will result in visible seams appearing between mipmap stages. This may increase performance in mobile as less memory bandwidth is used. If [code]false[/code], linear mipmap filtering (also called "trilinear filtering") is used.
|
||||
|
||||
@@ -246,7 +246,7 @@
|
||||
If [code]true[/code], the viewport will disable 3D rendering. For actual disabling use [code]usage[/code].
|
||||
</member>
|
||||
<member name="fxaa" type="bool" setter="set_use_fxaa" getter="get_use_fxaa" default="false">
|
||||
Enables fast approximate antialiasing. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K.
|
||||
Enables fast approximate antialiasing. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K. Some of the lost sharpness can be recovered by enabling contrast-adaptive sharpening (see [member sharpen_intensity]).
|
||||
</member>
|
||||
<member name="global_canvas_transform" type="Transform2D" setter="set_global_canvas_transform" getter="get_global_canvas_transform">
|
||||
The global canvas transform of the viewport. The canvas transform is relative to this.
|
||||
@@ -304,6 +304,9 @@
|
||||
The shadow atlas' resolution (used for omni and spot lights). The value will be rounded up to the nearest power of 2.
|
||||
[b]Note:[/b] If this is set to 0, shadows won't be visible. Since user-created viewports default to a value of 0, this value must be set above 0 manually.
|
||||
</member>
|
||||
<member name="sharpen_intensity" type="float" setter="set_sharpen_intensity" getter="get_sharpen_intensity" default="0.0">
|
||||
If set to a value greater than [code]0.0[/code], contrast-adaptive sharpening will be applied to the 3D viewport. This has a low performance cost and can be used to recover some of the sharpness lost from using FXAA. Values around [code]0.5[/code] generally give the best results. See also [member fxaa].
|
||||
</member>
|
||||
<member name="size" type="Vector2" setter="set_size" getter="get_size" default="Vector2( 0, 0 )">
|
||||
The width and height of viewport.
|
||||
</member>
|
||||
|
||||
@@ -4198,6 +4198,17 @@
|
||||
Sets the size of the shadow atlas's images (used for omni and spot lights). The value will be rounded up to the nearest power of 2.
|
||||
</description>
|
||||
</method>
|
||||
<method name="viewport_set_sharpen_intensity">
|
||||
<return type="void">
|
||||
</return>
|
||||
<argument index="0" name="viewport" type="RID">
|
||||
</argument>
|
||||
<argument index="1" name="intensity" type="float">
|
||||
</argument>
|
||||
<description>
|
||||
Sets the sharpening [code]intensity[/code] for the [code]viewport[/code]. If set to a value greater than [code]0.0[/code], contrast-adaptive sharpening will be applied to the 3D viewport. This has a low performance cost and can be used to recover some of the sharpness lost from using FXAA. Values around [code]0.5[/code] generally give the best results. See also [method viewport_set_use_fxaa].
|
||||
</description>
|
||||
</method>
|
||||
<method name="viewport_set_size">
|
||||
<return type="void">
|
||||
</return>
|
||||
@@ -4275,7 +4286,7 @@
|
||||
<argument index="1" name="fxaa" type="bool">
|
||||
</argument>
|
||||
<description>
|
||||
Enables fast approximate antialiasing for this viewport. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K.
|
||||
Enables fast approximate antialiasing for this viewport. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K. Some of the lost sharpness can be recovered by enabling contrast-adaptive sharpening (see [method viewport_set_sharpen_intensity]).
|
||||
</description>
|
||||
</method>
|
||||
<method name="viewport_set_vflip">
|
||||
|
||||
Reference in New Issue
Block a user