PDA

View Full Version : Combining outputs of multiple shaders



Banzai
09-26-2003, 01:57 AM
Is it possible to combine the outputs of two fragment/vertex shaders?
I.e. the output of fragment shader 1 is used as input of fragment shader 2. Is this possible without using a multipass technique.

jwatte
09-26-2003, 08:27 AM
It is not possible without multipass.

Well, you could just concatenate the two programs, and wire up the output values of one to be TEMP registers that the second uses as input. But if you want really long programs, this will overflow the fixed program size limits.

Allegedly, the R9800 has F-buffer support, where the F-buffer is an intermediate per-fragment register store which would allow arbitrary shader concatenation, but I haven't seen it exposed in any driver/API yet.