You can check if the vertex is at or behind near clipping plane. If so, move it, so it is in front of clipping plane using WPO , leaving rest of your material calculations use unmodified WPO positions.
Hacky and dirty, but reliable.
You can check if the vertex is at or behind near clipping plane. If so, move it, so it is in front of clipping plane using WPO , leaving rest of your material calculations use unmodified WPO positions.
Hacky and dirty, but reliable.