Window render bugfix

This commit is contained in:
2025-11-10 14:08:34 +00:00
parent 5e93c7631d
commit df435819eb
3 changed files with 7 additions and 26 deletions
-1
View File
@@ -5,7 +5,6 @@ in vec4 vCol;
in vec4 vPos;
void main()
{
//fCol = vec4 (1,0.5,0,0.5);
fCol = vCol;
fPos = vPos;
}
+5 -23
View File
@@ -1,34 +1,16 @@
#version 450 core
struct PosCol {
vec4 pospos;
vec4 col;
};
struct PosCol { vec4 pospos; vec4 col; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std430, binding = 1) readonly buffer Pos { PosCol data[]; };
out vec4 vCol;
out vec4 vPos;
int indices[6] = {0,1,2,2,3,0};
vec4 iface[6] =
{ vec4 (-1,-1,0,1)
, vec4 (-1,1,0,1)
, vec4 (1,1,0,1)
, vec4 (1,1,0,1)
, vec4 (1,-1,0,1)
, vec4 (-1,-1,0,1)
};
int indices[6] = {0,1,3,0,3,2};
void main()
{
//const struct PosCol pc = data[gl_VertexID / 6];
vec4 pp = data[gl_VertexID / 6].pospos;
vCol = data[gl_VertexID / 6].col;
//vCol = vec4(1,0.5,0,0.5);
vec4 pp = data[gl_VertexID / 6].pospos;
int j = indices[gl_VertexID % 6];
float z = (j / 2 > 0 ? 5000 : 0);
//vec2 xy = (j % 2 > 0 ? pc.pospos.xy : pc.pospos.zw);
float z = (j > 1.5 ? 5000 : 0);
vec2 xy = (j % 2 > 0 ? pp.xy : pp.zw);
vPos = vec4( xy, z, 1);
// vPos = vec4( 0,0,0, 1);
//vCol = pc.col;
gl_Position = theMat * vPos;
//gl_Position = iface[gl_VertexID % 6];
gl_Position = theMat * vec4( xy, z, 1);
}
+2 -2
View File
@@ -376,8 +376,8 @@ doDrawing' win pdata u = do
glDepthFunc GL_LEQUAL
glCullFace GL_BACK
glDisable GL_BLEND
glDepthFunc GL_ALWAYS
glDisable GL_CULL_FACE
-- glDepthFunc GL_ALWAYS
-- glDisable GL_CULL_FACE
glUseProgram $ pdata ^. windowPullShader . shaderUINT
glBindVertexArray $ pdata ^. dummyVAO . vaoName
glDrawArrays GL_TRIANGLES 0 (fromIntegral nWins * 6)