blob: 202b27be0efbe2c1745aa25f056981ca84546a10 (
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
|
in vec3 pos;
/* Instance attrib */
in int probe_id;
in vec3 probe_location;
in float sphere_size;
uniform mat4 ViewProjectionMatrix;
flat out int pid;
out vec3 worldNormal;
out vec3 worldPosition;
void main()
{
pid = probe_id;
/* While this is not performant, we do this to
* match the object mode engine instancing shader. */
mat4 offsetmat = mat4(1.0); /* Identity */
offsetmat[3].xyz = probe_location;
vec4 wpos = offsetmat * vec4(pos * sphere_size, 1.0);
worldPosition = wpos.xyz;
gl_Position = ViewProjectionMatrix * wpos;
worldNormal = normalize(pos);
}
|