source: opengl-game/laser.frag@ 9f9f9a7

feature/imgui-sdl points-test
Last change on this file since 9f9f9a7 was 9f9f9a7, checked in by Dmitry Portnoy <dmp1488@…>, 6 years ago

Improve the laser rendering algorithm by using a translucent white texture that gets blended with am arbitrary color.

  • Property mode set to 100644
File size: 329 bytes
Line 
1#version 410
2
3uniform sampler2D basic_texture;
4uniform vec3 laser_color;
5
6in vec2 texture_coordinates;
7in vec3 position_eye;
8
9out vec4 frag_color;
10
11void main() {
12 vec4 texel = texture(basic_texture, texture_coordinates);
13
14 frag_color = vec4(texel.r * laser_color.r, texel.g * laser_color.g, texel.b * laser_color.b, texel.a);
15}
Note: See TracBrowser for help on using the repository browser.