Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

pointSprite.geom 1004 Bytes
Newer Older
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
// PointSprite::geometryShaderText

uniform float size;
uniform mat4 ModelViewMatrix;
uniform mat4 ProjectionMatrix;
VARYING_OUT vec2 texCoord;
VARYING_OUT vec2 positionFragIn;
VARYING_OUT vec4 mvpFragIn;
void main()
{
	vec4 posCenter = ModelViewMatrix * POSITION_IN(0);
	vec4 pos = posCenter + vec4(-size, size, 0.0, 0.0);
	positionFragIn = posCenter.zw;
	mvpFragIn.x = ProjectionMatrix[2][2];
	mvpFragIn.y = ProjectionMatrix[3][2];
	mvpFragIn.z = ProjectionMatrix[2][3];
	mvpFragIn.w = ProjectionMatrix[3][3];
	texCoord = vec2(0.0,1.0);
	gl_Position = ProjectionMatrix *  pos;
	EmitVertex();
	pos = posCenter + vec4(-size, -size, 0.0, 0.0);
	texCoord = vec2(0.0,0.0);
	gl_Position = ProjectionMatrix *  pos;
	EmitVertex();
	pos = posCenter + vec4( size, size, 0.0, 0.0);
	texCoord = vec2(1.0,1.0);
	gl_Position = ProjectionMatrix *  pos;
	EmitVertex();
	pos = posCenter + vec4( size,-size, 0.0, 0.0);
	texCoord = vec2(1.0,0.0);
	gl_Position = ProjectionMatrix *  pos;
	EmitVertex();
	EndPrimitive();
}