Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gpu_shader_instance_variying_size_variying_color_vert.glsl « shaders « gpu « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 3e52e43beae65ade024b393fbcdaba6bbb64ac1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

uniform mat4 ViewProjectionMatrix;
uniform mat4 ModelMatrix;

/* ---- Instantiated Attrs ---- */
in vec3 pos;

/* ---- Per instance Attrs ---- */
in mat4 InstanceModelMatrix;
in vec4 color;
#ifdef UNIFORM_SCALE
in float size;
#else
in vec3 size;
#endif

flat out vec4 finalColor;

void main()
{
  finalColor = color;

  vec4 pos_4d = vec4(pos * size, 1.0);
  gl_Position = ViewProjectionMatrix * InstanceModelMatrix * pos_4d;

#ifdef USE_WORLD_CLIP_PLANES
  world_clip_planes_calc_clip_distance((ModelMatrix * InstanceModelMatrix * pos_4d).xyz);
#endif
}