source: opengl-game/laser.frag@ 80de39d

feature/imgui-sdl points-test
Last change on this file since 80de39d 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
RevLine 
[b155f13]1#version 410
2
[f71d87d]3#define MAX_NUM_OBJECTS 1024
4
[9f9f9a7]5uniform sampler2D basic_texture;
6uniform vec3 laser_color;
7
[f71d87d]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
[9f9f9a7]14in vec2 texture_coordinates;
15in vec3 position_eye;
[b155f13]16
17out vec4 frag_color;
18
19void main() {
[9f9f9a7]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);
[b155f13]23}
Note: See TracBrowser for help on using the repository browser.