File: shield-impact-v.sdr

package info (click to toggle)
freespace2 24.2.0%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: forky, sid
  • size: 43,716 kB
  • sloc: cpp: 595,001; ansic: 21,741; python: 1,174; sh: 457; makefile: 248; xml: 181
file content (34 lines) | stat: -rw-r--r-- 642 bytes parent folder | download | duplicates (2)
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

in vec4 vertPosition;
in vec3 vertNormal;

out vec4 fragImpactUV;
out float fragNormOffset;


layout (std140) uniform matrixData {
	mat4 modelViewMatrix;
	mat4 projMatrix;
};

layout (std140) uniform genericData {
	mat4 shieldModelViewMatrix;
	mat4 shieldProjMatrix;

	vec3 hitNormal;
	int srgb;

	vec4 color;

	int shieldMapIndex;
};

void main()
{
	gl_Position = projMatrix * modelViewMatrix * vertPosition;
	//vec3 normal = normalize(mat3(modelViewMatrix) * vertNormal);
	fragNormOffset = dot(hitNormal, vertNormal);
	fragImpactUV = shieldProjMatrix * shieldModelViewMatrix * vertPosition;
	fragImpactUV += 1.0f;
	fragImpactUV *= 0.5f;
}