Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a minimum of 0.01 for proximity fade to avoid undefined behavior in shader #89432

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

clayjohn
Copy link
Member

Caught while running Calinou's test suite. Currently we have some undefined behaviour when using proximity fade with a distance of 0.

code += " ALPHA*=clamp(1.0-smoothstep(world_pos.z+proximity_fade_distance,world_pos.z,VERTEX.z),0.0,1.0);\n";

https://registry.khronos.org/OpenGL-Refpages/gl4/html/smoothstep.xhtml

Results are undefined if edge0 ≥ edge1.

@akien-mga akien-mga merged commit d30aa4b into godotengine:master Mar 13, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants