4sides quad
This commit is contained in:
parent
534f1a109a
commit
7fe7015774
13 changed files with 784 additions and 52 deletions
|
@ -4,4 +4,7 @@ C:/VulkanSDK/1.3.280.0/Bin/glslc.exe shaders/cube.geom -o shaders/geo_cube.spv
|
|||
|
||||
C:/VulkanSDK/1.3.280.0/Bin/glslc.exe shaders/cuboid.vert -o shaders/vert_cuboid.spv
|
||||
C:/VulkanSDK/1.3.280.0/Bin/glslc.exe shaders/cuboid.frag -o shaders/frag_cuboid.spv
|
||||
C:/VulkanSDK/1.3.280.0/Bin/glslc.exe shaders/cuboid.geom -o shaders/geo_cuboid.spv
|
||||
C:/VulkanSDK/1.3.280.0/Bin/glslc.exe shaders/cuboid.geom -o shaders/geo_cuboid.spv
|
||||
|
||||
C:/VulkanSDK/1.3.280.0/Bin/glslc.exe shaders/rt_quad.vert -o shaders/vert_rt_quad.spv
|
||||
C:/VulkanSDK/1.3.280.0/Bin/glslc.exe shaders/rt_quad.frag -o shaders/frag_rt_quad.spv
|
BIN
shaders/frag_rt_quad.spv
Normal file
BIN
shaders/frag_rt_quad.spv
Normal file
Binary file not shown.
10
shaders/rt_quad.frag
Normal file
10
shaders/rt_quad.frag
Normal file
|
@ -0,0 +1,10 @@
|
|||
#version 450
|
||||
|
||||
layout(location = 0) flat in uvec2 fragRasterPos;
|
||||
layout(location = 1) flat in uint fragVolumeStart;
|
||||
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
void main() {
|
||||
outColor = vec4(1, 0, 0, 1);
|
||||
}
|
27
shaders/rt_quad.vert
Normal file
27
shaders/rt_quad.vert
Normal file
|
@ -0,0 +1,27 @@
|
|||
#version 450
|
||||
|
||||
layout(binding = 0) uniform UniformBufferObject {
|
||||
mat4 model;
|
||||
mat4 geom_rot;
|
||||
mat4 view;
|
||||
mat4 proj;
|
||||
bool[16] use_geom_shader;
|
||||
} ubo;
|
||||
|
||||
|
||||
layout(location = 0) in vec3 inPosition;
|
||||
layout(location = 1) in uvec2 inRasterPos;
|
||||
layout(location = 2) in uint inVolumeStart;
|
||||
|
||||
layout(location = 0) out uvec2 rasterPos;
|
||||
layout(location = 1) out uint volumeStart;
|
||||
|
||||
void main() {
|
||||
if (ubo.use_geom_shader[0]) {
|
||||
gl_Position = ubo.geom_rot * ubo.model * vec4(inPosition, 1.0);
|
||||
} else {
|
||||
gl_Position = ubo.proj * ubo.view * ubo.geom_rot * ubo.model * vec4(inPosition, 1.0);
|
||||
}
|
||||
rasterPos = inRasterPos;
|
||||
volumeStart = inVolumeStart;
|
||||
}
|
BIN
shaders/vert_rt_quad.spv
Normal file
BIN
shaders/vert_rt_quad.spv
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue