add vertexarray, move Sandbox::Demolayer code to EditorLayer
This commit is contained in:
29
Editor/assets/shaders/demo.glsl
Normal file
29
Editor/assets/shaders/demo.glsl
Normal file
@ -0,0 +1,29 @@
|
||||
#type vertex
|
||||
#version 430 core
|
||||
|
||||
layout(location = 0) in vec3 a_Position;
|
||||
layout(location = 1) in vec3 a_Normal;
|
||||
|
||||
uniform mat4 u_MVP;
|
||||
|
||||
out vec3 v_Normal;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = u_MVP * vec4(a_Position, 1.0);
|
||||
v_Normal = a_Normal;
|
||||
}
|
||||
|
||||
#type fragment
|
||||
#version 430 core
|
||||
|
||||
layout(location = 0) out vec4 o_Color;
|
||||
|
||||
uniform vec4 u_Color;
|
||||
in vec3 v_Normal;
|
||||
|
||||
void main()
|
||||
{
|
||||
o_Color = u_Color * vec4(v_Normal * 0.5 + 0.5, 1.0f);
|
||||
// o_Color = vec4(0.6, 0.7, 0.8, 1.0);
|
||||
}
|
||||
Reference in New Issue
Block a user