opengl - Is writing to `gl_Position` in Vertex Shader necessery when there is a Geometry Shader -


this stupid question, yet...:

suppose have geometry shader computes output gl_position inputs other gl_in[].gl_position. if previous pipelines stages (vertex , tessellation) not write out gl_position, action of entire pipeline still remains well-defined?

or put other way, value of gl_position has effect on functioning of gl before completion of geometry shader? if not, mean can use slot passing data without special spatial interpretation between stages, right?

(the question assumes opengl 4.5 forward profile.)

gl_position needs written final vertex processing stage (vs, tessellation, , gs) in rendering pipeline. if have active gs, vs connects need not write gl_position @ all. or can put arbitrary vec4 data in it.

do note gl_position still need written whatever final vertex processing stage is. assuming want rasterization, of course. , no, that's not being flippant; doing transform feedback.

if not, mean can use slot passing data without special spatial interpretation between stages, right?

if there's gs, none of outputs previous shader stages have "any special spatial interpretation". gl_position isn't special in regard.

interpolation function of rasterizer, happens after vertex processing. indeed, in glsl 4.30+, interpolation qualifiers on fragment shader inputs only ones matter. they're not used interface matching anymore.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -