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