-
Notifications
You must be signed in to change notification settings - Fork 547
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds colour uniform examples, as per popular demand.
Signed-off-by: Hal Gentz <[email protected]>
- Loading branch information
1 parent
3129d5c
commit 58b7c0d
Showing
5 changed files
with
1,686 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#version 450 | ||
#extension GL_ARB_separate_shader_objects : enable | ||
|
||
layout(location = 0) in vec2 v_uv; | ||
layout(location = 0) out vec4 target0; | ||
|
||
layout(set = 0, binding = 0) uniform texture2D u_texture; | ||
layout(set = 0, binding = 1) uniform sampler u_sampler; | ||
|
||
layout(set = 1, binding = 0) uniform UBOCol { | ||
vec4 color; | ||
} color_dat; | ||
|
||
void main() { | ||
target0 = texture(sampler2D(u_texture, u_sampler), v_uv) * color_dat.color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#version 450 | ||
#extension GL_ARB_separate_shader_objects : enable | ||
|
||
layout(constant_id = 0) const float scale = 1.2f; | ||
|
||
layout(location = 0) in vec2 a_pos; | ||
layout(location = 1) in vec2 a_uv; | ||
layout(location = 0) out vec2 v_uv; | ||
|
||
out gl_PerVertex { | ||
vec4 gl_Position; | ||
}; | ||
|
||
void main() { | ||
v_uv = a_uv; | ||
gl_Position = vec4(scale * a_pos, 0.0, 1.0); | ||
} |
Oops, something went wrong.