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

Fix shader compilation if Oren-nayar render_mode is used #49418

Closed
wants to merge 1 commit into from

Conversation

Chaosus
Copy link
Member

@Chaosus Chaosus commented Jun 8, 2021

Without the fix, the shader will crash. This has been taken from the 3.x version of Godot.

@Chaosus Chaosus requested a review from a team as a code owner June 8, 2021 12:33
@Chaosus Chaosus added this to the 4.0 milestone Jun 8, 2021
@mrjustaguy
Copy link
Contributor

Wasn't Oren-nayar removed with #45023?

float t = mix(1.0, max(NdotL, NdotV), step(0.0, s));

float sigma2 = roughness * roughness; // TODO: this needs checking
vec3 A = 1.0 + sigma2 * (-0.5 / (sigma2 + 0.33) + 0.17 * diffuse_light / (sigma2 + 0.13));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed diffuse_color to diffuse_light since diffuse_color is removed in 4.0, maybe this should be a specular_light? cc @clayjohn

@Chaosus
Copy link
Member Author

Chaosus commented Jun 8, 2021

Wasn't Oren-nayar removed with #45023?

Ah, this change slipped my mind... Then it needs to be removed from the shader and StandardMaterial3D.

image

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

Successfully merging this pull request may close these issues.

2 participants