terrain normals
terrain normals
How would I access the normals of the terrain node vertexes inside a shader?
Re: terrain normals
TerrainSceneNode seems to always use the IdentityMatrix. Not quite sure how that works (sorry, I still haven't worked myself with it). Maybe it re-calculates the terrain when the node is moved and mesh has absolute coordinates. Or the node can't be moved? I guess it's because the mesh has to change based on camera.
In that case I guess the normal passed to the vertex-shader should already be the correct normal without any need for further transformation. All you probably need to do is pass it on to the pixel-shader and normalize it in there once more.
No guarantees... I didn't try myself.
In that case I guess the normal passed to the vertex-shader should already be the correct normal without any need for further transformation. All you probably need to do is pass it on to the pixel-shader and normalize it in there once more.
No guarantees... I didn't try myself.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm