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

Implement scalar multiplier of normal texture. #75

Merged
merged 2 commits into from
Apr 9, 2018
Merged

Implement scalar multiplier of normal texture. #75

merged 2 commits into from
Apr 9, 2018

Conversation

SamuelTallet
Copy link
Contributor

@SamuelTallet SamuelTallet commented Apr 7, 2018

Hello @pissang,

I added support of glTF normal scale.
I hope did it correctly ;) Let me know.

Kind regards,
Samuel Tallet-Sabathé

@pissang
Copy link
Owner

pissang commented Apr 9, 2018

@SamuelTS Thanks for the contribution!! GLSL code needs to be tweaked a bit. Applying normalScale should be done before multiplying tbn.

N = (normalTexel * 2.0 - 1.0);
// Apply scalar multiplier to normal vector of texture.
N =  normalize(N * vec3(normalScale, normalScale, 1.0));
tbn[1] = -tbn[1];
N = normalize(tbn * N);

Other modifications look fine to me!

@SamuelTallet
Copy link
Contributor Author

SamuelTallet commented Apr 9, 2018

Thanks for GLSL code tweak, @pissang.
I suppose glsl2js will auto-update JS? :)

@pissang pissang merged commit 5bbe5fc into pissang:master Apr 9, 2018
@pissang
Copy link
Owner

pissang commented Apr 9, 2018

@SamuelTS yeah.

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

Successfully merging this pull request may close these issues.

2 participants