Use a fragment shader as well as a vertex shader for the skinned meshes.

I tracked the ATI slowdown down to using a vertex shader in combination 
with fixed function fog.  Also cleaned up ShaderConfig a little.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@244 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Andrzej Kapolka
2007-05-14 20:13:39 +00:00
parent 6b07087c31
commit 124af1e0b1
4 changed files with 151 additions and 26 deletions
+8 -3
View File
@@ -38,6 +38,11 @@ attribute ATTRIB_TYPE boneIndices;
/** The bone weights. */
attribute ATTRIB_TYPE boneWeights;
/** The amount of fog. */
#ifdef FOG
varying float fogAlpha;
#endif
/**
* Vertex shader for skinned meshes.
*/
@@ -65,12 +70,12 @@ void main ()
vec3 eyeVertex = vec3(gl_ModelViewMatrix * modelVertex);
vec3 eyeNormal = normalize(vec3(gl_ModelViewMatrixInverseTranspose * modelNormal));
// eye space 'z' is the standard fog coordinate
gl_FogFragCoord = -eyeVertex.z;
// set gl_FrontColor based on vertex, normal and light parameters
SET_FRONT_COLOR
// set the varying texture coordinates
SET_TEX_COORDS
// set the fog alpha based on the eye space vertex
SET_FOG_ALPHA
}