Quake-III-Arena

Quake III Arena GPL Source Release
Log | Files | Refs

shaders.h (2925B)


      1 /*
      2 ===========================================================================
      3 Copyright (C) 1999-2005 Id Software, Inc.
      4 
      5 This file is part of Quake III Arena source code.
      6 
      7 Quake III Arena source code is free software; you can redistribute it
      8 and/or modify it under the terms of the GNU General Public License as
      9 published by the Free Software Foundation; either version 2 of the License,
     10 or (at your option) any later version.
     11 
     12 Quake III Arena source code is distributed in the hope that it will be
     13 useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 GNU General Public License for more details.
     16 
     17 You should have received a copy of the GNU General Public License
     18 along with Foobar; if not, write to the Free Software
     19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
     20 ===========================================================================
     21 */
     22 
     23 
     24 typedef struct shaderInfo_s {
     25 	char		shader[MAX_QPATH];
     26 	int			surfaceFlags;
     27 	int			contents;
     28 	int			value;
     29 
     30 	char		backShader[MAX_QPATH];	// for surfaces that generate different front and back passes
     31 	char		flareShader[MAX_QPATH];	// for light flares
     32 
     33 	float		subdivisions;			// from a "tesssize xxx"
     34 	float		backsplashFraction;		// floating point value, usually 0.05
     35 	float		backsplashDistance;		// default 16
     36 	float		lightSubdivide;			// default 120
     37 	int			lightmapSampleSize;		// lightmap sample size
     38 
     39 	qboolean	hasPasses;				// false if the shader doesn't define any rendering passes
     40 
     41 	qboolean	globalTexture;			// don't normalize texture repeats
     42 
     43 	qboolean	twoSided;				// cull none
     44 	qboolean	autosprite;				// autosprite shaders will become point lights
     45 										// instead of area lights
     46 	qboolean	lightFilter;			// light rays that cross surfaces of this type
     47 										// should test against the filter image
     48 	qboolean	forceTraceLight;		// always use -light for this surface
     49 	qboolean	forceVLight;			// always use -vlight for this surface
     50 	qboolean	patchShadows;			// have patches casting shadows when using -light for this surface
     51 	qboolean	vertexShadows;			// shadows will be casted at this surface even when vertex lit
     52 	qboolean	noVertexShadows;		// no shadows will be casted at this surface in vertex lighting
     53 	qboolean	forceSunLight;			// force sun light at this surface even tho we might not calculate shadows in vertex lighting
     54 	qboolean	notjunc;				// don't use this surface for tjunction fixing
     55 	float		vertexScale;			// vertex light scale
     56 
     57 	char		editorimage[MAX_QPATH];	// use this image to generate texture coordinates
     58 	char		lightimage[MAX_QPATH];	// use this image to generate color / averageColor
     59 	vec3_t		color;					// colorNormalized
     60 	vec3_t		averageColor;
     61 
     62 	int			width, height;
     63 	byte		*pixels;
     64 
     65 	vec3_t		sunLight;
     66 	vec3_t		sunDirection;
     67 } shaderInfo_t;
     68 
     69 void LoadShaderInfo( void );
     70 shaderInfo_t	*ShaderInfoForShader( const char *shader );
     71