Varrying arrays question and weird discard


I was wondering if we could have varying arrays(of floats) in vertex/fragment shaders. How does the vertex shader interpolates in this case?

Also, I have a program running at 5FPS whith a lot of rendering. When discarding all my fragments(just to estimate the cost of my shaders), I only have 10FPS, wich is illogical cause my fragment shaders have big loops with atan in it…
Is discard something costy and should be avoided?

Cheers, Jeff.

That depends on hw. On GFFX whole fragment shader is executed even with discard in first line. On NV4x discard stop execution of FS.

Another issue is that nvidia compile shaders during linking, and they compiler is able to detect unused varyings and it can remove computations from vertex shader. Only way to do it is to write very simple fragment shader that just add all varyings to finalcolor.

I don’t know how ATI deals with this…


Well the problem is that I have a GF6600, I really don’t understand what is happening…

Also for my varying array, it has a max size and when filled, the loop is dynamic(no constant end term) so I doubt the compiler optimises this.
But again, how do you think arrays are interpolated?

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