Home | History | Annotate | Download | only in raw
      1 varying vec2 varTex0;
      2 varying vec2 varTex1;
      3 varying vec2 varTex2;
      4 varying vec2 varTex3;
      5 varying vec2 varTex4;
      6 
      7 vec2 mul(vec4 uni, vec2 attr, float idx, vec2 offset)
      8 {
      9     float invz = 0.5 + idx*0.05;
     10     return vec2(
     11         0.5 + 0.5 * invz * (uni.z * ( uni.y * (attr.x + offset.x) + uni.x * (attr.y + offset.y))) + uni.w,
     12         0.5 + 0.5 * invz * (uni.z * (-uni.x * (attr.x + offset.x) + uni.y * (attr.y + offset.y))));
     13 }
     14 
     15 void main() {
     16     varTex0 = mul(UNI_layer0, ATTRIB_position.xy, 1.0, UNI_panoffset);
     17     varTex1 = mul(UNI_layer1, ATTRIB_position.xy, 2.0, UNI_panoffset);
     18     varTex2 = mul(UNI_layer2, ATTRIB_position.xy, 3.0, UNI_panoffset);
     19     varTex3 = mul(UNI_layer3, ATTRIB_position.xy, 4.0, UNI_panoffset);
     20     varTex4 = mul(UNI_layer4, ATTRIB_position.xy, 5.0, UNI_panoffset);
     21     gl_Position = ATTRIB_position;
     22 }
     23