Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
shader.h
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19/***********************************************************************************************
20 *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
21 ***********************************************************************************************
22 * *
23 * Project Name : WW3D *
24 * *
25 * $Archive:: /VSS_Sync/ww3d2/shader.h $*
26 * *
27 * Author:: Greg Hjelstrom *
28 * *
29 * $Modtime:: 8/29/01 7:29p $*
30 * *
31 * $Revision:: 16 $*
32 * *
33 *---------------------------------------------------------------------------------------------*
34 * Functions: *
35 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
36
37
38#if defined(_MSC_VER)
39#pragma once
40#endif
41
42#ifndef SHADER_H
43#define SHADER_H
44
45#include "always.h"
46
47#if defined (SR_OS_SOLARIS)
48#undef PASS_MAX
49#endif
50
51class DX8Wrapper;
53class StringClass;
54
55// Re-written shader class
56// Hector Yee 1/24/01
57
59{
60 SHIFT_DEPTHCOMPARE = 0, // bit shift for depth comparison setting
61 SHIFT_DEPTHMASK = 3, // bit shift for depth mask setting
62 SHIFT_COLORMASK = 4, // bit shift for color mask setting
63 SHIFT_DSTBLEND = 5, // bit shift for destination blend setting
64 SHIFT_FOG = 8, // bit shift for fog setting
65 SHIFT_PRIGRADIENT = 10, // bit shift for primary gradient setting
66 SHIFT_SECGRADIENT = 13, // bit shift for secondary gradient setting
67 SHIFT_SRCBLEND = 14, // bit shift for source blend setting
68 SHIFT_TEXTURING = 16, // bit shift for texturing setting (1 bit)
69 SHIFT_NPATCHENABLE = 17, // bit shift for npatch enabling
70 SHIFT_ALPHATEST = 18, // bit shift for alpha test setting
71 SHIFT_CULLMODE = 19, // bit shift for cullmode setting
72 SHIFT_POSTDETAILCOLORFUNC = 20, // bit shift for post-detail color function setting
73 SHIFT_POSTDETAILALPHAFUNC = 24 // bit shift for post-detail alpha function setting
74};
75
76#define SHADE_CNST(depth_compare, depth_mask, color_mask, src_blend, dst_blend, fog, pri_grad, sec_grad, texture, alpha_test, cullmode, post_det_color, post_det_alpha) \
77 ( (depth_compare) << SHIFT_DEPTHCOMPARE | (depth_mask) << SHIFT_DEPTHMASK | \
78 (color_mask) << SHIFT_COLORMASK | (dst_blend) << SHIFT_DSTBLEND | (fog) << SHIFT_FOG | \
79 (pri_grad) << SHIFT_PRIGRADIENT | (sec_grad) << SHIFT_SECGRADIENT | \
80 (src_blend) << SHIFT_SRCBLEND | (texture) << SHIFT_TEXTURING | \
81 (alpha_test) << SHIFT_ALPHATEST | (cullmode) << SHIFT_CULLMODE | \
82 (post_det_color) << SHIFT_POSTDETAILCOLORFUNC | \
83 (post_det_alpha) << SHIFT_POSTDETAILALPHAFUNC)
84
85
86
88{
89 friend DX8Wrapper;
90
91 void Apply();
92public:
93
95 {
96 ALPHATEST_DISABLE= 0,// disable alpha testing (default)
97 ALPHATEST_ENABLE, // enable alpha testing
98 ALPHATEST_MAX // end of enumeration
99 };
100
102 {
103 PASS_NEVER=0, // pass never
104 PASS_LESS, // pass if incoming less than stored
105 PASS_EQUAL, // pass if incoming equal to stored
106 PASS_LEQUAL, // pass if incoming less than or equal to stored (default)
107 PASS_GREATER, // pass if incoming greater than stored
108 PASS_NOTEQUAL, // pass if incoming not equal to stored
109 PASS_GEQUAL, // pass if incoming greater than or equal to stored
110 PASS_ALWAYS, // pass always
111 PASS_MAX // end of enumeration
112 };
113
115 {
116 DEPTH_WRITE_DISABLE=0, // disable depth buffer writes
117 DEPTH_WRITE_ENABLE, // enable depth buffer writes (default)
118 DEPTH_WRITE_MAX // end of enumeration
119 };
120
122 {
123 COLOR_WRITE_DISABLE=0, // disable color buffer writes
124 COLOR_WRITE_ENABLE, // enable color buffer writes (default)
125 COLOR_WRITE_MAX // end of enumeration
126 };
127
129 {
130 DETAILALPHA_DISABLE=0, // local (default)
132 DETAILALPHA_SCALE, // local * other
133 DETAILALPHA_INVSCALE, // ~(~local * ~other) = local + (1-local)*other
134 DETAILALPHA_MAX // end of enumeration
135 };
136
138 {
139 DETAILCOLOR_DISABLE=0, // 0000 local (default)
140 DETAILCOLOR_DETAIL, // 0001 other
141 DETAILCOLOR_SCALE, // 0010 local * other
142 DETAILCOLOR_INVSCALE, // 0011 ~(~local * ~other) = local + (1-local)*other
143 DETAILCOLOR_ADD, // 0100 local + other
144 DETAILCOLOR_SUB, // 0101 local - other
145 DETAILCOLOR_SUBR, // 0110 other - local
146 DETAILCOLOR_BLEND, // 0111 (localAlpha)*local + (~localAlpha)*other
147 DETAILCOLOR_DETAILBLEND, // 1000 (otherAlpha)*local + (~otherAlpha)*other
148 DETAILCOLOR_ADDSIGNED, // 1001 (local + other - 0.5)
149 DETAILCOLOR_ADDSIGNED2X, // 1010 (local + other - 0.5) * 2
150 DETAILCOLOR_SCALE2X, // 1011 local * other * 2
151 DETAILCOLOR_MODALPHAADDCOLOR, // 1100 local + localAlpha * other
152
153 DETAILCOLOR_MAX // end of enumeration
154 };
155
162
169
171 {
172 DSTBLEND_ZERO=0, // destination pixel doesn't affect blending (default)
173 DSTBLEND_ONE, // destination pixel added unmodified
174 DSTBLEND_SRC_COLOR, // destination pixel multiplied by fragment RGB components
175 DSTBLEND_ONE_MINUS_SRC_COLOR, // destination pixel multiplied by one minus (i.e. inverse) fragment RGB components
176 DSTBLEND_SRC_ALPHA, // destination pixel multiplied by fragment alpha component
177 DSTBLEND_ONE_MINUS_SRC_ALPHA, // destination pixel multiplied by fragment inverse alpha
178 DSTBLEND_MAX // end of enumeration
179 };
180
182 {
183 FOG_DISABLE=0, // don't perform fogging (default)
184 FOG_ENABLE, // apply fog, f*fogColor + (1-f)*fragment
185 FOG_SCALE_FRAGMENT, // fog scalar value multiplies fragment, (1-f)*fragment
186 FOG_WHITE, // fog scalar value replaces fragment, f*fogColor
187 FOG_MAX // end of enumeration
188 };
189
191 {
192 GRADIENT_DISABLE=0, // 000 disable primary gradient (same as OpenGL 'decal' texture blend)
193 GRADIENT_MODULATE, // 001 modulate fragment ARGB by gradient ARGB (default)
194 GRADIENT_ADD, // 010 add gradient RGB to fragment RGB, copy gradient A to fragment A
195 GRADIENT_BUMPENVMAP, // 011 environment-mapped bump mapping
196 GRADIENT_BUMPENVMAPLUMINANCE, // 100 environment-mapped bump mapping with luminance control
197 GRADIENT_MODULATE2X, // 101 modulate fragment ARGB by gradient ARGB and multiply RGB by 2
198 GRADIENT_MAX // end of enumeration
199 };
200
202 {
203 SECONDARY_GRADIENT_DISABLE=0, // don't draw secondary gradient (default)
204 SECONDARY_GRADIENT_ENABLE, // add secondary gradient RGB to fragment RGB
205 SECONDARY_GRADIENT_MAX // end of enumeration
206 };
207
209 {
210 SRCBLEND_ZERO=0, // fragment not added to color buffer
211 SRCBLEND_ONE, // fragment added unmodified to color buffer (default)
212 SRCBLEND_SRC_ALPHA, // fragment RGB components multiplied by fragment A
213 SRCBLEND_ONE_MINUS_SRC_ALPHA, // fragment RGB components multiplied by fragment inverse (one minus) A
214 SRCBLEND_MAX // end of enumeration
215 };
216
218 {
219 TEXTURING_DISABLE=0, // no texturing (treat fragment initial color as 1,1,1,1)
220 TEXTURING_ENABLE, // enable texturing
221 TEXTURING_MAX // end of enumeration
222 };
223
232
233 enum
234 {
235 MASK_DEPTHCOMPARE = (7<<0), // mask for depth comparison setting
236 MASK_DEPTHMASK = (1<<3), // mask for depth mask setting
237 MASK_COLORMASK = (1<<4), // mask for color mask setting
238 MASK_DSTBLEND = (7<<5), // mask for destination blend setting
239 MASK_FOG = (3<<8), // mask for fog setting
240 MASK_PRIGRADIENT = (7<<10), // mask for primary gradient setting
241 MASK_SECGRADIENT = (1<<13), // mask for secondary gradient setting
242 MASK_SRCBLEND = (3<<14), // mask for source blend setting
243 MASK_TEXTURING = (1<<16), // mask for texturing setting
244 MASK_NPATCHENABLE = (1<<17), // mask for npatch enable
245 MASK_ALPHATEST = (1<<18), // mask for alpha test enable
246 MASK_CULLMODE = (1<<19), // mask for cullmode setting
247 MASK_POSTDETAILCOLORFUNC= (15<<20), // mask for post detail color function setting
248 MASK_POSTDETAILALPHAFUNC= (7<<24) // mask for post detail alpha function setting
249 };
250
252 { Reset(); }
253
256
257 ShaderClass(const unsigned int d)
258 { ShaderBits=d; }
259
260 bool operator == (const ShaderClass & s) { return ShaderBits == s.ShaderBits; }
261 bool operator != (const ShaderClass & s) { return ShaderBits != s.ShaderBits; }
262
263 inline unsigned int Get_Bits(void) const
264 { return ShaderBits; }
265
266 inline int Uses_Alpha(void) const
267 {
268 // check if alpha test is enabled
270 return true;
271
274 return true;
275
277
278 return (src == SRCBLEND_SRC_ALPHA || src == SRCBLEND_ONE_MINUS_SRC_ALPHA);
279 }
280
281 inline int Uses_Fog(void) const
282 {
283 return (Get_Fog_Func() != FOG_DISABLE);
284 }
285
286 inline int Uses_Primary_Gradient(void) const
287 {
289 }
290
291 inline int Uses_Secondary_Gradient(void) const
292 {
294 }
295
296 inline int Uses_Texture(void) const
297 { return (Get_Texturing() != TEXTURING_DISABLE); }
298
299 inline int Uses_Post_Detail_Texture(void) const
300 {
302 return false;
304 }
305
306 inline void Reset(void);
307
322
337
338 void Init_From_Material3(const W3dMaterial3Struct & mat3);
339 void Enable_Fog (const char *source);
340
341 // helper function for static sort system
343 int Guess_Sort_Level(void) const;
344
345 // DX 8 state management routines
346 static inline void Invalidate() { ShaderDirty=true; }
347
348 // Global backface culling invert. This interface can be used to globally invert all backface
349 // culling. This is a global setting and will affect everything being rendered. Typically it
350 // should be left alone at the default setting. Renegade uses this feature to render the entire
351 // scene's backfacing polygons only; this is used in a VIS-debugging process. In order for this
352 // to work, you will have to ww3d::Flush all rendering before changing the setting back.
353 // NORMAL USERS SHOULD NEVER CALL THESE FUNCTIONS!
354 static void Invert_Backface_Culling(bool onoff);
355 static bool Is_Backface_Culling_Inverted(void);
356
357 const StringClass& Get_Description(StringClass& str) const;
358
359 // These are a bunch of predefined shaders for common cases. None of them
360 // have fogging since "no fog" is the surrender default and usage of fog
361 // changes from app to app - if you want a fogging shader just grab one of
362 // these and add fog to it.
363
364 // Texturing, zbuffer, primary gradient, no blending
366
367 // Texturing, zbuffer, primary gradient, additive blending
369
370 // Texturing, zbuffer, primary gradient, additive blending, bumpenvmap
372
373 // Texturing, zbuffer, primary gradient, alpha blending
375
376 // Texturing, zbuffer, primary gradient, multiplicative blending
378
379 // Texturing, no zbuffer reading/writing, no gradients, no blending, no
380 // fogging - mostly for opaque 2D objects.
382
383 // Texturing, default zbuffer reading, no zbuffer writing, no gradients, no blending, no
384 // fogging - mostly for opaque sprites
386
387 // Texturing, no zbuffer reading/writing, no gradients, additive blending,
388 // no fogging - mostly for additive 2D objects.
390
391 // Texturing, no zbuffer reading/writing, no gradients, alpha blending, no
392 // fogging - mostly for alpha-blended 2D objects.
394
395 // Texturing, default zbuffer reading, no zbuffer writing, no gradients,
396 // additive blending, no fogging - mostly for use in additive sprite
397 // objects.
399
400 // Texturing, default zbuffer reading, no zbuffer writing, no gradients,
401 // alpha blending, no fogging - mostly for use in alpha-blended sprite
402 // objects.
404
405 // No texturing, default zbuffer reading/writing, primary gradient, no
406 // blending, no fogging - mostly for use in solid-colored opaque objects.
408
409 // No texturing, default zbuffer reading, no zbuffer writing, primary
410 // gradient, additive blending, no fogging - mostly for use in
411 // solid-colored additive objects.
413
414 // No texturing, default zbuffer reading, no zbuffer writing, primary
415 // gradient, alpha blending, no fogging - mostly for use in solid-colored
416 // alpha-blended objects.
418
419 // Texturing, no zbuffer reading/writing, no gradients, no blending, alpha
420 // testing, no fogging - mostly for "pure" alpha-tested 2D objects.
422
423 // Texturing, default zbuffer reading and writing, no gradients, no
424 // blending, alpha testing, no fogging - mostly for "pure" alpha-tested
425 // sprite objects.
427
428 // Texturing, no zbuffer reading/writing, no gradients, alpha blending AND
429 // alpha testing, no fogging - mostly for alpha-tested and blended 2D
430 // objects.
432
433 // Texturing, default zbuffer reading and writing, no gradients, alpha
434 // blending AND alpha testing, no fogging - mostly for use in alpha-tested
435 // and blended sprite objects.
437
438 // Texturing, no zbuffer reading/writing, no gradients, screen blending,
439 // no fogging - mostly for screen-blended 2D objects.
441
442 // Texturing, default zbuffer reading, no zbuffer writing, no gradients,
443 // screen blending, no fogging - mostly for use in screen-blended sprite
444 // objects.
446
447 // Texturing, no zbuffer reading/writing, no gradients, multiplicative
448 // blending, no fogging - mostly for multiplicatively blended 2D objects.
450
451 // Texturing, default zbuffer reading, no zbuffer writing, no gradients,
452 // multiplicative blending, no fogging - mostly for use in multiplicatively
453 // blended sprite objects.
455
456protected:
457
458 // Debug warning.
459 void Report_Unable_To_Fog (const char *source);
460
461 unsigned int ShaderBits;
462
463 static bool ShaderDirty;
464 static unsigned long CurrentShader;
465};
466
485
486#endif //SHADER_H
const StringClass & Get_Description(StringClass &str) const
Definition shader.cpp:1164
void Set_Texturing(TexturingType x)
Definition shader.h:335
int Uses_Fog(void) const
Definition shader.h:281
static ShaderClass _PresetOpaqueSpriteShader
Definition shader.h:385
int Uses_Post_Detail_Texture(void) const
Definition shader.h:299
static ShaderClass _PresetAdditiveSpriteShader
Definition shader.h:398
unsigned int ShaderBits
Definition shader.h:461
@ GRADIENT_BUMPENVMAPLUMINANCE
Definition shader.h:196
@ GRADIENT_DISABLE
Definition shader.h:192
@ GRADIENT_MAX
Definition shader.h:198
@ GRADIENT_BUMPENVMAP
Definition shader.h:195
@ GRADIENT_MODULATE
Definition shader.h:193
@ GRADIENT_ADD
Definition shader.h:194
@ GRADIENT_MODULATE2X
Definition shader.h:197
static ShaderClass _PresetAdditive2DShader
Definition shader.h:389
static ShaderClass _PresetATestBlendSpriteShader
Definition shader.h:436
static ShaderClass _PresetBumpenvmapShader
Definition shader.h:371
static ShaderClass _PresetOpaqueShader
Definition shader.h:365
DepthCompareType Get_Depth_Compare(void) const
Definition shader.h:308
DetailColorFuncType
Definition shader.h:138
@ DETAILCOLOR_ADDSIGNED2X
Definition shader.h:149
@ DETAILCOLOR_MAX
Definition shader.h:153
@ DETAILCOLOR_SUB
Definition shader.h:144
@ DETAILCOLOR_DISABLE
Definition shader.h:139
@ DETAILCOLOR_DETAIL
Definition shader.h:140
@ DETAILCOLOR_BLEND
Definition shader.h:146
@ DETAILCOLOR_SCALE
Definition shader.h:141
@ DETAILCOLOR_ADDSIGNED
Definition shader.h:148
@ DETAILCOLOR_SCALE2X
Definition shader.h:150
@ DETAILCOLOR_DETAILBLEND
Definition shader.h:147
@ DETAILCOLOR_SUBR
Definition shader.h:145
@ DETAILCOLOR_INVSCALE
Definition shader.h:142
@ DETAILCOLOR_ADD
Definition shader.h:143
@ DETAILCOLOR_MODALPHAADDCOLOR
Definition shader.h:151
static ShaderClass _PresetAlphaSpriteShader
Definition shader.h:403
static ShaderClass _PresetATestBlend2DShader
Definition shader.h:431
static ShaderClass _PresetATestSpriteShader
Definition shader.h:426
void Set_Src_Blend_Func(SrcBlendFuncType x)
Definition shader.h:334
static void Invalidate()
Definition shader.h:346
@ MASK_DSTBLEND
Definition shader.h:238
@ MASK_NPATCHENABLE
Definition shader.h:244
@ MASK_TEXTURING
Definition shader.h:243
@ MASK_DEPTHMASK
Definition shader.h:236
@ MASK_DEPTHCOMPARE
Definition shader.h:235
@ MASK_SECGRADIENT
Definition shader.h:241
@ MASK_ALPHATEST
Definition shader.h:245
@ MASK_COLORMASK
Definition shader.h:237
@ MASK_POSTDETAILCOLORFUNC
Definition shader.h:247
@ MASK_SRCBLEND
Definition shader.h:242
@ MASK_PRIGRADIENT
Definition shader.h:240
@ MASK_POSTDETAILALPHAFUNC
Definition shader.h:248
@ MASK_CULLMODE
Definition shader.h:246
@ PASS_LEQUAL
Definition shader.h:106
@ PASS_NOTEQUAL
Definition shader.h:108
@ PASS_GEQUAL
Definition shader.h:109
@ PASS_ALWAYS
Definition shader.h:110
@ PASS_GREATER
Definition shader.h:107
static bool Is_Backface_Culling_Inverted(void)
Definition shader.cpp:1159
bool operator==(const ShaderClass &s)
Definition shader.h:260
static ShaderClass _PresetATest2DShader
Definition shader.h:421
static ShaderClass _PresetAlpha2DShader
Definition shader.h:393
static ShaderClass _PresetAlphaSolidShader
Definition shader.h:417
void Set_Post_Detail_Alpha_Func(DetailAlphaFuncType x)
Definition shader.h:326
FogFuncType Get_Fog_Func(void) const
Definition shader.h:316
void Set_Cull_Mode(CullModeType x)
Definition shader.h:329
DetailColorFuncType Get_Post_Detail_Color_Func(void) const
Definition shader.h:312
bool operator!=(const ShaderClass &s)
Definition shader.h:261
@ FOG_DISABLE
Definition shader.h:183
@ FOG_SCALE_FRAGMENT
Definition shader.h:185
void Set_Depth_Compare(DepthCompareType x)
Definition shader.h:323
@ NPATCH_ENABLE
Definition shader.h:166
@ NPATCH_DISABLE
Definition shader.h:165
@ NPATCH_TYPE_MAX
Definition shader.h:167
int Uses_Texture(void) const
Definition shader.h:296
static ShaderClass _PresetMultiplicativeSpriteShader
Definition shader.h:454
void Set_Depth_Mask(DepthMaskType x)
Definition shader.h:324
ShaderClass(void)
Definition shader.h:251
@ COLOR_WRITE_DISABLE
Definition shader.h:123
@ COLOR_WRITE_MAX
Definition shader.h:125
@ COLOR_WRITE_ENABLE
Definition shader.h:124
DetailAlphaFuncType
Definition shader.h:129
@ DETAILALPHA_SCALE
Definition shader.h:132
@ DETAILALPHA_MAX
Definition shader.h:134
@ DETAILALPHA_INVSCALE
Definition shader.h:133
@ DETAILALPHA_DETAIL
Definition shader.h:131
@ DETAILALPHA_DISABLE
Definition shader.h:130
int Uses_Secondary_Gradient(void) const
Definition shader.h:291
static ShaderClass _PresetMultiplicative2DShader
Definition shader.h:449
static ShaderClass _PresetScreen2DShader
Definition shader.h:440
void Set_Primary_Gradient(PriGradientType x)
Definition shader.h:332
ShaderClass(const ShaderClass &s)
Definition shader.h:254
DetailAlphaFuncType Get_Post_Detail_Alpha_Func(void) const
Definition shader.h:311
StaticSortCategoryType
Definition shader.h:225
@ SSCAT_OPAQUE
Definition shader.h:226
@ SSCAT_ALPHA_TEST
Definition shader.h:227
@ SSCAT_ADDITIVE
Definition shader.h:228
@ SSCAT_SCREEN
Definition shader.h:229
@ SSCAT_OTHER
Definition shader.h:230
TexturingType Get_Texturing(void) const
Definition shader.h:320
void Init_From_Material3(const W3dMaterial3Struct &mat3)
Definition shader.cpp:254
@ TEXTURING_MAX
Definition shader.h:221
@ TEXTURING_DISABLE
Definition shader.h:219
@ TEXTURING_ENABLE
Definition shader.h:220
@ CULL_MODE_DISABLE
Definition shader.h:158
@ CULL_MODE_MAX
Definition shader.h:160
@ CULL_MODE_ENABLE
Definition shader.h:159
NPatchEnableType Get_NPatch_Enable(void) const
Definition shader.h:321
SecGradientType Get_Secondary_Gradient(void) const
Definition shader.h:318
void Set_Fog_Func(FogFuncType x)
Definition shader.h:331
DepthMaskType Get_Depth_Mask(void) const
Definition shader.h:309
CullModeType Get_Cull_Mode(void) const
Definition shader.h:314
static ShaderClass _PresetAdditiveSolidShader
Definition shader.h:412
static ShaderClass _PresetOpaque2DShader
Definition shader.h:381
PriGradientType Get_Primary_Gradient(void) const
Definition shader.h:317
void Set_Post_Detail_Color_Func(DetailColorFuncType x)
Definition shader.h:327
static ShaderClass _PresetAlphaShader
Definition shader.h:374
static void Invert_Backface_Culling(bool onoff)
Definition shader.cpp:1059
static ShaderClass _PresetAdditiveShader
Definition shader.h:368
@ DEPTH_WRITE_MAX
Definition shader.h:118
@ DEPTH_WRITE_ENABLE
Definition shader.h:117
@ DEPTH_WRITE_DISABLE
Definition shader.h:116
SrcBlendFuncType Get_Src_Blend_Func(void) const
Definition shader.h:319
void Reset(void)
Definition shader.h:467
ColorMaskType Get_Color_Mask(void) const
Definition shader.h:310
void Set_Dst_Blend_Func(DstBlendFuncType x)
Definition shader.h:330
@ SECONDARY_GRADIENT_ENABLE
Definition shader.h:204
@ SECONDARY_GRADIENT_DISABLE
Definition shader.h:203
@ SECONDARY_GRADIENT_MAX
Definition shader.h:205
void Enable_Fog(const char *source)
Definition shader.cpp:280
static unsigned long CurrentShader
Definition shader.h:464
int Uses_Alpha(void) const
Definition shader.h:266
StaticSortCategoryType Get_SS_Category(void) const
Definition shader.cpp:1085
DstBlendFuncType Get_Dst_Blend_Func(void) const
Definition shader.h:315
ShaderClass(const unsigned int d)
Definition shader.h:257
void Set_Alpha_Test(AlphaTestType x)
Definition shader.h:328
void Report_Unable_To_Fog(const char *source)
Definition shader.cpp:342
unsigned int Get_Bits(void) const
Definition shader.h:263
@ SRCBLEND_ZERO
Definition shader.h:210
@ SRCBLEND_ONE_MINUS_SRC_ALPHA
Definition shader.h:213
@ SRCBLEND_SRC_ALPHA
Definition shader.h:212
@ SRCBLEND_ONE
Definition shader.h:211
@ SRCBLEND_MAX
Definition shader.h:214
static ShaderClass _PresetScreenSpriteShader
Definition shader.h:445
int Guess_Sort_Level(void) const
Definition shader.cpp:1123
AlphaTestType Get_Alpha_Test(void) const
Definition shader.h:313
static bool ShaderDirty
Definition shader.h:463
int Uses_Primary_Gradient(void) const
Definition shader.h:286
void Set_Color_Mask(ColorMaskType x)
Definition shader.h:325
@ ALPHATEST_DISABLE
Definition shader.h:96
@ ALPHATEST_ENABLE
Definition shader.h:97
@ ALPHATEST_MAX
Definition shader.h:98
void Set_NPatch_Enable(NPatchEnableType x)
Definition shader.h:336
static ShaderClass _PresetMultiplicativeShader
Definition shader.h:377
@ DSTBLEND_ZERO
Definition shader.h:172
@ DSTBLEND_MAX
Definition shader.h:178
@ DSTBLEND_ONE_MINUS_SRC_COLOR
Definition shader.h:175
@ DSTBLEND_ONE_MINUS_SRC_ALPHA
Definition shader.h:177
@ DSTBLEND_SRC_COLOR
Definition shader.h:174
@ DSTBLEND_ONE
Definition shader.h:173
@ DSTBLEND_SRC_ALPHA
Definition shader.h:176
static ShaderClass _PresetOpaqueSolidShader
Definition shader.h:407
void Set_Secondary_Gradient(SecGradientType x)
Definition shader.h:333
ShaderShiftConstants
Definition shader.h:59
@ SHIFT_DEPTHCOMPARE
Definition shader.h:60
@ SHIFT_PRIGRADIENT
Definition shader.h:65
@ SHIFT_CULLMODE
Definition shader.h:71
@ SHIFT_POSTDETAILCOLORFUNC
Definition shader.h:72
@ SHIFT_NPATCHENABLE
Definition shader.h:69
@ SHIFT_SRCBLEND
Definition shader.h:67
@ SHIFT_DSTBLEND
Definition shader.h:63
@ SHIFT_POSTDETAILALPHAFUNC
Definition shader.h:73
@ SHIFT_DEPTHMASK
Definition shader.h:61
@ SHIFT_TEXTURING
Definition shader.h:68
@ SHIFT_FOG
Definition shader.h:64
@ SHIFT_COLORMASK
Definition shader.h:62
@ SHIFT_SECGRADIENT
Definition shader.h:66
@ SHIFT_ALPHATEST
Definition shader.h:70