-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5329aa2
commit 9bea6d8
Showing
3 changed files
with
69 additions
and
1 deletion.
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
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,27 @@ | ||
// AUTHOR: mrk-its | ||
// ISSUE: #210 | ||
// FIX: #898 | ||
#version 450 | ||
|
||
layout(location = 0) in vec2 v_Uv; | ||
|
||
layout(location = 0) out vec4 o_Target; | ||
|
||
layout(set = 1, binding = 0) uniform ColorMaterial_color { | ||
vec4 Color; | ||
}; | ||
|
||
# ifdef COLORMATERIAL_TEXTURE | ||
layout(set = 1, binding = 1) uniform texture2D ColorMaterial_texture; | ||
layout(set = 1, binding = 2) uniform sampler ColorMaterial_texture_sampler; | ||
# endif | ||
|
||
void main() { | ||
vec4 color = Color; | ||
# ifdef COLORMATERIAL_TEXTURE | ||
color *= texture( | ||
sampler2D(ColorMaterial_texture, ColorMaterial_texture_sampler), | ||
v_Uv); | ||
# endif | ||
o_Target = 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,27 @@ | ||
// AUTHOR: mrk-its | ||
// ISSUE: #210 | ||
// FIX: #898 | ||
#version 450 | ||
|
||
layout(location = 0) in vec3 Vertex_Position; | ||
layout(location = 1) in vec3 Vertex_Normal; | ||
layout(location = 2) in vec2 Vertex_Uv; | ||
|
||
layout(location = 0) out vec2 v_Uv; | ||
|
||
layout(set = 0, binding = 0) uniform Camera { | ||
mat4 ViewProj; | ||
}; | ||
|
||
layout(set = 2, binding = 0) uniform Transform { | ||
mat4 Model; | ||
}; | ||
layout(set = 2, binding = 1) uniform Sprite_size { | ||
vec2 size; | ||
}; | ||
|
||
void main() { | ||
v_Uv = Vertex_Uv; | ||
vec3 position = Vertex_Position * vec3(size, 1.0); | ||
gl_Position = ViewProj * Model * vec4(position, 1.0); | ||
} |