@@ -3051,7 +3051,7 @@ class u_Color_Float :
30513051 {
30523052 }
30533053
3054- void SetUniform_Color ( const Color::Color& color )
3054+ void SetUniform_Color_Float ( const Color::Color& color )
30553055 {
30563056 this ->SetValue ( color.ToArray () );
30573057 }
@@ -3066,12 +3066,24 @@ class u_Color_Uint :
30663066 {
30673067 }
30683068
3069- void SetUniform_Color ( const Color::Color& color )
3069+ void SetUniform_Color_Uint ( const Color::Color& color )
30703070 {
30713071 this ->SetValue ( packUnorm4x8 ( color.ToArray () ) );
30723072 }
30733073};
30743074
3075+ template <typename Shader> void SetUniform_Color ( Shader* shader, const Color::Color& color )
3076+ {
3077+ if ( glConfig2.gpuShader4Available )
3078+ {
3079+ shader->SetUniform_Color_Uint ( color );
3080+ }
3081+ else
3082+ {
3083+ shader->SetUniform_Color_Float ( color );
3084+ }
3085+ }
3086+
30753087class u_ColorGlobal_Float :
30763088 GLUniform4f
30773089{
@@ -3081,7 +3093,7 @@ class u_ColorGlobal_Float :
30813093 {
30823094 }
30833095
3084- void SetUniform_ColorGlobal ( const Color::Color& color )
3096+ void SetUniform_ColorGlobal_Float ( const Color::Color& color )
30853097 {
30863098 this ->SetValue ( color.ToArray () );
30873099 }
@@ -3094,11 +3106,23 @@ class u_ColorGlobal_Uint :
30943106 GLUniform1ui ( shader, " u_ColorGlobal" , true ) {
30953107 }
30963108
3097- void SetUniform_ColorGlobal ( const Color::Color& color ) {
3109+ void SetUniform_ColorGlobal_Uint ( const Color::Color& color ) {
30983110 this ->SetValue ( packUnorm4x8 ( color.ToArray () ) );
30993111 }
31003112};
31013113
3114+ template <typename Shader> void SetUniform_ColorGlobal ( Shader* shader, const Color::Color& color )
3115+ {
3116+ if ( glConfig2.gpuShader4Available )
3117+ {
3118+ shader->SetUniform_ColorGlobal_Uint ( color );
3119+ }
3120+ else
3121+ {
3122+ shader->SetUniform_ColorGlobal_Float ( color );
3123+ }
3124+ }
3125+
31023126class u_Frame :
31033127 GLUniform1ui {
31043128 public:
@@ -3668,7 +3692,7 @@ class u_ColorModulateColorGen_Float :
36683692 {
36693693 }
36703694
3671- void SetUniform_ColorModulateColorGen (
3695+ void SetUniform_ColorModulateColorGen_Float (
36723696 const colorGen_t colorGen,
36733697 const alphaGen_t alphaGen,
36743698 const bool vertexOverbright = false ,
@@ -3703,7 +3727,7 @@ class u_ColorModulateColorGen_Uint :
37033727 GLUniform1ui ( shader, " u_ColorModulateColorGen" ) {
37043728 }
37053729
3706- void SetUniform_ColorModulateColorGen (
3730+ void SetUniform_ColorModulateColorGen_Uint (
37073731 const colorGen_t colorGen,
37083732 const alphaGen_t alphaGen,
37093733 const bool vertexOverbright = false ,
@@ -3756,6 +3780,23 @@ class u_ColorModulateColorGen_Uint :
37563780 }
37573781};
37583782
3783+ template <typename Shader> void SetUniform_ColorModulateColorGen (
3784+ Shader* shader,
3785+ const colorGen_t colorGen,
3786+ const alphaGen_t alphaGen,
3787+ const bool vertexOverbright = false ,
3788+ const bool useMapLightFactor = false )
3789+ {
3790+ if ( glConfig2.gpuShader4Available )
3791+ {
3792+ shader->SetUniform_ColorModulateColorGen_Uint ( colorGen, alphaGen, vertexOverbright, useMapLightFactor );
3793+ }
3794+ else
3795+ {
3796+ shader->SetUniform_ColorModulateColorGen_Float ( colorGen, alphaGen, vertexOverbright, useMapLightFactor );
3797+ }
3798+ }
3799+
37593800class u_FogDistanceVector :
37603801 GLUniform4f
37613802{
@@ -4054,7 +4095,9 @@ class GLShader_generic :
40544095 public u_ModelMatrix,
40554096 public u_ModelViewProjectionMatrix,
40564097 public u_ColorModulateColorGen_Float,
4098+ public u_ColorModulateColorGen_Uint,
40574099 public u_Color_Float,
4100+ public u_Color_Uint,
40584101 public u_Bones,
40594102 public u_VertexInterpolation,
40604103 public u_DepthScale,
@@ -4115,7 +4158,9 @@ class GLShader_lightMapping :
41154158 public u_TextureMatrix,
41164159 public u_SpecularExponent,
41174160 public u_ColorModulateColorGen_Float,
4161+ public u_ColorModulateColorGen_Uint,
41184162 public u_Color_Float,
4163+ public u_Color_Uint,
41194164 public u_AlphaThreshold,
41204165 public u_ViewOrigin,
41214166 public u_ModelMatrix,
@@ -4212,7 +4257,9 @@ class GLShader_forwardLighting_omniXYZ :
42124257 public u_SpecularExponent,
42134258 public u_AlphaThreshold,
42144259 public u_ColorModulateColorGen_Float,
4260+ public u_ColorModulateColorGen_Uint,
42154261 public u_Color_Float,
4262+ public u_Color_Uint,
42164263 public u_ViewOrigin,
42174264 public u_LightOrigin,
42184265 public u_LightColor,
@@ -4255,7 +4302,9 @@ class GLShader_forwardLighting_projXYZ :
42554302 public u_SpecularExponent,
42564303 public u_AlphaThreshold,
42574304 public u_ColorModulateColorGen_Float,
4305+ public u_ColorModulateColorGen_Uint,
42584306 public u_Color_Float,
4307+ public u_Color_Uint,
42594308 public u_ViewOrigin,
42604309 public u_LightOrigin,
42614310 public u_LightColor,
@@ -4305,7 +4354,9 @@ class GLShader_forwardLighting_directionalSun :
43054354 public u_SpecularExponent,
43064355 public u_AlphaThreshold,
43074356 public u_ColorModulateColorGen_Float,
4357+ public u_ColorModulateColorGen_Uint,
43084358 public u_Color_Float,
4359+ public u_Color_Uint,
43094360 public u_ViewOrigin,
43104361 public u_LightDir,
43114362 public u_LightColor,
@@ -4347,6 +4398,7 @@ class GLShader_shadowFill :
43474398 public u_ModelMatrix,
43484399 public u_ModelViewProjectionMatrix,
43494400 public u_Color_Float,
4401+ public u_Color_Uint,
43504402 public u_Bones,
43514403 public u_VertexInterpolation,
43524404 public GLDeformStage,
@@ -4441,6 +4493,7 @@ class GLShader_fogQuake3 :
44414493 public u_ModelMatrix,
44424494 public u_ModelViewProjectionMatrix,
44434495 public u_ColorGlobal_Float,
4496+ public u_ColorGlobal_Uint,
44444497 public u_Bones,
44454498 public u_VertexInterpolation,
44464499 public u_FogDistanceVector,
@@ -4460,7 +4513,7 @@ class GLShader_fogQuake3Material :
44604513 public u_FogMap,
44614514 public u_ModelMatrix,
44624515 public u_ModelViewProjectionMatrix,
4463- public u_ColorGlobal_Float ,
4516+ public u_ColorGlobal_Uint ,
44644517 public u_FogDistanceVector,
44654518 public u_FogDepthVector,
44664519 public u_FogEyeT,
@@ -4477,6 +4530,7 @@ class GLShader_fogGlobal :
44774530 public u_ModelViewProjectionMatrix,
44784531 public u_UnprojectMatrix,
44794532 public u_Color_Float,
4533+ public u_Color_Uint,
44804534 public u_FogDistanceVector
44814535{
44824536public:
0 commit comments