I struggle to get correct specular / reflection for two days, and finally find out that, normal come to shader in world space, and mtx_normal transform it back to local space.
following code is what I use at the very beginning without doubt nor second thought
The engine is attempting to batch as many objects as possible into one draw call for performance reason (especially on older devices). The position and normal vectors etc. must be transformed on the CPU and sent to the shader in world space (one or more big vertex buffers).
The matrices sent to the shader should therefore be identity, but there was a bug regarding this fixed in 1.2.120 (see note on DEF-3090).
Note that there is upcoming functionality in the engine for selecting world or local vertex space from the material, where the local space will allow for GPU transform of vertex data (and thus generating a draw call per object). I can’t however give you an exact release date of this yet.
OK……get it……
This does not matter much but make billboard harder to write, but it’s OK.
And will custom vertex data come soon? Since I simulate texCubeLOD by interpolating two cubemap, and get satisfied result, normal map is now last obstacle between me and full blown PBR pipeline.
Custom vertex format is a frequently requested feature and is planned for, but I can’t give you any details on when and what it will look like yet, sorry.
Well, if custom vertex format will not be available soon enough, would you please consider add tangent to fix attribute list? Since this is essential for any 3D rendering with lighting