Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Commits
074ee4e5
Commit
074ee4e5
authored
3 years ago
by
Artur Wasmut
Browse files
Options
Downloads
Patches
Plain Diff
WIP: shader location black magic between mesh and fragment shader
parent
348f7525
No related branches found
No related tags found
1 merge request
!74
Resolve "Mesh Shader Implementation"
Pipeline
#26213
passed
3 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
projects/mesh_shader/resources/shaders/shader.frag
+8
-1
8 additions, 1 deletion
projects/mesh_shader/resources/shaders/shader.frag
projects/mesh_shader/resources/shaders/shader.mesh
+11
-0
11 additions, 0 deletions
projects/mesh_shader/resources/shaders/shader.mesh
with
19 additions
and
1 deletion
projects/mesh_shader/resources/shaders/shader.frag
+
8
−
1
View file @
074ee4e5
...
@@ -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
This diff is collapsed.
Click to expand it.
projects/mesh_shader/resources/shaders/shader.mesh
+
11
−
0
View file @
074ee4e5
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment