/////////////////////////////////////////////////////////////////////////////// // // ## ###### // ###### ### // ## ############### Shark 3D Engine (www.shark3d.com) // ########## # # # // ######## Copyright (c) 1996-2006 Spinor GmbH. // ######### # # # All rights reserved. // ## ########## // ## // /////////////////////////////////////////////////////////////////////////////// uniform vec4 passInfo; uniform vec4 tex0RcpSize; varying vec4 baseVec; void main(void) { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; vec4 posView = gl_ModelViewMatrix * gl_Vertex; gl_FogFragCoord = posView.z / posView.w; gl_FrontColor = gl_Color; gl_TexCoord[0].xy = gl_MultiTexCoord0.xy; // Scaling offset float iter = passInfo.x; vec2 offsScale = tex0RcpSize.xy * pow(2.0, iter) * 0.5; vec4 dirVec; float fiter = mod(iter, 4.0); if(fiter < 2.0) { if(fiter < 1.0) dirVec = vec4(1.0, 0.0, 0.0, 1.0); // Vectors (1, 0) and (0, 1) else dirVec = vec4(1.0, 1.0,-1.0, 1.0); // Vectors (1, 1) and (-1, 1) } else { if(fiter < 3.0) dirVec = vec4(2.0, 1.0, -1.0, 2.0); // Vectors (2, 1) and (-1, 2) else dirVec = vec4(1.0, 2.0, -2.0, 1.0); // Vectors (1, 2) and (-2, 1) } baseVec = dirVec * offsScale.xyxy; } ///////////////////////////////////////////////////////////////////////////////