Question

I understand that (at least using hlsl in an .fx for an xna project) each technique can have multiple passes and each pass has associated a certain device state and its vertex and pixel shader function. Now my question is: given that the passes in a technique are executed one after another, does each pass imply a complete passage through the rendering pipeline? For istance, if I have a technique with two passes, is the following statement correct: the first pass takes data for the application (VertexBuffer) and goes through the pipeline, than the second pass takes what the first one has spat out and goes another time through the pipeline.

Was it helpful?

Solution

Usually the passes are independent from each other. All passes will use the same input geometry (usually defined by a vertex buffer). What they do with this geometry can vary.

E.g. you could have a technique with two passes. The first pass draws the object in the usual way. The second pass won't draw the object, but the normals as little lines. The result is the object with normals represented as lines.

Similarly multiple passes can be used for a wide range of effects like fur, glow, halo... Keep in mind that the result of the pipeline is usually a color. If you want to use this result as input for another shader, you need to rewire the pipeline (i.e. set new input objects, shaders...).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top