Dynamically calculate normals/tangents #4407
-
Hello everyone. I have been trying to convert my SceneKit development into Filament (at least for Android) I create dynamically a geometry with 400 vertices -> 2166 indices I am now trying to add lightning now but I realise I need to add normals first. From what I saw, I also need tangents and bitangents to be added (and calculated)
Is there a way to dynamically calculate normals and tangents in this case? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
To do this automatically you can use the
In addition if you won't use normal mapping or anisotropy, you can just make up the tangents/bitangents (set one to +X and the other one to +Y always for instance). |
Beta Was this translation helpful? Give feedback.
To do this automatically you can use the
SurfaceOrientation
class. It offers several methods that will be more or less precise based on:In addition if you won't use normal mapping or anisotropy, you can just make up the tangents/bitangents (set one to +X and the other one to +Y always for instance).