Aight - a vertex program it'll be then. I have a GF2, though, so I have no idea what the performance hit might be, even if done in software. Without having Googled for it, does anyone have link to a simple tutorial on the subject?
Quote:
BTW, how are you distorting the texture matrix? I wanted to do the same, but have yet to think of a good method for doing so...
Simple:
for(int j = 0, i0 = 0, i1 = 1, i2 = ex + 1, i3 = ex; j < ez - 1; j++) { for(int i = 0; i < ex - 1; i++, i0++, i1++, i2++, i3++) { if(!texcoords) { glMatrixMode(GL_TEXTURE); glPushMatrix(); glTranslatef(0, oscmap[i0].y, 0); } glBegin(GL_QUADS); if(texcoords) glTexCoord2f(texcoord[i0].u, texcoord[i0].v); glVertex3fv(oscmap[i0]); if(texcoords) glTexCoord2f(texcoord[i1].u, texcoord[i1].v); glVertex3fv(oscmap[i1]); if(texcoords) glTexCoord2f(texcoord[i2].u, texcoord[i2].v); glVertex3fv(oscmap[i2]); if(texcoords) glTexCoord2f(texcoord[i3].u, texcoord[i3].v); glVertex3fv(oscmap[i3]); glEnd(); if(!texcoords) glPopMatrix(); } i0++; i1++; i2++; i3++; }
Ignore the indexes - they're optimized to not include any array offset calculation inside the loop. This loop could be optimized a little further still by taking the call to glMatrixMode() out.
Otherwise it's meant to be called for either the diffuse map pass or with texcoords set to true or the reflection pass otherwise.
Note that by making oscmap[n].y (wave height) too large, the individual quads will start to form a shifting mosaic pattern since each four adjacent vertices entail an identical texture matrix shift. This is why a vertex program would indeed be a lot better solution - the only problem being that I've never even seen a bit of shader code before.
"Literally, it means that Bob is everything you can think of, but not dead; i.e., Bob is a purple-spotted, yellow-striped bumblebee/dragon/pterodactyl hybrid with a voracious addiction to Twix candy bars, but not dead."- kSquared