style cleanup

This commit is contained in:
ZappoMan 2013-09-26 16:45:09 -07:00
parent 864c00c6e0
commit 57b30c13d8
2 changed files with 10 additions and 23 deletions

View file

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

View file

@ -47,8 +47,7 @@ void faceOfVoxel(vec4 corner, float scale, float[COORD_PER_FACE] facePoints, vec
} }
void main() void main() {
{
//increment variable //increment variable
int i; int i;
vec4 corner; vec4 corner;
@ -61,26 +60,14 @@ void main()
float frontFace[COORD_PER_FACE] = float[COORD_PER_FACE]( 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0 ); float frontFace[COORD_PER_FACE] = float[COORD_PER_FACE]( 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0 );
float backFace[COORD_PER_FACE] = float[COORD_PER_FACE]( 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1 ); float backFace[COORD_PER_FACE] = float[COORD_PER_FACE]( 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1 );
vec4 color,red,green,blue,yellow,cyan,purple;
green = vec4(0,1.0,0,1.0);
red = vec4(1.0,0,0,1.0);
blue = vec4(0,0,1.0,1.0);
yellow = vec4(1.0,1.0,0,1.0);
cyan = vec4(0,1.0,1.0,1.0);
purple = vec4(1.0,0,1.0,1.0);
for(i = 0; i < gl_VerticesIn; i++) { for(i = 0; i < gl_VerticesIn; i++) {
gl_FrontColor = gl_FrontColorIn[i];
corner = gl_PositionIn[i]; corner = gl_PositionIn[i];
scale = voxelSize[i]; scale = voxelSize[i];
color = gl_FrontColorIn[i]; faceOfVoxel(corner, scale, bottomFace, gl_FrontColorIn[i]);
faceOfVoxel(corner, scale, topFace, gl_FrontColorIn[i]);
faceOfVoxel(corner, scale, bottomFace, color); faceOfVoxel(corner, scale, rightFace, gl_FrontColorIn[i]);
faceOfVoxel(corner, scale, topFace, color); faceOfVoxel(corner, scale, leftFace, gl_FrontColorIn[i]);
faceOfVoxel(corner, scale, rightFace, color); faceOfVoxel(corner, scale, frontFace, gl_FrontColorIn[i]);
faceOfVoxel(corner, scale, leftFace, color); faceOfVoxel(corner, scale, backFace, gl_FrontColorIn[i]);
faceOfVoxel(corner, scale, frontFace, color);
faceOfVoxel(corner, scale, backFace, color);
} }
} }