//**************************************************************************/ // Copyright 2013 Autodesk, Inc. // All rights reserved. // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. //**************************************************************************/ // World-view-projection transformation. uniform mat4 gWVPXf : WorldViewProjection ; // The single filter input, i.e. the image to be filtered. uniform texture2D gInputTex : InputTexture; // Filter input sampler. uniform sampler2D gInputSampler = sampler_state { Texture = ; }; // Disable alpha output. uniform bool gDisableAlpha; // Flip in V uniform bool gVerticalFlip = false; // Vertex shader input structure. attribute VS_INPUT { vec4 Pos : POSITION; vec3 UV : TEXCOORD0; } // Vertex shader output structure. attribute pixelOut { vec4 colorOut: COLOR0; } attribute VS_TO_PS { vec3 VSUV : TEXCOORD0; } // Vertex shader. GLSLShader VS_Copy { void main() { // Transform the position from object space to clip space for output. gl_Position = gWVPXf * Pos; // Pass the texture coordinates. VSUV = gVerticalFlip ? vec3( UV[0], 1.0 - UV[1], UV[2] ) : UV; } } // Pixel shader. GLSLShader PS_Copy { void main() { vec4 outColor = texture2D(gInputSampler, VSUV.xy); vec4 result; if(gDisableAlpha) { result = vec4( outColor.xyz, 1.0 ); } else { result = outColor; } colorOut = result; } } // The main technique. technique Main { pass p0 { VertexShader (in VS_INPUT, out VS_TO_PS) = VS_Copy; PixelShader (in VS_TO_PS, out pixelOut) = PS_Copy; } }