/////////////////////////////////////////////////////////////////////////////// // // ## ###### // ###### ### // ## ############### Shark 3D Engine (www.shark3d.com) // ########## # # # // ######## Copyright (c) 1996-2006 Spinor GmbH. // ######### # # # All rights reserved. // ## ########## // ## // /////////////////////////////////////////////////////////////////////////////// struct VS_INPUT { float4 posObj: POSITION; float2 screen: TEXCOORD0; }; struct VS_OUTPUT { float4 posScr: POSITION; float2 screen: TEXCOORD0; float2 scale: TEXCOORD1; }; /////////////////////////////////////////////////////////////////////////////// const float4x4 matProjView; const float4 tex0RcpSize; const float4 passInfo; /////////////////////////////////////////////////////////////////////////////// // Vertexshader // Profile: 2x0 VS_OUTPUT main(VS_INPUT input) { VS_OUTPUT output = (VS_OUTPUT)0; output.posScr = mul(input.posObj, matProjView); // Smoothing parameters: // Go from wide to small to avoid artifacts in case of depth jumps. // Use pow(2,iter) instead of pow(3,iter), // because this gives a better quality: float iter = passInfo.x; float smooth = exp2(iter); output.screen.xy = input.screen; output.scale.xy = tex0RcpSize * smooth; return output; } ///////////////////////////////////////////////////////////////////////////////