Search
lxdream.org :: lxdream/src/pvr2/shaders.glsl :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/shaders.glsl
changeset 1130:5f56fc931112
next1140:7dc1c71ece76
author nkeynes
date Fri Sep 17 20:08:50 2010 +1000 (13 years ago)
permissions -rw-r--r--
last change Refactor shader management to support multiple programs, which are all
defined in the shaders.glsl, rather than split up into one file per
fragment.
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/pvr2/shaders.glsl Fri Sep 17 20:08:50 2010 +1000
1.3 @@ -0,0 +1,42 @@
1.4 +/**
1.5 + * $Id$
1.6 + *
1.7 + * Assorted shader definitions (optionally) used by the PVR2 rendering
1.8 + * engine.
1.9 + *
1.10 + * This file is preprocessed by genglsl to produce shaders.c and shaders.h.
1.11 + *
1.12 + * Copyright (c) 2007-2010 Nathan Keynes.
1.13 + *
1.14 + * This program is free software; you can redistribute it and/or modify
1.15 + * it under the terms of the GNU General Public License as published by
1.16 + * the Free Software Foundation; either version 2 of the License, or
1.17 + * (at your option) any later version.
1.18 + *
1.19 + * This program is distributed in the hope that it will be useful,
1.20 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.21 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.22 + * GNU General Public License for more details.
1.23 + */
1.24 +
1.25 +#vertex DEFAULT_VERTEX_SHADER
1.26 +void main()
1.27 +{
1.28 + vec4 tmp = ftransform();
1.29 + float w = gl_Vertex.z;
1.30 + gl_Position = tmp * w;
1.31 + gl_FrontColor = gl_Color;
1.32 + gl_FrontSecondaryColor = gl_SecondaryColor;
1.33 + gl_TexCoord[0] = gl_MultiTexCoord0;
1.34 + gl_FogFragCoord = gl_FogCoord;
1.35 +}
1.36 +
1.37 +#fragment DEFAULT_FRAGMENT_SHADER
1.38 +void main()
1.39 +{
1.40 + gl_FragColor = gl_Color;
1.41 + gl_FragDepth = gl_FragCoord.z;
1.42 +}
1.43 +
1.44 +#program DEFAULT_PROGRAM = DEFAULT_VERTEX_SHADER
1.45 +
.