Implement particle velocity and acceleration visualization
[blender.git] / source / blender / draw / modes / shaders / object_particle_prim_frag.glsl
1
2 uniform vec3 color;
3 uniform sampler1D ramp;
4
5 flat in int finalAxis;
6 flat in float finalVal;
7
8 out vec4 fragColor;
9
10 void main()
11 {
12         if (finalAxis == -1) {
13                 if (finalVal < 0.0) {
14                         fragColor.rgb = color;
15                 }
16                 else {
17                         fragColor.rgb = texture(ramp, finalVal).rgb;
18                 }
19         }
20         else {
21                 fragColor.rgb = vec3(0.0);
22                 fragColor[finalAxis] = 1.0;
23         }
24
25         fragColor.a = 1.0;
26 }