by Ian » Thu Nov 23, 2017 10:42 am
Right I fixed it ..
Can't believe it has taken so many attempts to get this right. The problem was caused by the fact the clamping to the range 0-1 must be done before fogIntensity is multiplied by the final value. Fog is supposed to be a simple per vertex attribute interpolated across the poly. But it turns out it's almost impossible to do it in the vertex shader because it's run before clipping happens. The model 3 must be calculating some of the attribs after clipping has been done. This can't be emulated directly in opengl, as the vertex shader always runs directly before clipping.
- Attachments
-

- fog final.jpg (178.21 KiB) Viewed 6455 times