LumixEngine/data/pipelines/editor_icon.shd

40 lines
747 B
Text
Raw Normal View History

2018-10-13 00:09:34 +02:00
texture_slot {
name = "Albedo",
2018-10-13 00:20:19 +02:00
default_texture = "textures/common/white.tga"
2018-10-13 00:09:34 +02:00
}
------------------
vertex_shader [[
2019-08-09 09:55:19 +02:00
layout(std140, binding = 4) uniform Model {
mat4 u_model;
};
2018-10-13 00:09:34 +02:00
layout(location = 0) in vec3 a_position;
layout(location = 1) in vec2 a_uv;
out vec2 v_uv;
void main() {
v_uv = a_uv;
gl_Position = u_camera_projection * u_camera_view * u_model * vec4(a_position, 1);
}
]]
---------------------
fragment_shader [[
layout (binding=0) uniform sampler2D u_albedomap;
2018-10-13 00:09:34 +02:00
in vec2 v_uv;
in vec3 v_normal;
layout(location = 0) out vec4 o_color;
void main() {
vec4 albedo = texture(u_albedomap, v_uv);
#ifdef ALPHA_CUTOUT
if(albedo.a < 0.5) discard;
#endif
o_color.rgb = albedo.rgb;
o_color.w = 1;
}
]]