332 |
mat[2] * Li.x + mat[3] * Li.y, Li.z); |
mat[2] * Li.x + mat[3] * Li.y, Li.z); |
333 |
glColor3f(.5 * L.x + .5, .5 * L.y + .5, .5 * L.z + .5); |
glColor3f(.5 * L.x + .5, .5 * L.y + .5, .5 * L.z + .5); |
334 |
} |
} |
335 |
|
|
336 |
|
void PaperPass::independentSetup() { |
337 |
|
setupcode(); |
338 |
|
for(unsigned i=0; i<indirectTextureBinds.size(); i++) { |
339 |
|
indirectTextureBinds[i]->bind(); |
340 |
|
} |
341 |
|
} |
342 |
|
void PaperPass::independentTeardown() { |
343 |
|
for(unsigned i=0; i<indirectTextureBinds.size(); i++) { |
344 |
|
indirectTextureBinds[i]->unbind(); |
345 |
|
} |
346 |
|
teardowncode(); |
347 |
|
} |
348 |
|
|
349 |
void PaperPass::setUp_texgen(LightParam *param) { |
void PaperPass::setUp_texgen(LightParam *param) { |
350 |
setupcode(); |
independentSetup(); |
351 |
|
|
352 |
/* Set up TexGen for each texture unit */ |
/* Set up TexGen for each texture unit */ |
353 |
GLenum unit = GL_TEXTURE0_ARB; |
GLenum unit = GL_TEXTURE0_ARB; |
387 |
void PaperPass::setUp_VP(LightParam *param) { |
void PaperPass::setUp_VP(LightParam *param) { |
388 |
if (texgenvp.getSource().length() == 0) loadVP(); |
if (texgenvp.getSource().length() == 0) loadVP(); |
389 |
|
|
390 |
setupcode(); |
independentSetup(); |
391 |
|
|
392 |
/* Set up VP TexGen parameters for each texture unit */ |
/* Set up VP TexGen parameters for each texture unit */ |
393 |
int unit = 0; |
int unit = 0; |
410 |
} |
} |
411 |
|
|
412 |
void PaperPass::tearDown_VP() { |
void PaperPass::tearDown_VP() { |
413 |
teardowncode(); |
independentTeardown(); |
414 |
#ifdef GL_VERTEX_PROGRAM_NV |
#ifdef GL_VERTEX_PROGRAM_NV |
415 |
glDisable(GL_VERTEX_PROGRAM_NV); |
glDisable(GL_VERTEX_PROGRAM_NV); |
416 |
#endif |
#endif |
417 |
} |
} |
418 |
|
|
419 |
void PaperPass::setUp_explicit(LightParam *param) { |
void PaperPass::setUp_explicit(LightParam *param) { |
420 |
setupcode(); |
independentSetup(); |
421 |
|
|
422 |
/* Set up explicit TexGen parameters for each texture unit */ |
/* Set up explicit TexGen parameters for each texture unit */ |
423 |
for (vector<shared_ptr<TexGen> >::iterator it = texgen.begin(); it != texgen.end(); ++it) { |
for (vector<shared_ptr<TexGen> >::iterator it = texgen.begin(); it != texgen.end(); ++it) { |