vertex and fragment shader linkage

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!


gl_Position.w <- your vtx-sh code calculates/specifies it. The gpu internally uses 1/w for the persp-correct interpolation of varyings.