PDA

View Full Version : Rendering Passes?



Omaha
11-08-2001, 08:01 PM
Paging through my copy of the mighty Red Book and strolling through these forums, I've heard many references to first pass, second pass, etc. I understand the idea, but how is it done?

I understand how multiple textures can be used, but if your card does not have enough texturing capability, you have to use these multiple passes to get the same effect--how's that done?

Shag
11-08-2001, 08:27 PM
check out ...
http://nehe.gamedev.net/tutorials/lesson22.asp

and be sure to look at the other tutorials on that site! Good luck

11-09-2001, 01:15 AM
Simply.

glDepthTest (GL_LEQUAL);

// First pass
glBindTexture (GL_TEXTURE_2D, base_tex_id);
DrawPolygon (FIRST_TEXCOORD_SET);

glEnable (GL_BLEND);
glBlendFunc (GL_ZERO, GL_ONE);

// second pass
glBindTexture (GL_TEXTURE_2D, second_tex_id);
DrawPolygon (GL_SECOND_TEXCOORD_SET);

glDisable (GL_BLEND);


where GL_XXXXX_TEXCOORD_SET are constants for DrawPolygon indicating which texture coord set to use.

Sorry For Bad English