SV_Position in hlsl geometry shader

I am currently writing a geometry shader to create stencil volume shadows but I am quite stuck on the following error.

Not all elements of SV_Position were written.

Apparently I am not setting the position correctly? But I can’t wrap my head around what I doing wrong.


your geometry shader seems to take the wrong data type as input:

your vertex shader:

your geometry shader:
void ShadowGenerator(triangleadj VS_INPUT vertices[6], inout TriangleStream<VS_OUTPUT> triStream)

should probably take VS_OUTPUT as input…?

SV_Position, is a projected pixel position you have to write there result of mul (pos, mul (tW,tVP)) basically

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