Editor improvements, better cam, better gizmos, better lines

This commit is contained in:
Antoine Pilote
2023-10-08 13:26:41 -04:00
parent ac1db17e55
commit 2620fa548e
8 changed files with 142 additions and 87 deletions

View File

@@ -8,12 +8,16 @@ uniform mat4 u_Model;
uniform mat4 u_View;
uniform mat4 u_Projection;
out mat4 o_Projection;
out sample vec2 a_UV;
out vec4 o_FragPos;
void main()
{
a_UV = UV;
o_Projection = u_Projection;
gl_Position = u_Projection * u_View * u_Model * vec4(Position, 1.0);
o_FragPos = gl_Position;
}
#shader fragment
@@ -22,12 +26,19 @@ void main()
out vec4 FragColor;
in vec2 a_UV;
in mat4 o_Projection;
in vec4 o_FragPos;
uniform sampler2D u_DepthTexture;
uniform sampler2D gizmo_texture;
uniform float u_Opacity;
void main()
{
vec4 px_color = texture(gizmo_texture, a_UV).rgba;
FragColor = px_color * vec4(1, 1, 1, 0.5);
vec4 color = vec4(0, 0, 0, 0);
vec4 px_color = texture(gizmo_texture, a_UV).rgba;
color = px_color * vec4(1, 1, 1, u_Opacity);
FragColor = color;
}

View File

@@ -23,7 +23,9 @@ in vec4 LineColor;
out vec4 FragColor;
uniform float u_Opacity;
void main()
{
FragColor = LineColor;
FragColor = LineColor * vec4(1, 1, 1, u_Opacity);
}