-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathShaderVS.txt
31 lines (29 loc) · 944 Bytes
/
ShaderVS.txt
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
//f function gets imported by textbox in website
precision highp float;
attribute vec4 GridPoint;
uniform mat4 TTO;
uniform mat4 RTA;
uniform mat4 Proj;
uniform mat4 TTR;
uniform mat4 RS;
uniform mat4 TTRB;
varying float intensity;
highp mat4 T(in highp mat4 inMatrix)
{
highp vec4 i0 = inMatrix[0];
highp vec4 i1 = inMatrix[1];
highp vec4 i2 = inMatrix[2];
highp vec4 i3 = inMatrix[3];
highp mat4 outMatrix = mat4(vec4(i0.x, i1.x, i2.x, i3.x),
vec4(i0.y, i1.y, i2.y, i3.y),
vec4(i0.z, i1.z, i2.z, i3.z),
vec4(i0.w, i1.w, i2.w, i3.w));
return outMatrix;
}
void main()
{
vec4 DisplayPos = T(Proj)*T(RTA)*T(TTO)*T(TTRB)*RTA*T(RS)*T(TTR)*vec4(GridPoint.xy, -GridPoint.z, 1.0);
gl_Position = DisplayPos;
//gl_PointSize = 1.5; //Causes failure on certain devices (mainly mobile)
intensity = GridPoint.w;
}