Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: conformance/shaders/misc/shared.vert

Issue 8344024: Remove older revision of webgl conformance tests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/webgl/sdk/tests/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // shared vertex shader should succeed.
2 uniform mat4 viewProjection;
3 uniform vec3 worldPosition;
4 uniform vec3 nextPosition;
5 uniform float fishLength;
6 uniform float fishWaveLength;
7 uniform float fishBendAmount;
8 attribute vec4 position;
9 attribute vec2 texCoord;
10 varying vec4 v_position;
11 varying vec2 v_texCoord;
12 varying vec3 v_surfaceToLight;
13 void main() {
14 vec3 vz = normalize(worldPosition - nextPosition);
15 vec3 vx = normalize(cross(vec3(0,1,0), vz));
16 vec3 vy = cross(vz, vx);
17 mat4 orientMat = mat4(
18 vec4(vx, 0),
19 vec4(vy, 0),
20 vec4(vz, 0),
21 vec4(worldPosition, 1));
22 mat4 world = orientMat;
23 mat4 worldViewProjection = viewProjection * world;
24 mat4 worldInverseTranspose = world;
25
26 v_texCoord = texCoord;
27 // NOTE:If you change this you need to change the laser code to match!
28 float mult = position.z > 0.0 ?
29 (position.z / fishLength) :
30 (-position.z / fishLength * 2.0);
31 float s = sin(mult * fishWaveLength);
32 float a = sign(s);
33 float offset = pow(mult, 2.0) * s * fishBendAmount;
34 v_position = (
35 worldViewProjection *
36 (position +
37 vec4(offset, 0, 0, 0)));
38 v_surfaceToLight = (world * position).xyz;
39 gl_Position = v_position;
40 }
41
OLDNEW
« no previous file with comments | « conformance/shaders/misc/non-ascii-comments.vert ('k') | conformance/shaders/misc/shared-a.frag » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698