Skip to content
Snippets Groups Projects
Commit 074ee4e5 authored by Artur Wasmut's avatar Artur Wasmut
Browse files

WIP: shader location black magic between mesh and fragment shader

parent 348f7525
No related branches found
No related tags found
1 merge request!74Resolve "Mesh Shader Implementation"
Pipeline #26213 passed
...@@ -4,6 +4,13 @@ ...@@ -4,6 +4,13 @@
//layout(location = 0) in vec3 fragColor; //layout(location = 0) in vec3 fragColor;
layout(location = 0) out vec4 outColor; layout(location = 0) out vec4 outColor;
struct VertColor
{
vec3 color;
};
layout(location = 0) in VertColor VertexInput;
void main() { void main() {
outColor = vec4(1.0); outColor = vec4(VertexInput.color, 1);
} }
\ No newline at end of file
...@@ -18,6 +18,13 @@ layout( push_constant ) uniform constants{ ...@@ -18,6 +18,13 @@ layout( push_constant ) uniform constants{
// vec4 gl_Position; // vec4 gl_Position;
//} gl_MeshVerticesNV[]; //} gl_MeshVerticesNV[];
struct VertColor
{
vec3 color;
};
layout(location = 0) out VertColor VertexOutputs[];
void main() { void main() {
if(gl_LocalInvocationID.x == 0) if(gl_LocalInvocationID.x == 0)
{ {
...@@ -29,5 +36,9 @@ void main() { ...@@ -29,5 +36,9 @@ void main() {
gl_MeshVerticesNV[0].gl_Position = mvp * vec4(-0.5, 0.5, 0.5, 1); gl_MeshVerticesNV[0].gl_Position = mvp * vec4(-0.5, 0.5, 0.5, 1);
gl_MeshVerticesNV[1].gl_Position = mvp * vec4( 0.5, 0.5, 0.5, 1); gl_MeshVerticesNV[1].gl_Position = mvp * vec4( 0.5, 0.5, 0.5, 1);
gl_MeshVerticesNV[2].gl_Position = mvp * vec4( 0 , -0.5, 0.5, 1); gl_MeshVerticesNV[2].gl_Position = mvp * vec4( 0 , -0.5, 0.5, 1);
VertexOutputs[0].color = vec3(1, 0, 0);
VertexOutputs[1].color = vec3(0, 1, 0);
VertexOutputs[2].color = vec3(0, 0, 1);
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment