source: opengl-game/gl-shaders/laser.frag@ 34bdf3a

feature/imgui-sdl points-test
Last change on this file since 34bdf3a was 4d84c72, checked in by Dmitry Portnoy <dmp1488@…>, 5 years ago

Move the OpenGL shaders to a gl-shaders folder

  • Property mode set to 100644
File size: 532 bytes
Line 
1#version 410
2
3#define MAX_NUM_OBJECTS 1024
4
5uniform sampler2D basic_texture;
6uniform vec3 laser_color;
7
8// use this to allow lasers of different colors,
9// while still drawing them all at the same time
10layout (std140) uniform colors {
11 vec3 laser_colors[MAX_NUM_OBJECTS];
12};
13
14in vec2 texture_coordinates;
15in vec3 position_eye;
16
17out vec4 frag_color;
18
19void main() {
20 vec4 texel = texture(basic_texture, texture_coordinates);
21
22 frag_color = vec4(texel.r * laser_color.r, texel.g * laser_color.g, texel.b * laser_color.b, texel.a);
23}
Note: See TracBrowser for help on using the repository browser.