View Full Version : vertex and fragment shader linkage

baum chen
11-09-2009, 04:49 PM
Hi, all

I have a general question on linkage between vertex shader/fragment shader.

to me, vertex shader's maximum output is 32 components, does this include gl_Position (even when position is not needed by fragment shader)?

another question is about rhw, fragment shader's maximum input is also 32 components (after packing), is rhw one of them? as rhw usually is only used implicitly (for perspective correction).

many thanks!


Ilian Dinev
11-09-2009, 06:03 PM
gl_Position.w <- your vtx-sh code calculates/specifies it. The gpu internally uses 1/w for the persp-correct interpolation of varyings.