添加组件圆,添加可视化碰撞器渲染
This commit is contained in:
49
Sandbox/assets/shaders/Renderer2D_line.glsl
Normal file
49
Sandbox/assets/shaders/Renderer2D_line.glsl
Normal file
@ -0,0 +1,49 @@
|
||||
// Basic Line Texture Shader
|
||||
|
||||
#type vertex
|
||||
#version 450 core
|
||||
|
||||
layout(location = 0) in vec3 a_Position;
|
||||
layout(location = 1) in vec4 a_Color;
|
||||
layout(location = 2) in int a_EntityID;
|
||||
|
||||
layout(std140, binding = 0) uniform Camera
|
||||
{
|
||||
mat4 u_ViewProjection;
|
||||
};
|
||||
|
||||
struct VertexOutput
|
||||
{
|
||||
vec4 Color;
|
||||
};
|
||||
|
||||
layout (location = 0) out VertexOutput Output;
|
||||
layout (location = 1) out flat int v_EntityID;
|
||||
|
||||
void main()
|
||||
{
|
||||
Output.Color = a_Color;
|
||||
v_EntityID = a_EntityID;
|
||||
|
||||
gl_Position = u_ViewProjection * vec4(a_Position, 1.0);
|
||||
}
|
||||
|
||||
#type fragment
|
||||
#version 450 core
|
||||
|
||||
layout(location = 0) out vec4 o_Color;
|
||||
layout(location = 1) out int o_EntityID;
|
||||
|
||||
struct VertexOutput
|
||||
{
|
||||
vec4 Color;
|
||||
};
|
||||
|
||||
layout (location = 0) in VertexOutput Input;
|
||||
layout (location = 1) in flat int v_EntityID;
|
||||
|
||||
void main()
|
||||
{
|
||||
o_Color = Input.Color;
|
||||
o_EntityID = v_EntityID;
|
||||
}
|
||||
Reference in New Issue
Block a user