scenejs icon indicating copy to clipboard operation
scenejs copied to clipboard

Add constraint to prevent more than one normal map per drawable

Open xeolabs opened this issue 9 years ago • 0 comments

For each drawable, only use the normal map texture node that's closest to the geometry on the parent node path.

Reasons

  • A single pre-generated tangent array is given to the vertex shader, for the UV layer that's used for morphing.
  • The vertex stage generates the tangent-bitangent-normal matrix.
  • The vertex state multiplies the View-space eye vector by that matrix, then passes the tangent-space eye vector to the fragment stage as a varying.

Therefore, were we to support multiple normal maps, we would need a varying for an eye vector for each of those normal maps, which we can't afford.

There are no use cases for multiple normal maps anyway.

xeolabs avatar Mar 16 '16 13:03 xeolabs