Revision 9b82becd
Added by Leszek Koltunski about 8 years ago
src/main/res/raw/main_vertex_shader.glsl | ||
---|---|---|
356 | 356 |
vec2 sincos = vUniforms[effect+1].xy; |
357 | 357 |
|
358 | 358 |
float amplitude = vUniforms[effect].x; |
359 |
float angle = vUniforms[effect].y; |
|
360 | 359 |
float length = vUniforms[effect].z; |
361 | 360 |
float d = dot( vec2(-ps.y,-ps.x),sincos ); |
362 |
float num = length==0.0 ? 1.0 : d / length; |
|
363 |
float floornum = floor(num); |
|
364 |
float therest = num-floornum; |
|
365 |
float phi = mod(floornum,2.0) == 0.0 ? 1.0-therest:therest; |
|
361 |
float num = length==0.0 ? 0.0 : d / length; |
|
366 | 362 |
|
367 |
v.xy += (phi*amplitude*deg*sincos);
|
|
363 |
v.xy += (sin(1.57*num)*amplitude*deg*sincos);
|
|
368 | 364 |
} |
369 | 365 |
|
370 | 366 |
#endif |
Also available in: Unified diff
Improvements for WAVE