multi pass

just one word really, HOW?

i’v seen these magical words in many places, but no real description of what they mean in code terms.

can i set up a few frag shaders and automatically run through them.
or do i render with one, flush, render with the next, flush…

:confused:

You can only use one program object for the entire pass. Cannot pipeline shaders in one pass.

multi-pass does what the name suggests :- Multiple passes. You can perform effects that cannot be done in one pass by multi-passing. For example:

1st pass) Render diffuse lighting of the object
2nd pass) Render specular lighting of the object (with additive blending)

For each of these passes you will have to bind a different shader but you do not have to do a “flush” between passes.

It has been suggested that future drivers/hardware may be able to break up complex shaders into multiple passes - but no driver will currently do this. If you want to multi pass you will have to do it manually.

my graphics card is 3dlabs wildcat realizm 200. could i also do multipass?

Originally posted by guyinhell:
my graphics card is 3dlabs wildcat realizm 200. could i also do multipass?
Yes… you can do multipass even on old TNT board.
Multipass means, that you render screen in several passes and in each pass you add to image something new.
Multipass is good when you want to speedup things. For example imagine that you render geometry with very complex and expensive shader and after that you overdraw it by simple shaded wall. It’s a waste of GPU time. So… in first pass render scene to depth buffer only (no shaders, no textures). This is very fast pass. In second pass render scene again but disable depth write and turn on shaders and textures. During rasterization, hw will discard fragments that fail z-test and complex shader will not be executed if faces are depth occluded.

yooyo

hi yooyo:

it seems that i understood multi pass wrongly. if i do a image convolution with a 7x7 kernel, i must read the texture 48 times. siince the exture reads are limited, maybe i use a shader to read 24 neighboring pixels and another shader to read the other 24 neighboring pixel. is it also kinda multi pass? is it possible?

Originally posted by guyinhell:
[b]hi yooyo:

it seems that i understood multi pass wrongly. if i do a image convolution with a 7x7 kernel, i must read the texture 48 times. siince the exture reads are limited, maybe i use a shader to read 24 neighboring pixels and another shader to read the other 24 neighboring pixel. is it also kinda multi pass? is it possible?[/b]
up

I imagine that multi pass means rendering the same geometry at the same location more than once.

But these are just words (multipass). Do whatever you find necessary.

If you will multipass, just remember that invarience is important. We want fragments to be in the same X and Y positions and have the same Z as previous passes, otherwise you get what resembles z fighting and missed pixels.

With GLSL, invarience is acheived with

gl_Position = ftransform();

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.