feature/imgui-sdl
points-test
Last change
on this file since c559904 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
|
Rev | Line | |
---|
[b155f13] | 1 | #version 410
|
---|
| 2 |
|
---|
[f71d87d] | 3 | #define MAX_NUM_OBJECTS 1024
|
---|
| 4 |
|
---|
[9f9f9a7] | 5 | uniform sampler2D basic_texture;
|
---|
| 6 | uniform vec3 laser_color;
|
---|
| 7 |
|
---|
[f71d87d] | 8 | // use this to allow lasers of different colors,
|
---|
| 9 | // while still drawing them all at the same time
|
---|
| 10 | layout (std140) uniform colors {
|
---|
| 11 | vec3 laser_colors[MAX_NUM_OBJECTS];
|
---|
| 12 | };
|
---|
| 13 |
|
---|
[9f9f9a7] | 14 | in vec2 texture_coordinates;
|
---|
| 15 | in vec3 position_eye;
|
---|
[b155f13] | 16 |
|
---|
| 17 | out vec4 frag_color;
|
---|
| 18 |
|
---|
| 19 | void 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.