Add Origin Indicator drawable
This commit is contained in:
23
openVulkanoCpp/Shader/originIndicator.vert
Normal file
23
openVulkanoCpp/Shader/originIndicator.vert
Normal file
@@ -0,0 +1,23 @@
|
||||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(set = 0, binding = 0) uniform NodeData
|
||||
{
|
||||
mat4 world;
|
||||
} node;
|
||||
|
||||
layout(set = 1, binding = 0) uniform CameraData
|
||||
{
|
||||
mat4 viewProjection;
|
||||
} cam;
|
||||
|
||||
layout(location = 0) out vec4 color;
|
||||
|
||||
void main()
|
||||
{
|
||||
int i = gl_VertexIndex & -2;
|
||||
color = vec4(i == 0, i == 2, i == 4, 1);
|
||||
vec4 position = color * (gl_VertexIndex & 1);
|
||||
position.w = 1;
|
||||
gl_Position = cam.viewProjection * node.world * position;
|
||||
}
|
||||
Reference in New Issue
Block a user