ATIs.
This is actually a test to see if this can be enabled on ATI cards.
According to various sources, newer ATI cards supporting GLSL 3.0
support gl_ClippingDistance in shaders, which is the forward compatible
way to do custom clipping.
This fix will bind 6 additional varying variables on ATIs, which may
lead to some shaders not compiling due to limiting out of those
variables, or to performance degradation. Also I do not have an ATI
handy to test.
Having those in mind, this commit may well be reverted later.
Clipping planes are usually 4 (6 is for cube clipping), but making
shaders depend on viewport state is really bad, and would lead to
recompilation, so I took the worst case here to avoid that.
Hopefully driver does some optimization there.
Clipping border causes a software fallback on ATIs. We have disabled it
in that case but from minor digging on the net seems like Intels support
this, so enable.
* Rename functions and move to own header.
* Add wrapper functions for glLight.
* Auto detect if we can use faster code for solid lighting.
* Various fixes for textured draw mode.