增加新的shader
This commit is contained in:
parent
b428ced06e
commit
56cd6521cb
18
res/shader/FlatColor3D.vert
Normal file
18
res/shader/FlatColor3D.vert
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#version 450 core
|
||||||
|
|
||||||
|
layout(location = 0) in vec3 Vertex;
|
||||||
|
layout(location = 1) in vec3 Color;
|
||||||
|
|
||||||
|
layout(binding = 0) uniform WorldConfig
|
||||||
|
{
|
||||||
|
mat4 mvp;
|
||||||
|
} world;
|
||||||
|
|
||||||
|
layout(location = 0) out vec4 FragmentColor;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
FragmentColor=vec4(Color,1.0);
|
||||||
|
|
||||||
|
gl_Position=vec4(Vertex,1.0)*world.mvp;
|
||||||
|
}
|
@ -1,17 +1,25 @@
|
|||||||
#version 450 core
|
#version 450 core
|
||||||
|
|
||||||
layout(location = 0) in vec3 Vertex;
|
layout(location = 0) in vec3 Vertex;
|
||||||
|
layout(location = 1) in vec3 Normal;
|
||||||
|
|
||||||
layout(binding = 0) uniform WorldConfig
|
layout(binding = 0) uniform WorldConfig
|
||||||
{
|
{
|
||||||
mat4 mvp;
|
mat4 mvp;
|
||||||
} world;
|
} world;
|
||||||
|
|
||||||
|
layout(push_constant) uniform SkyLightConsts {
|
||||||
|
vec4 sun_color;
|
||||||
|
vec4 sun_direction;
|
||||||
|
} skylight;
|
||||||
|
|
||||||
layout(location = 0) out vec4 FragmentColor;
|
layout(location = 0) out vec4 FragmentColor;
|
||||||
|
layout(location = 1) out vec3 FragmentNormal;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
FragmentColor=vec4(1.0);
|
FragmentColor=vec4(Color,1.0);
|
||||||
|
FragmentNormal=Normal;
|
||||||
|
|
||||||
gl_Position=vec4(Vertex,1.0)*world.mvp;
|
gl_Position=vec4(Vertex,1.0)*world.mvp;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user