dilevin / computer-graphics-shader-pipeline

Computer Graphics Assignment about the Shader Pipeline
2 stars 5 forks source link

What is "gl_Position" in the tesselation evaluation shader? #44

Closed NPTP closed 4 years ago

NPTP commented 4 years ago

Hi,

For example, in snap_to_sphere.tes, we have a variable gl_Position. Some searching has shown this to be used in tesselation evaluation shaders across the board, but I don't really know what it is, what it does or how it should be used. The best description I've found is "the clip-space output position of the current vertex." but I'm not sure what is meant by clip-space, or how our shader-pipeline app actually utilizes the gl_Position to render anything.

Thanks!

abhimadan commented 4 years ago

Clip space is just the projection space. The name is a bit confusing, but it's mainly saying that OpenGL will handle clipping for you if you give it homogeneous coordinates.

NPTP commented 4 years ago

Thank you!