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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user