-
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.
- remove cppVulkanAPI submodule - add vulkan.hpp and vulkan.cpp
- Loading branch information
1 parent
53e75fa
commit e986d21
Showing
16 changed files
with
1,605 additions
and
159 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 |
---|---|---|
|
@@ -39,3 +39,4 @@ latex | |
html | ||
build | ||
glslc | ||
glm |
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 was deleted.
Oops, something went wrong.
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,9 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -d external/glm ] | ||
then | ||
echo "cloning 'https://github.com/g-truc/glm.git' in external/glm" | ||
|
||
mkdir -p external/glm | ||
git clone https://github.com/g-truc/glm.git external/glm | ||
fi |
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 |
---|---|---|
@@ -1,19 +1,9 @@ | ||
#version 450 | ||
|
||
layout(set=1, binding = 0) uniform sampler2D texSampler; | ||
|
||
layout(location = 0) in vec3 fragNormal; | ||
layout(location = 1) in vec2 fragTexCoord; | ||
layout(location = 0) in vec3 fragColor; | ||
|
||
layout(location = 0) out vec4 outColor; | ||
layout(location = 1) out vec3 outNormal; | ||
|
||
void main() { | ||
outColor = texture(texSampler, fragTexCoord); | ||
|
||
vec3 abs_normal = abs(fragNormal); | ||
|
||
float grey_shade = abs_normal.x * 0.299 + abs_normal.y * 0.587 + abs_normal.z * 0.114; | ||
|
||
outNormal = vec3(grey_shade, grey_shade, grey_shade); | ||
} | ||
outColor = vec4(fragColor, 1.0); | ||
} |
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 |
---|---|---|
@@ -1,26 +1,20 @@ | ||
#version 450 | ||
|
||
layout(set=0, binding = 0) uniform UniformBufferObject { | ||
mat4 view; | ||
mat4 proj; | ||
} ubo; | ||
layout(location = 0) out vec3 fragColor; | ||
|
||
layout(push_constant) uniform PushConstantObject { | ||
mat4 model; | ||
} pc; | ||
vec2 positions[3] = vec2[]( | ||
vec2(0.0, -0.5), | ||
vec2(0.5, 0.5), | ||
vec2(-0.5, 0.5) | ||
); | ||
|
||
layout(location = 0) in vec3 inPosition; | ||
layout(location = 1) in vec3 inNormal; | ||
layout(location = 2) in vec2 inTexCoord; | ||
|
||
layout(location = 0) out vec3 fragNormal; | ||
layout(location = 1) out vec2 fragTexCoord; | ||
vec3 colors[3] = vec3[]( | ||
vec3(1.0, 0.0, 0.0), | ||
vec3(0.0, 1.0, 0.0), | ||
vec3(0.0, 0.0, 1.0) | ||
); | ||
|
||
void main() { | ||
gl_Position = ubo.proj * ubo.view * pc.model * vec4(inPosition, 1.0); | ||
|
||
// convert normal to world space | ||
fragNormal = normalize((pc.model * vec4(inNormal, 0.0)).xyz); | ||
|
||
fragTexCoord = inTexCoord; | ||
} | ||
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0); | ||
fragColor = colors[gl_VertexIndex]; | ||
} |
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.