Skip to main content
gamedev.net
🔒 Locked

Multipass texturing... concept

Started by CraZeE Jan 7, 2003 at 8:31 AM 4 replies 1.4k views
Original Post
CraZeE
CraZeE
wish gamedev gets its search up and running soon =( anyway, my question may have been discussed before, but bear with me. textures can be handled either thru singlepass multitexturing or multipass texturing. now, i''m pretty used with singlepass means (i believe its the lazy mans fastest way to understand multitex) but now i have a need to do multipass for compatibility. how does multipass actually work? i''m doing a ROAM based terrain engine, and use 4 TU''s for the base+3 detail textures. how do i go about converting to multipass. I reckon i can do it by re-rendering the mesh several times and using blending to get the textures working. however, the amount of polygon data juggled for this seems rather high. is there a way to do multipass WITHOUT geometry duplication? and assuming i got my whle multipass concept wrong, please enlighten me... thanx in advance.
To learn, we share... Give some to take some -
Ostsol
Ostsol
As far as I know, multi-pass rendering can only be accomplished via rendering the geometry multiple times and using blending. This is how Unreal Tournament does it, at least.
-Ostsol
Assassin
Assassin
You have to render the geometry again, and use some method of blending the source (currently being blended) pixel color with the destination (already in the frame buffer) color. Usually this is done by picking an alpha value and blending using SRC_ALPHA and INV_SRC_ALPHA or something like those. Others to choose from are DEST_ALPHA & INV_DEST_ALPHA, etc... I''m more a direct3d guy, but i imagine that opengl has all the same stuff. Keep in mind that older hardware tends to only support the "common" methods like the SRC_ALPHA/INV_SRC_ALPHA blending mode, and newer cards are more flexible.

And you''ll have to render the geometry multiple times for multi-pass rendering. Kind of a pain, and something that the directx9 multiple-buffers and nvidia''s NV_FLOAT_BUFFER (i think that''s the extension) can help alleviate if fillrate is a bit of a problem. It is recommended that if you''re doing a lot of multipass stuff or very complex shading that you perform the first pass on the entire scene (since it requires no blending) to fill the depth buffer up with the correct values. Then disable z-writes, and the subsequent passes will have an effective depth complexity of 1, since the Z-value stored in the depth buffer will only match one thing (using a lessequal comparison) most of the time. Render things in the same order so that z-fighting at least occurs on the same pixels with the corresponding texture, if at all.
Assassin, aka RedBeard. andyc.org
CodeMaster000
CodeMaster000
Is there a way to make different hieghts of a terrain blend into different textures using multitexturing and not multipass texturing?
CraZeE
CraZeE
thanx guys for confirming on the info i seeked. guess its polygon crunching time whether or not i like it.

and CodeMaster000, try using GL_ARB_texture_env_combine.Thats wat i use to interpolate the 3 detail textures i use. encode a grayscale color to ur heightmap vertices and an alpha channel too.
use the color to denote where the first two textures interpolate (black is grass, white is sand for instance). Use the alpha as the interpolation factor for the 3rd detail for instance. But since i''m doing this, i need 4 TU''s when using multitexture.

I suppose register combiners can reduce the TU''s needed but those are nVidia specific extension, so bummer.
To learn, we share... Give some to take some -

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.