-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- grass texture - shader files - script for compiling shader - pipeline setup
- Loading branch information
1 parent
a6884cc
commit e1074d3
Showing
12 changed files
with
207 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,8 +31,12 @@ | |
*.out | ||
*.app | ||
|
||
# Compiled Shaders | ||
*.spv | ||
|
||
.vscode | ||
|
||
latex | ||
html | ||
build | ||
glslc |
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
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,13 @@ | ||
# https://github.com/google/shaderc/blob/main/downloads.md to download glslc | ||
|
||
# /usr/local/bin/glslc simple_shader.vert -o simple_shader.vert.spv | ||
# /usr/local/bin/glslc simple_shader.frag -o simple_shader.frag.spv | ||
|
||
# ./glslc simple_shader.vert -o simple_shader.vert.spv | ||
# ./glslc simple_shader.frag -o simple_shader.frag.spv | ||
|
||
./external/glslc/glslc shaders/simple_shader.vert -o shaders/simple_shader.vert.spv | ||
./external/glslc/glslc shaders/simple_shader.frag -o shaders/simple_shader.frag.spv | ||
|
||
# glslang -V simple_shader.vert -o simple_shader.vert.spv | ||
# glslang -V simple_shader.frag -o simple_shader.frag.spv |
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,13 @@ | ||
#version 450 | ||
|
||
layout(set=1, binding = 0) uniform sampler2D texSampler; | ||
|
||
layout(location = 0) in vec3 fragColor; | ||
layout(location = 1) in vec2 fragTexCoord; | ||
|
||
layout(location = 0) out vec4 outColor; | ||
|
||
void main() { | ||
// outColor = vec4(fragColor, 1.0); | ||
outColor = texture(texSampler, fragTexCoord); | ||
} |
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,23 @@ | ||
#version 450 | ||
|
||
layout(set=0, binding = 0) uniform UniformBufferObject { | ||
mat4 view; | ||
mat4 proj; | ||
} ubo; | ||
|
||
layout(push_constant) uniform PushConstantObject { | ||
mat4 model; | ||
} pc; | ||
|
||
layout(location = 0) in vec3 inPosition; | ||
layout(location = 1) in vec3 inColor; | ||
layout(location = 2) in vec2 inTexCoord; | ||
|
||
layout(location = 0) out vec3 fragColor; | ||
layout(location = 1) out vec2 fragTexCoord; | ||
|
||
void main() { | ||
gl_Position = ubo.proj * ubo.view * pc.model * vec4(inPosition, 1.0); | ||
fragColor = inColor; | ||
fragTexCoord = inTexCoord; | ||
} |
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
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
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
Oops, something went wrong.