Normalize normal tangent and binormal before interpolating in the mobile renderer to avoid precision errors on heavily scaled meshes (backport for 4.3)

This commit is contained in:
clayjohn 2024-11-18 16:05:28 -08:00
parent 711c725cf1
commit 4cb41925b9

View File

@ -439,12 +439,12 @@ void main() {
vertex_interp = vertex; vertex_interp = vertex;
#ifdef NORMAL_USED #ifdef NORMAL_USED
normal_interp = normal; normal_interp = normalize(normal);
#endif #endif
#if defined(TANGENT_USED) || defined(NORMAL_MAP_USED) || defined(LIGHT_ANISOTROPY_USED) #if defined(TANGENT_USED) || defined(NORMAL_MAP_USED) || defined(LIGHT_ANISOTROPY_USED)
tangent_interp = tangent; tangent_interp = normalize(tangent);
binormal_interp = binormal; binormal_interp = normalize(binormal);
#endif #endif
#ifdef MODE_RENDER_DEPTH #ifdef MODE_RENDER_DEPTH