MatCap shader texture stretch


#1

Basic MatCap shader, tangent normals transformed to view, used as
texture coordinates. However this approach has a problem:

When something is near the edge of the screen it is possible to see
parts of the mesh where the normal is perpendicular (or less) to the
camera vector.

I was wondering if there is a reasonably cheap fix for this.


#2

You could try this:
Instead of using the cam dir vector, create a new vector using the cam position + vertex position
that should attenuate a lot that stretch.

cheers!

:slight_smile:


#3

yea, we did that trick on Epic Mickey because we converted our lighting to Spherical Harmonics and applied it as a spherical environment map. Works well!