//**************************************************************************/ // Copyright 2014 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 = ; //MinFilter = Point; //MagFilter = Point; //MipFilter = Point; }; // Vertex shader input structure. attribute VS_INPUT { vec4 Pos : POSITION; vec2 UV : TEXCOORD0; }; // Vertex shader output structure. attribute VS_TO_PS { vec2 VSUV : TEXCOORD0; }; // Vertex shader. GLSLShader VS_Copy { void main() { gl_Position = gWVPXf*Pos; // Pass the texture coordinates unchanged. VSUV = UV; } } // Pixel shader output structure. attribute pixelOut { vec4 colorOut: COLOR0; } // Pixel shader. GLSLShader PS_Copy { void main() { vec4 result = texture2D(gInputSampler, VSUV); colorOut = vec4(1.0, 1.0, 1.0, 1.0) - 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; } }