PDA

View Full Version : multi pass



carl_lewis
03-07-2005, 07:32 AM
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:

dimensionX
03-07-2005, 04:29 PM
You can only use one program object for the entire pass. Cannot pipeline shaders in one pass.

sqrt[-1]
03-07-2005, 06:11 PM
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.

guyinhell
03-11-2005, 01:33 AM
my graphics card is 3dlabs wildcat realizm 200. could i also do multipass?

yooyo
03-11-2005, 02:02 AM
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

guyinhell
03-11-2005, 05:17 AM
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?

airseb
12-07-2005, 06:45 AM
Originally posted by guyinhell:
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?up

V-man
12-07-2005, 06:07 PM
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();