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 some device have precision problem on ibl brdf #1728

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/core/src/shaderlib/pbr/ibl_frag_define.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ vec3 envBRDFApprox(vec3 specularColor,float roughness, float dotNV ) {

vec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;

return specularColor * AB.x + AB.y;
// warning: add `max` because (iPhone XS iOS 14.4) may return negative value, refer to issue: https://github.com/galacean/engine/pull/1728
return max(specularColor * AB.x + AB.y, 0.0);

}

Expand Down