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

feature/imgui-sdl
Last change on this file since e1f88a9 was 6d95ade, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 5 years ago

In OpenGLRef, stop passing position_eye from the laser vertex shader to the fragment shader since the fragment shader never uses it

  • Property mode set to 100644
File size: 510 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;
15
16out vec4 frag_color;
17
18void main() {
19 vec4 texel = texture(basic_texture, texture_coordinates);
20
21 frag_color = vec4(texel.r * laser_color.r, texel.g * laser_color.g, texel.b * laser_color.b, texel.a);
22}
Note: See TracBrowser for help on using the repository browser.