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

object_empty_image_vert.glsl « shaders « modes « draw « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c1a957f0640393decd9d9567a8d799bbbefbfcf6 (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
30
31
32
33
34
35
36
37
38

uniform mat4 ViewProjectionMatrix;
uniform vec2 aspect;

/* ---- Instantiated Attribs ---- */
in vec2 texCoord;
in vec2 pos;
/* ---- Per instance Attribs ---- */
in mat4 InstanceModelMatrix;

#ifdef USE_WIRE
in vec3 color;
#else
in vec4 objectColor;
#endif

in float size;
in vec2 offset;

flat out vec4 finalColor;

#ifndef USE_WIRE
out vec2 texCoord_interp;
#endif

void main()
{
	gl_Position = ViewProjectionMatrix * InstanceModelMatrix * vec4(
		(pos[0] + offset[0]) * (size * aspect[0]),
		(pos[1] + offset[1]) * (size * aspect[1]),
		0.0, 1.0);
#ifdef USE_WIRE
	finalColor = vec4(color, 1.0);
#else
	texCoord_interp = texCoord;
	finalColor = objectColor;
#endif
}