broken_seals_roguelike/game/shaders/2_simple_particle_billboard_shader.shader

20 lines
851 B
GLSL

shader_type spatial;
render_mode blend_add,depth_draw_opaque,cull_disabled,specular_disabled,unshaded;
uniform vec4 albedo : hint_color;
uniform sampler2D texture_albedo : hint_albedo;
void vertex() {
mat4 mat_world = mat4(normalize(CAMERA_MATRIX[0])*length(WORLD_MATRIX[0]),normalize(CAMERA_MATRIX[1])*length(WORLD_MATRIX[0]),normalize(CAMERA_MATRIX[2])*length(WORLD_MATRIX[2]),WORLD_MATRIX[3]);
mat_world = mat_world * mat4( vec4(cos(INSTANCE_CUSTOM.x),-sin(INSTANCE_CUSTOM.x), 0.0, 0.0), vec4(sin(INSTANCE_CUSTOM.x), cos(INSTANCE_CUSTOM.x), 0.0, 0.0),vec4(0.0, 0.0, 1.0, 0.0),vec4(0.0, 0.0, 0.0, 1.0));
MODELVIEW_MATRIX = INV_CAMERA_MATRIX * mat_world;
}
void fragment() {
vec2 base_uv = UV;
vec4 albedo_tex = texture(texture_albedo,base_uv);
albedo_tex *= COLOR;
ALBEDO = albedo.rgb * albedo_tex.rgb;
ALPHA = albedo.a * albedo_tex.a;
}