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

lightprobe_cube_display_vert.glsl « shaders « eevee « engines « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b0a6cbe17079f25b20d60b757e63bc16531e85df (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

in vec3 pos;

/* Instance attrib */
in int probe_id;
in vec3 probe_location;
in float sphere_size;

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);
}