1varying vec2 varTex0; 2varying vec2 varTex1; 3varying vec2 varTex2; 4varying vec2 varTex3; 5varying vec2 varTex4; 6 7vec2 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 15void 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