diff options
Diffstat (limited to 'shaders/warsow/22.shader_test')
-rw-r--r-- | shaders/warsow/22.shader_test | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/shaders/warsow/22.shader_test b/shaders/warsow/22.shader_test new file mode 100644 index 0000000..b4f6f7c --- /dev/null +++ b/shaders/warsow/22.shader_test @@ -0,0 +1,103 @@ +[require] +GLSL >= 1.10 + +[fragment shader] +#define FRAGMENT_SHADER +// Warsow GLSL shader + + +varying vec4 ProjVector; + +#ifdef VERTEX_SHADER +// Vertex shader + +uniform float OutlineHeight; + +void main(void) +{ +gl_FrontColor = gl_Color; + +vec4 n = vec4(gl_Normal.xyz, 0.0); +vec4 v = vec4(gl_Vertex) + n * OutlineHeight; + +gl_Position = gl_ModelViewProjectionMatrix * v; +ProjVector = gl_Position; +#ifdef APPLY_CLIPPING +#ifdef __GLSL_CG_DATA_TYPES +gl_ClipVertex = gl_ModelViewMatrix * v; +#endif +#endif +} + +#endif // VERTEX_SHADER + + +#ifdef FRAGMENT_SHADER +// Fragment shader + +uniform float OutlineCutOff; + +void main(void) +{ + +#ifdef APPLY_OUTLINES_CUTOFF +if (OutlineCutOff > 0.0 && (ProjVector.w > OutlineCutOff)) +discard; +#endif + +gl_FragColor = vec4 (gl_Color); +} + +#endif // FRAGMENT_SHADER + + +[vertex shader] +#define VERTEX_SHADER +// Warsow GLSL shader + + +varying vec4 ProjVector; + +#ifdef VERTEX_SHADER +// Vertex shader + +uniform float OutlineHeight; + +void main(void) +{ +gl_FrontColor = gl_Color; + +vec4 n = vec4(gl_Normal.xyz, 0.0); +vec4 v = vec4(gl_Vertex) + n * OutlineHeight; + +gl_Position = gl_ModelViewProjectionMatrix * v; +ProjVector = gl_Position; +#ifdef APPLY_CLIPPING +#ifdef __GLSL_CG_DATA_TYPES +gl_ClipVertex = gl_ModelViewMatrix * v; +#endif +#endif +} + +#endif // VERTEX_SHADER + + +#ifdef FRAGMENT_SHADER +// Fragment shader + +uniform float OutlineCutOff; + +void main(void) +{ + +#ifdef APPLY_OUTLINES_CUTOFF +if (OutlineCutOff > 0.0 && (ProjVector.w > OutlineCutOff)) +discard; +#endif + +gl_FragColor = vec4 (gl_Color); +} + +#endif // FRAGMENT_SHADER + + |