Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F632236
prominence_vs.txt
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
prominence_vs.txt
View Options
uniform vec4 curve[8];
varying vec2 uv;
varying vec3 pos, normal;
vec4 bezier(float x) {
vec4 lerp_a[7], lerp_b[6];
for(int i = 0; i < 7; ++i)
lerp_a[i] = mix(curve[i], curve[i+1], x);
for(int i = 0; i < 6; ++i)
lerp_b[i] = mix(lerp_a[i], lerp_a[i+1], x);
for(int i = 0; i < 5; ++i)
lerp_a[i] = mix(lerp_b[i], lerp_b[i+1], x);
for(int i = 0; i < 4; ++i)
lerp_b[i] = mix(lerp_a[i], lerp_a[i+1], x);
for(int i = 0; i < 3; ++i)
lerp_a[i] = mix(lerp_b[i], lerp_b[i+1], x);
for(int i = 0; i < 2; ++i)
lerp_b[i] = mix(lerp_a[i], lerp_a[i+1], x);
return mix(lerp_b[0], lerp_b[1], x);
}
//Rotate about z (x is known to be 0)
vec3 rotate(vec3 pt, float rad) {
return vec3(pt.y * -sin(rad), pt.y * cos(rad), pt.z);
}
void main() {
uv = gl_MultiTexCoord0.xy;
vec4 offset = bezier(uv.x);
vec3 n = gl_Vertex.xyz; n.x = 0.0;
n = rotate(vec3(0.0, n.yz), offset.w);
normal = normalize(gl_NormalMatrix * n);
vec3 vert = offset.xyz + rotate(vec3(0, gl_Vertex.yz), offset.w - 0.135);
vec4 postMV = gl_ModelViewMatrix * vec4(vert, gl_Vertex.w);
pos = (gl_ModelViewMatrix * offset).xyz;
gl_Position = gl_ProjectionMatrix * postMV;
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sun, Nov 15, 1:53 PM (9 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
143688
Default Alt Text
prominence_vs.txt (1 KB)
Attached To
Mode
R80 StarRuler2-Source
Attached
Detach File
Event Timeline