Skip to content

Fix incorrect normal map shading in PBRLighting.#457

Merged
Nehon merged 1 commit into
jMonkeyEngine:PBRisComingfrom
Perjin:normal_map_shading
Mar 25, 2016
Merged

Fix incorrect normal map shading in PBRLighting.#457
Nehon merged 1 commit into
jMonkeyEngine:PBRisComingfrom
Perjin:normal_map_shading

Conversation

@Perjin
Copy link
Copy Markdown
Contributor

@Perjin Perjin commented Mar 25, 2016

With the new Mikk Tangent Space generator this fix in the shader should produce correct shading results.
BiNormal/biTangent needs to be calculated in the fragment shader and the final normal has to be normalized.
http://i.imgur.com/gz9pRUP.png
https://hub.jmonkeyengine.org/t/normal-map-shading-problems/34947/91

@Nehon
Copy link
Copy Markdown
Contributor

Nehon commented Mar 25, 2016

Man... that's awesome...I completely forgot the binormal was computed in the vertex shader...

@Nehon Nehon merged commit e452032 into jMonkeyEngine:PBRisComing Mar 25, 2016
@shadowislord
Copy link
Copy Markdown
Member

Can we apply the same fix to SPLighting.frag?

@Nehon
Copy link
Copy Markdown
Contributor

Nehon commented Mar 25, 2016

yep I'll take care of it

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.

3 participants