//**************************************************************************/ // Copyright (c) 2008 Autodesk, Inc. // All rights reserved. // // These coded instructions, statements, and computer programs contain // unpublished proprietary information written by Autodesk, Inc., and are // protected by Federal copyright law. They may not be disclosed to third // parties or copied or duplicated in any form, in whole or in part, without // the prior written consent of Autodesk, Inc. //**************************************************************************/ // DESCRIPTION: Common shader code. // AUTHOR: Mauricio Vives, converted to OGSFX by Eric Haines, July 2013 // CREATED: December 2008 //**************************************************************************/ #ifndef _COMMON_OGSFH_ #define _COMMON_OGSFH_ // World-view-projection transformation. uniform mat4 gWVPXf : WorldViewProjection; // Screen size, in pixels. uniform vec2 gScreenSize : ViewportPixelSize; // insert in GLSL_shader itself // vec2 gTexelSize = 1.0 / gScreenSize; //////////////////////////////////////////////////////////////////////////////////////////////////// // Screen Quad Vertex Shader //////////////////////////////////////////////////////////////////////////////////////////////////// // Vertex shader input structure. attribute VS_INPUT_ScreenQuad { vec3 Pos : POSITION; vec2 UV : TEXCOORD0; } // Vertex shader output structure. attribute pixelOut { vec4 colorOut: COLOR0; } attribute VS_TO_PS_ScreenQuad { vec2 VSUV : TEXCOORD0; } // Vertex shader. GLSLShader VS_ScreenQuad { void main() { // Output the position and texture coordinates directly. gl_Position = gWVPXf*vec4(Pos, 1.0); VSUV = UV; } } #endif // _COMMON_OGSFH_