GRK_game_scene/cw 9/shader_laser.frag

18 lines
393 B
GLSL
Raw Normal View History

#version 430 core
out vec4 out_color;
flat in vec4 color;
in vec4 pos_local;
in vec4 pos_global;
uniform float time;
uniform vec3 laserColor;
void main()
{
2023-02-01 18:28:54 +01:00
float laserIntensity = pow(sin(time * 10.0), 2.0);
vec3 laserDistortion = mix(vec4(laserColor, 1), vec4(0.0f, 0.3f, 0.3f, 1.0f), sin(time)).xyz;
out_color = vec4(laserColor * laserIntensity/* + laserDistortion*/, 1.0);
}