//********** // This skeleton OGSFX file illustrates one potential way of // dealing with GLSL files that are to be shared between a // pure OpenGL application and the glslShader: // // Tell included shaders to use OGSFX semantics and streams: #define OGSFX 1 //********** // Uniform parameter handling: // // Loads the uniforms from all shader stage files // #define HIDE_OGSFX_UNIFORMS 0 #define HIDE_OGSFX_STREAMS 1 #define HIDE_OGSFX_CODE 1 #include "Brix.glslv" #include "Brix.glslf" //********** // Input stream handling: // // Loads the attribute streams from all shader stage files // #define HIDE_OGSFX_UNIFORMS 1 #define HIDE_OGSFX_STREAMS 0 #define HIDE_OGSFX_CODE 1 #include "Brix.glslv" #include "Brix.glslf" //********** // Code handling: // // We need to load the vertex stage and fragment stage in two // different GLSLShader blocks in order to specify them in the // technique definition below: // #define HIDE_OGSFX_UNIFORMS 1 #define HIDE_OGSFX_STREAMS 1 #define HIDE_OGSFX_CODE 0 // Vertex shader. GLSLShader VS { #include "Brix.glslv" } // Fragment shader. GLSLShader FS { #include "Brix.glslf" } //********** // Effect handling: // // Here we define a generic technique with very simple passes. // The name of the io streams between shader stages must match the // ones found in the shader stage files. This could be eliminated by // another set of #define directives to unify the io stream names in // all shader stage files. // // Techniques. technique Main { pass p0 { VertexShader (in appdata, out brixVertexOutput) = VS; PixelShader (in brixVertexOutput, out pixelOut) = FS; } }