source: opengl-game/laser.frag@ eea05dd

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

Start changing the laser fragment shader to allow each laser to be drawn in a different color, and start creating release scripts for different platforms.

  • 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.