Vertex Shader error while Passing mesh face index using glvertex4i

后端 未结 3 1304
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-29 13:52

Initializing GL_List for processing.

glBegin(GL_POINTS); 
for (i = 0; i < faceNum; i++)
{
    mesh->GetFaceNodes(i          


        
3条回答
  •  终归单人心
    2021-01-29 14:00

    The code in the question does not make any sense. The GLSL keyword varying was chosen because it was meant to reflect the property that the data will be different for each fragment, due to the automatic interpolation across the primitive. This happens only between the last programmable shader stage before the rasrerizer and the fragment shader.

    In the beginning, there was only the vertex shader and the fragment shader. The VS would get attributes as input, and output to varyings, which would be interpolation and become inputs to the FS.

    With the introduction of the Geometry Shader in GL 3.0 / GLSL 1.30, this scheme did not make sense any more. The outputs of the VS would not be interpolated any more, but become direct inputs of the GS. As a result, the keywords attribute and varying where removed from GLSL, and replaced by the more general in / out scheme.

    As a result, a GS with varying cannot exist. You either use legacy GLSL which doesn't support Geometry Shaders, or you use a newer GLSL with in/out.

提交回复
热议问题