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

Normal mapping doesn't work on iPhoneX #123

Closed
vorg opened this issue Jan 3, 2019 · 1 comment
Closed

Normal mapping doesn't work on iPhoneX #123

vorg opened this issue Jan 3, 2019 · 1 comment
Labels

Comments

@vorg
Copy link
Member

vorg commented Jan 3, 2019

It works fine on iPhone 7. Switching back to highp in the fragment shader fixes the issue.

Mozilla actually recommends avoiding mediump if possible https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices

@dmnsgn
Copy link
Member

dmnsgn commented May 5, 2023

Shader uses highp:

// get edge vectors of the pixel triangle
highp vec3 dp1 = dFdx(p);
highp vec3 dp2 = dFdy(p);
highp vec2 duv1 = dFdx(uv);
highp vec2 duv2 = dFdy(uv);

https://github.com/pex-gl/pex-shaders/blob/cb6db08184414ed8a17ff22864d53b424528e35a/shaders/chunks/normal-perturb.glsl.js#L6-L9

@dmnsgn dmnsgn closed this as completed May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants