From: Mikko Rasa Date: Sun, 12 Dec 2021 11:17:30 +0000 (+0200) Subject: Set gl_Layer separately for each vertex X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=fd92cb5c68eefa4d32fbedbfa41fecc433a886a3;p=libs%2Fgl.git Set gl_Layer separately for each vertex EmitVertex invalidates *all* output variables so they must be written again for the next one. --- diff --git a/shaderlib/cubemap_effect.glsl b/shaderlib/cubemap_effect.glsl index b865a7ab..88317526 100644 --- a/shaderlib/cubemap_effect.glsl +++ b/shaderlib/cubemap_effect.glsl @@ -17,9 +17,9 @@ void main() { for(int i=0; i<6; ++i) { - gl_Layer = i; for(int j=0; j<3; ++j) { + gl_Layer = i; gl_Position = gl_in[j].gl_Position; out vec3 texcoord = faces[i]*vec3(gl_in[j].gl_Position.xy, 1.0); EmitVertex();