How does the fragment shader know what variable to use for the color of a pixel?

后端 未结 2 1132
萌比男神i
萌比男神i 2021-01-29 18:17

I see a lot of different fragment shaders,

#version 130

out vec4 flatColor;

void main(void)
{
    flatColor = vec4(0.0,1.0,0.0,0.5);
}

And th

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-29 18:53

    I'd like to specify this for OpenGLES 3.1 which uses GLSL_ES_3.10 link:

    §4.4.2

    If there is only a single output [in the fragment shader], the location does not need to be specified, in which case it defaults to zero.

提交回复
热议问题