For loop in Pixelshader 2.0

Hi,

i try to use more than 1 light in a Pixelshader 2.0 and made a loop to go through all lights.

In this loop i use some 'normalize', 'mul' and 'dot' functions but it seems compiler unrolls this loop so i got with 3 and more lights "too many arithmetic instruction slots".

Is there any chance to avoid this loop unrolling



Answer this question

For loop in Pixelshader 2.0

  • David_52

    No. Pixelshader 2.0 does not support loops. If your shader does not fit you will have to use a multi pass solution.

    You can use the 2.A and 2.B profile to get a higher instruction limit but this shaders will not run on every hardware.



  • For loop in Pixelshader 2.0