Cleanup 2/2
This commit is contained in:
@ -9,7 +9,7 @@ struct SpriteInstanceData
|
||||
};
|
||||
|
||||
layout (location = 0) in vec2 inPosition;
|
||||
layout (location = 1) in vec2 inTexCoord;
|
||||
layout (location = 1) in vec4 inTexCoord;
|
||||
|
||||
layout(location = 0) out vec2 outTexCoord;
|
||||
layout(location = 1) out vec4 outVertexColor;
|
||||
@ -29,6 +29,7 @@ void main()
|
||||
{
|
||||
SpriteInstanceData spriteData = sboSpriteData.data[gl_InstanceIndex];
|
||||
gl_Position = uboPerScene.projection * uboPerFrame.view * spriteData.Transform * vec4(inPosition, 0.0f, 1.0f);
|
||||
outTexCoord = vec2(spriteData.TexCoords) + vec2(spriteData.TexCoords.z, spriteData.TexCoords.w) * inTexCoord;
|
||||
vec4 t = spriteData.TexCoords * inTexCoord;
|
||||
outTexCoord = vec2(t.x + t.z, t.y + t.w);
|
||||
outVertexColor = spriteData.Color;
|
||||
}
|
||||
13
Src/RenderCore/Resources/Shaders/PrimitiveDraw.frag
Normal file
13
Src/RenderCore/Resources/Shaders/PrimitiveDraw.frag
Normal file
@ -0,0 +1,13 @@
|
||||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout(location = 0) in vec4 inVertexColor;
|
||||
|
||||
layout(location = 0) out vec4 outColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
outColor = inVertexColor;
|
||||
if(outColor.w < 0.1)
|
||||
discard;
|
||||
}
|
||||
20
Src/RenderCore/Resources/Shaders/PrimitiveDraw.vert
Normal file
20
Src/RenderCore/Resources/Shaders/PrimitiveDraw.vert
Normal file
@ -0,0 +1,20 @@
|
||||
#version 450
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
|
||||
layout (location = 0) in vec2 inPosition;
|
||||
layout (location = 1) in vec4 inVertexColor;
|
||||
|
||||
layout(location = 0) out vec4 outVertexColor;
|
||||
|
||||
layout(set = 1, binding = 0) uniform UBO_Vertex_PerScene {
|
||||
mat4 projection;
|
||||
} uboPerScene;
|
||||
layout(set = 1, binding = 1) uniform UBO_Vertex_PerFrame {
|
||||
mat4 view;
|
||||
} uboPerFrame;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = uboPerScene.projection * uboPerFrame.view * vec4(inPosition, 0.0f, 1.0f);
|
||||
outVertexColor = inVertexColor;
|
||||
}
|
||||
Reference in New Issue
Block a user