Get shape shader working using vertex pulling
Seems slow, will try to improve
This commit is contained in:
+20
-7
@@ -1,14 +1,27 @@
|
||||
#version 450 core
|
||||
layout (location = 0) in vec4 pos;
|
||||
layout (location = 1) in vec4 col;
|
||||
layout (location = 2) in vec4 norm;
|
||||
struct PosColNorm { vec4 pos; uint col; vec4 norm; };
|
||||
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
|
||||
layout (std430, binding = 3) readonly buffer Data { PosColNorm data[]; };
|
||||
layout (std430, binding = 4) readonly buffer Indices { uint indices[]; };
|
||||
out vec4 vCol;
|
||||
out vec4 vPos;
|
||||
out vec4 vNorm;
|
||||
void main() {
|
||||
gl_Position = theMat * vec4(pos.xyz,1);
|
||||
vCol = col;
|
||||
vPos = pos;
|
||||
vNorm = norm;
|
||||
vPos = data[indices[gl_VertexID]].pos;
|
||||
vCol = unpackUnorm4x8(data[indices[gl_VertexID]].col);
|
||||
vNorm = data[indices[gl_VertexID]].norm;
|
||||
gl_Position = theMat * vec4(vPos.xyz,1);
|
||||
}
|
||||
//layout (location = 0) in vec4 pos;
|
||||
//layout (location = 1) in vec4 col;
|
||||
//layout (location = 2) in vec4 norm;
|
||||
//layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
|
||||
//out vec4 vCol;
|
||||
//out vec4 vPos;
|
||||
//out vec4 vNorm;
|
||||
//void main() {
|
||||
// gl_Position = theMat * vec4(pos.xyz,1);
|
||||
// vCol = col;
|
||||
// vPos = pos;
|
||||
// vNorm = norm;
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user