shaders.h 2.9 KB

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