fix projection between shaders

This commit is contained in:
ZappoMan 2013-09-26 17:03:50 -07:00
parent c0bfdfbc4f
commit 07515d1c5f
2 changed files with 3 additions and 3 deletions

View file

@ -5,6 +5,6 @@ varying float voxelSize;
void main(void) {
gl_FrontColor = gl_Color;
gl_Position = gl_ModelViewMatrix * gl_Vertex; // don't call ftransform(), because we do projection in geometry shader
gl_Position = gl_Vertex; // don't call ftransform(), because we do projection in geometry shader
voxelSize = voxelSizeIn;
}

View file

@ -12,7 +12,7 @@
// Second dataset (? similar to how voxel avatars pass in bones??)
// which is the voxel size
//
// Note: In vertex shader DON'T do projection transform. Therefore passing the 3D coordinates xyz to geometric shader
// Note: In vertex shader doesn't do any transform. Therefore passing the 3D world coordinates xyz to us
//
// Output: GL_TRIANGLE_STRIP
//
@ -36,7 +36,7 @@ void faceOfVoxel(vec4 corner, float scale, float[COORD_PER_FACE] facePoints, vec
vertex[c] += (facePoints[cIndex] * scale);
}
gl_FrontColor = color;
gl_Position = gl_ProjectionMatrix * vertex;
gl_Position = gl_ModelViewProjectionMatrix * vertex;
EmitVertex();
}
EndPrimitive();