Depth comparison is now used to prevent refraction from occurring
if the pixel being refracted is located in front of the object.
For pixels slightly behind the object, a `smoothstep()` curve
is used to progressively increases refraction intensity
as the distance between the object and the refraction increases.
This avoids sudden discontinuities in the refraction.
Co-authored-by: GeneralLegendary <generallegendary456@gmail.com>
Compatibility is based on OpenGL ES 3.0, so the height shader
(including deep parallax) and distance fade dither modes work
just fine with no adjustments required.
- Add range hints to all uniforms that match the BaseMaterial3D
property hints, so that ranges in the inspector remain identical
after converting to a shader.
- Add comments to describe selected options within the shader.
This makes it easier to remember what each block of code does.
- Format code to follow the Godot shader language style guide.
This PR is a follow up to #64092, which fixed important issues but it was implemented in an overly complex and inefficient way (because it forced the default code path to always go through string operations).
This cleans up all the shader parameter code.
This fixes#54336. Also fixes#56219 because, as the new code never queries the RenderingServer on load, potential deadlocks are avoided.
**NOTE**: materials saved between #62972 and #64092 will no longer work and will need to be resaved in an earlier version.
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.
It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).
We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).
Also fixed "cf." Frenchism - it's meant as "refer to / see".