From 97e902a18a9ee124175244b599c1eee7bc535c91 Mon Sep 17 00:00:00 2001 From: SomaZ <17459161+SomaZ@users.noreply.github.com> Date: Sat, 4 May 2024 00:36:24 +0200 Subject: [PATCH] [rend2] Get rid of alphatest and glow shader permutations Those are handled via uniforms now. Less shaders to compile speeds up load times, having to switch less between glsl shaders speeds up ingame performance. Alphatest cases only commented out for now, will put these behind a cvar later, as some gpus might require to know if a discard can happen or not. [rend2] Fix sky glowing when last rendered surface had a glow stage --- code/rd-rend2/tr_draw.cpp | 3 +- shared/rd-rend2/glsl/generic.glsl | 9 ++--- shared/rd-rend2/glsl/lightall.glsl | 11 +----- shared/rd-rend2/glsl/surface_sprites.glsl | 6 +-- shared/rd-rend2/tr_glsl.cpp | 40 ++++++++++---------- shared/rd-rend2/tr_local.h | 46 +++++++++++------------ shared/rd-rend2/tr_shade.cpp | 29 ++++++++------ shared/rd-rend2/tr_shader.cpp | 8 ++-- shared/rd-rend2/tr_sky.cpp | 2 + shared/rd-rend2/tr_surface.cpp | 4 +- 10 files changed, 80 insertions(+), 78 deletions(-) diff --git a/code/rd-rend2/tr_draw.cpp b/code/rd-rend2/tr_draw.cpp index 67c42b3c7e..89f40b813b 100644 --- a/code/rd-rend2/tr_draw.cpp +++ b/code/rd-rend2/tr_draw.cpp @@ -285,7 +285,8 @@ static void RE_Blit(float fX0, float fY0, float fX1, float fY1, float fX2, float GL_Cull(CT_TWO_SIDED); GL_BindToTMU(pImage, TB_COLORMAP); - shaderProgram_t *shaderProgram = atest ? &tr.genericShader[GENERICDEF_USE_ALPHA_TEST] : &tr.genericShader[0]; + //shaderProgram_t *shaderProgram = atest ? &tr.genericShader[GENERICDEF_USE_ALPHA_TEST] : &tr.genericShader[0]; + shaderProgram_t *shaderProgram = &tr.genericShader[0]; GLSL_BindProgram(shaderProgram); RB_BindUniformBlock(tr.staticUbo, UNIFORM_BLOCK_CAMERA, tr.camera2DUboOffset); diff --git a/shared/rd-rend2/glsl/generic.glsl b/shared/rd-rend2/glsl/generic.glsl index 3a2dcc8165..ba3b9a7a63 100644 --- a/shared/rd-rend2/glsl/generic.glsl +++ b/shared/rd-rend2/glsl/generic.glsl @@ -523,6 +523,8 @@ uniform sampler2D u_DiffuseMap; uniform int u_AlphaTestType; #endif uniform int u_FogIndex; +// x = glow out, y = deluxe, z = screen shadow, w = cube +uniform vec4 u_EnableTextures; in vec2 var_DiffuseTex; in vec4 var_Color; @@ -599,10 +601,5 @@ void main() #endif out_Color = vec4(color.rgb * var_Color.rgb, color.a); - -#if defined(USE_GLOW_BUFFER) - out_Glow = out_Color; -#else - out_Glow = vec4(0.0); -#endif + out_Glow = mix(vec4(0.0, 0.0, 0.0, out_Color.a), out_Color, u_EnableTextures.x); } diff --git a/shared/rd-rend2/glsl/lightall.glsl b/shared/rd-rend2/glsl/lightall.glsl index 01d9163bb7..05752f2565 100644 --- a/shared/rd-rend2/glsl/lightall.glsl +++ b/shared/rd-rend2/glsl/lightall.glsl @@ -427,10 +427,8 @@ uniform samplerCube u_CubeMap; uniform sampler2D u_EnvBrdfMap; #endif -#if defined(USE_NORMALMAP) || defined(USE_DELUXEMAP) || defined(USE_SPECULARMAP) || defined(USE_CUBEMAP) -// y = deluxe, w = cube +// x = glow out, y = deluxe, z = screen shadow, w = cube uniform vec4 u_EnableTextures; -#endif uniform vec4 u_NormalScale; uniform vec4 u_SpecularScale; @@ -1195,10 +1193,5 @@ void main() #endif out_Color.a = diffuse.a; - -#if defined(USE_GLOW_BUFFER) - out_Glow = out_Color; -#else - out_Glow = vec4(0.0, 0.0, 0.0, out_Color.a); -#endif + out_Glow = mix(vec4(0.0, 0.0, 0.0, out_Color.a), out_Color, u_EnableTextures.x); } diff --git a/shared/rd-rend2/glsl/surface_sprites.glsl b/shared/rd-rend2/glsl/surface_sprites.glsl index 653a7aec77..5f5eb76b5a 100644 --- a/shared/rd-rend2/glsl/surface_sprites.glsl +++ b/shared/rd-rend2/glsl/surface_sprites.glsl @@ -183,7 +183,7 @@ uniform int u_FogIndex; uniform vec4 u_FogColorMask; #endif -#if defined(ALPHA_TEST) +#if defined(USE_ALPHA_TEST) uniform int u_AlphaTestType; #endif @@ -223,7 +223,7 @@ float CalcFog(in vec3 viewOrigin, in vec3 position, in Fog fog) void main() { -#if defined(ALPHA_TEST) +#if defined(USE_ALPHA_TEST) float alphaTestValue = 0.5; if (u_AlphaTestType == ALPHA_TEST_GT0) { @@ -256,7 +256,7 @@ void main() } #endif -#if defined(ALPHA_TEST) +#if defined(USE_ALPHA_TEST) if (u_AlphaTestType == ALPHA_TEST_GT0) { if (out_Color.a == 0.0) diff --git a/shared/rd-rend2/tr_glsl.cpp b/shared/rd-rend2/tr_glsl.cpp index 44ba6d03db..4f17034b50 100644 --- a/shared/rd-rend2/tr_glsl.cpp +++ b/shared/rd-rend2/tr_glsl.cpp @@ -347,6 +347,8 @@ static size_t GLSL_GetShaderHeader( ALPHA_TEST_GE128, ALPHA_TEST_GE192)); + Q_strcat(dest, size, "#define USE_ALPHA_TEST\n"); + Q_strcat(dest, size, va("#define MAX_G2_BONES %i\n", MAX_G2_BONES)); @@ -1474,11 +1476,11 @@ static int GLSL_LoadGPUProgramGeneric( if (i & GENERICDEF_USE_RGBAGEN) Q_strcat(extradefines, sizeof(extradefines), "#define USE_RGBAGEN\n"); - if (i & GENERICDEF_USE_GLOW_BUFFER) - Q_strcat(extradefines, sizeof(extradefines), "#define USE_GLOW_BUFFER\n"); + /*if (i & GENERICDEF_USE_GLOW_BUFFER) + Q_strcat(extradefines, sizeof(extradefines), "#define USE_GLOW_BUFFER\n");*/ - if (i & GENERICDEF_USE_ALPHA_TEST) - Q_strcat(extradefines, sizeof(extradefines), "#define USE_ALPHA_TEST\n"); + /*if (i & GENERICDEF_USE_ALPHA_TEST) + Q_strcat(extradefines, sizeof(extradefines), "#define USE_ALPHA_TEST\n");*/ if (!GLSL_LoadGPUShader(builder, &tr.genericShader[i], "generic", attribs, NO_XFB_VARS, extradefines, *programDesc)) @@ -1540,8 +1542,8 @@ static int GLSL_LoadGPUProgramFogPass( if (i & FOGDEF_USE_FALLBACK_GLOBAL_FOG) Q_strcat(extradefines, sizeof(extradefines), "#define USE_FALLBACK_GLOBAL_FOG\n"); - if (i & FOGDEF_USE_ALPHA_TEST) - Q_strcat(extradefines, sizeof(extradefines), "#define USE_ALPHA_TEST\n"); + /*if (i & FOGDEF_USE_ALPHA_TEST) + Q_strcat(extradefines, sizeof(extradefines), "#define USE_ALPHA_TEST\n");*/ if (!GLSL_LoadGPUShader(builder, &tr.fogShader[i], "fogpass", attribs, NO_XFB_VARS, extradefines, *programDesc)) @@ -1552,7 +1554,7 @@ static int GLSL_LoadGPUProgramFogPass( GLSL_InitUniforms(&tr.fogShader[i]); qglUseProgram(tr.fogShader[i].program); - if (i & FOGDEF_USE_ALPHA_TEST) + //if (i & FOGDEF_USE_ALPHA_TEST) GLSL_SetUniformInt(&tr.fogShader[i], UNIFORM_DIFFUSEMAP, 0); qglUseProgram(0); @@ -1603,8 +1605,8 @@ static int GLSL_LoadGPUProgramRefraction( if (i & REFRACTIONDEF_USE_RGBAGEN) Q_strcat(extradefines, sizeof(extradefines), "#define USE_RGBAGEN\n"); - if (i & REFRACTIONDEF_USE_ALPHA_TEST) - Q_strcat(extradefines, sizeof(extradefines), "#define USE_ALPHA_TEST\n"); + /*if (i & REFRACTIONDEF_USE_ALPHA_TEST) + Q_strcat(extradefines, sizeof(extradefines), "#define USE_ALPHA_TEST\n");*/ if (i & REFRACTIONDEF_USE_SRGB_TRANSFORM) Q_strcat(extradefines, sizeof(extradefines), "#define USE_LINEAR_LIGHT\n"); @@ -1769,11 +1771,11 @@ static int GLSL_LoadGPUProgramLightAll( attribs |= ATTR_BONE_INDEXES | ATTR_BONE_WEIGHTS; } - if (i & LIGHTDEF_USE_ALPHA_TEST) - Q_strcat(extradefines, sizeof(extradefines), "#define USE_ALPHA_TEST\n"); + /*if (i & LIGHTDEF_USE_ALPHA_TEST) + Q_strcat(extradefines, sizeof(extradefines), "#define USE_ALPHA_TEST\n");*/ - if (i & LIGHTDEF_USE_GLOW_BUFFER) - Q_strcat(extradefines, sizeof(extradefines), "#define USE_GLOW_BUFFER\n"); + /*if (i & LIGHTDEF_USE_GLOW_BUFFER) + Q_strcat(extradefines, sizeof(extradefines), "#define USE_GLOW_BUFFER\n");*/ if (!GLSL_LoadGPUShader(builder, &tr.lightallShader[i], "lightall", attribs, NO_XFB_VARS, extradefines, *programDesc)) @@ -2238,9 +2240,9 @@ static int GLSL_LoadGPUProgramSurfaceSprites( Q_strcat(extradefines, sizeof(extradefines), "#define USE_FOG\n"); - if ( i & SSDEF_ALPHA_TEST ) + /*if ( i & SSDEF_ALPHA_TEST ) Q_strcat(extradefines, sizeof(extradefines), - "#define ALPHA_TEST\n"); + "#define USE_ALPHA_TEST\n");*/ if (i & SSDEF_ADDITIVE) Q_strcat(extradefines, sizeof(extradefines), @@ -2584,8 +2586,8 @@ shaderProgram_t *GLSL_GetGenericShaderProgram(int stage) shaderStage_t *pStage = tess.xstages[stage]; int shaderAttribs = 0; - if ( pStage->alphaTestType != ALPHA_TEST_NONE ) - shaderAttribs |= GENERICDEF_USE_ALPHA_TEST; + /*if ( pStage->alphaTestType != ALPHA_TEST_NONE ) + shaderAttribs |= GENERICDEF_USE_ALPHA_TEST;*/ if (backEnd.currentEntity->e.renderfx & (RF_DISINTEGRATE1 | RF_DISINTEGRATE2)) shaderAttribs |= GENERICDEF_USE_RGBAGEN; @@ -2642,10 +2644,10 @@ shaderProgram_t *GLSL_GetGenericShaderProgram(int stage) shaderAttribs |= GENERICDEF_USE_TCGEN_AND_TCMOD; } - if (pStage->glow) + /*if (pStage->glow) { shaderAttribs |= GENERICDEF_USE_GLOW_BUFFER; - } + }*/ return &tr.genericShader[shaderAttribs]; } diff --git a/shared/rd-rend2/tr_local.h b/shared/rd-rend2/tr_local.h index 41c5ecca82..9b3a6a65ed 100644 --- a/shared/rd-rend2/tr_local.h +++ b/shared/rd-rend2/tr_local.h @@ -1188,13 +1188,13 @@ enum GENERICDEF_USE_FOG = 0x0004, GENERICDEF_USE_RGBAGEN = 0x0008, GENERICDEF_USE_SKELETAL_ANIMATION = 0x0010, - GENERICDEF_USE_GLOW_BUFFER = 0x0020, - GENERICDEF_USE_ALPHA_TEST = 0x0040, + // GENERICDEF_USE_GLOW_BUFFER = 0x0020, + // GENERICDEF_USE_ALPHA_TEST = 0x0040, #ifdef REND2_SP_MD3 GENERICDEF_USE_VERTEX_ANIMATION = 0x0080, GENERICDEF_ALL = 0x00FF, #else - GENERICDEF_ALL = 0x007F, + GENERICDEF_ALL = 0x001F, #endif // REND2_SP GENERICDEF_COUNT = GENERICDEF_ALL + 1, @@ -1204,13 +1204,13 @@ enum { FOGDEF_USE_DEFORM_VERTEXES = 0x0001, FOGDEF_USE_SKELETAL_ANIMATION = 0x0002, - FOGDEF_USE_ALPHA_TEST = 0x0004, - FOGDEF_USE_FALLBACK_GLOBAL_FOG = 0x0008, + //FOGDEF_USE_ALPHA_TEST = 0x0004, + FOGDEF_USE_FALLBACK_GLOBAL_FOG = 0x0004, #ifdef REND2_SP_MD3 FOGDEF_USE_VERTEX_ANIMATION = 0x0010, FOGDEF_ALL = 0x001F, #else - FOGDEF_ALL = 0x000F, + FOGDEF_ALL = 0x0007, #endif // REND2_SP FOGDEF_COUNT = FOGDEF_ALL + 1, @@ -1222,13 +1222,13 @@ enum REFRACTIONDEF_USE_TCGEN_AND_TCMOD = 0x0002, REFRACTIONDEF_USE_RGBAGEN = 0x0004, REFRACTIONDEF_USE_SKELETAL_ANIMATION = 0x0008, - REFRACTIONDEF_USE_ALPHA_TEST = 0x0010, - REFRACTIONDEF_USE_SRGB_TRANSFORM = 0x0020, + //REFRACTIONDEF_USE_ALPHA_TEST = 0x0010, + REFRACTIONDEF_USE_SRGB_TRANSFORM = 0x0010, #ifdef REND2_SP_MD3 REFRACTIONDEF_USE_VERTEX_ANIMATION = 0x0040, REFRACTIONDEF_ALL = 0x007F, #else - REFRACTIONDEF_ALL = 0x003F, + REFRACTIONDEF_ALL = 0x001F, #endif // REND2_SP REFRACTIONDEF_COUNT = REFRACTIONDEF_ALL + 1, @@ -1243,10 +1243,10 @@ enum LIGHTDEF_USE_PARALLAXMAP = 0x0008, // LIGHTDEF_USE_SHADOWMAP = 0x0010, LIGHTDEF_USE_SKELETAL_ANIMATION = 0x0010, - LIGHTDEF_USE_GLOW_BUFFER = 0x0020, - LIGHTDEF_USE_ALPHA_TEST = 0x0040, - LIGHTDEF_USE_CLOTH_BRDF = 0x0080, - LIGHTDEF_USE_SPEC_GLOSS = 0x0100, + //LIGHTDEF_USE_GLOW_BUFFER = 0x0020, + //LIGHTDEF_USE_ALPHA_TEST = 0x0040, + LIGHTDEF_USE_CLOTH_BRDF = 0x0020, + LIGHTDEF_USE_SPEC_GLOSS = 0x0040, LIGHTDEF_LIGHTTYPE_MASK = LIGHTDEF_USE_LIGHTMAP | LIGHTDEF_USE_LIGHT_VECTOR | @@ -1256,7 +1256,7 @@ enum LIGHTDEF_USE_VERTEX_ANIMATION = 0x0200, LIGHTDEF_ALL = 0x03FF, #else - LIGHTDEF_ALL = 0x01FF, + LIGHTDEF_ALL = 0x007F, #endif // REND2_SP LIGHTDEF_COUNT = LIGHTDEF_ALL + 1 @@ -1265,15 +1265,15 @@ enum enum { SSDEF_FACE_CAMERA = 0x01, - SSDEF_ALPHA_TEST = 0x02, - SSDEF_FACE_UP = 0x04, - SSDEF_FX_SPRITE = 0x08, - SSDEF_USE_FOG = 0x10, - SSDEF_FOG_MODULATE = 0x20, - SSDEF_ADDITIVE = 0x40, - SSDEF_FLATTENED = 0x80, - - SSDEF_ALL = 0xFF, + //SSDEF_ALPHA_TEST = 0x02, + SSDEF_FACE_UP = 0x02, + SSDEF_FX_SPRITE = 0x04, + SSDEF_USE_FOG = 0x08, + SSDEF_FOG_MODULATE = 0x10, + SSDEF_ADDITIVE = 0x20, + SSDEF_FLATTENED = 0x40, + + SSDEF_ALL = 0x7F, SSDEF_COUNT = SSDEF_ALL + 1 }; diff --git a/shared/rd-rend2/tr_shade.cpp b/shared/rd-rend2/tr_shade.cpp index 65d6dffa61..c694dc56e5 100644 --- a/shared/rd-rend2/tr_shade.cpp +++ b/shared/rd-rend2/tr_shade.cpp @@ -1058,9 +1058,9 @@ static void RB_FogPass( shaderCommands_t *input, const VertexArraysProperties *v input->shader->sort != SS_FOG) shaderBits |= FOGDEF_USE_FALLBACK_GLOBAL_FOG; - if (input->numPasses > 0) + /*if (input->numPasses > 0) if (input->xstages[0]->alphaTestType != ALPHA_TEST_NONE) - shaderBits |= FOGDEF_USE_ALPHA_TEST; + shaderBits |= FOGDEF_USE_ALPHA_TEST;*/ shaderProgram_t *sp = tr.fogShader + shaderBits; @@ -1210,7 +1210,7 @@ static shaderProgram_t *SelectShaderProgram( int stageIndex, shaderStage_t *stag if (stage->bundle[0].tcGen != TCGEN_TEXTURE || (stage->bundle[0].numTexMods)) index |= REFRACTIONDEF_USE_TCGEN_AND_TCMOD; - if (!useAlphaTestGE192) + /*if (!useAlphaTestGE192) { if (stage->alphaTestType != ALPHA_TEST_NONE) index |= REFRACTIONDEF_USE_TCGEN_AND_TCMOD | REFRACTIONDEF_USE_ALPHA_TEST; @@ -1218,7 +1218,7 @@ static shaderProgram_t *SelectShaderProgram( int stageIndex, shaderStage_t *stag else { index |= REFRACTIONDEF_USE_ALPHA_TEST; - } + }*/ if (tr.hdrLighting == qtrue) index |= REFRACTIONDEF_USE_SRGB_TRANSFORM; @@ -1247,7 +1247,7 @@ static shaderProgram_t *SelectShaderProgram( int stageIndex, shaderStage_t *stag } } - if ( !useAlphaTestGE192 ) + /*if ( !useAlphaTestGE192 ) { if (stage->alphaTestType != ALPHA_TEST_NONE) index |= LIGHTDEF_USE_ALPHA_TEST; @@ -1255,7 +1255,7 @@ static shaderProgram_t *SelectShaderProgram( int stageIndex, shaderStage_t *stag else { index |= LIGHTDEF_USE_ALPHA_TEST; - } + }*/ // TODO: remove light vertex def and fix parallax usage on unlit stages like glow stages if (stage->glslShaderIndex & LIGHTDEF_USE_PARALLAXMAP && @@ -1285,7 +1285,7 @@ static shaderProgram_t *SelectShaderProgram( int stageIndex, shaderStage_t *stag index |= GENERICDEF_USE_SKELETAL_ANIMATION; } - if ( !useAlphaTestGE192 ) + /*if ( !useAlphaTestGE192 ) { if (stage->alphaTestType != ALPHA_TEST_NONE) index |= GENERICDEF_USE_TCGEN_AND_TCMOD | GENERICDEF_USE_ALPHA_TEST; @@ -1293,7 +1293,7 @@ static shaderProgram_t *SelectShaderProgram( int stageIndex, shaderStage_t *stag else { index |= GENERICDEF_USE_ALPHA_TEST; - } + }*/ if (backEnd.currentEntity->e.renderfx & (RF_DISINTEGRATE1 | RF_DISINTEGRATE2)) index |= GENERICDEF_USE_RGBAGEN; @@ -1329,7 +1329,7 @@ static shaderProgram_t *SelectShaderProgram( int stageIndex, shaderStage_t *stag } } - if ( !useAlphaTestGE192 ) + /*if ( !useAlphaTestGE192 ) { if (stage->alphaTestType != ALPHA_TEST_NONE) index |= LIGHTDEF_USE_TCGEN_AND_TCMOD | LIGHTDEF_USE_ALPHA_TEST; @@ -1337,7 +1337,7 @@ static shaderProgram_t *SelectShaderProgram( int stageIndex, shaderStage_t *stag else { index |= LIGHTDEF_USE_ALPHA_TEST; - } + }*/ } result = &stage->glslShaderGroup[index]; @@ -1710,6 +1710,7 @@ static void RB_IterateStagesGeneric( shaderCommands_t *input, const VertexArrays { int i; vec4_t enableTextures = {}; + enableTextures[0] = (float)pStage->glow; if (r_sunlightMode->integer && (backEnd.viewParms.flags & VPF_USESUNLIGHT) && @@ -1769,7 +1770,6 @@ static void RB_IterateStagesGeneric( shaderCommands_t *input, const VertexArrays if (pStage->bundle[TB_NORMALMAP].image[0]) { samplerBindingsWriter.AddAnimatedImage(&pStage->bundle[TB_NORMALMAP], TB_NORMALMAP); - enableTextures[0] = 1.0f; } else if (r_normalMapping->integer) { @@ -1814,6 +1814,10 @@ static void RB_IterateStagesGeneric( shaderCommands_t *input, const VertexArrays { samplerBindingsWriter.AddAnimatedImage(&pStage->bundle[0], 0); samplerBindingsWriter.AddAnimatedImage(&pStage->bundle[1], 1); + + vec4_t enableTextures = {}; + enableTextures[0] = (float)pStage->glow; + uniformDataWriter.SetUniformVec4(UNIFORM_ENABLETEXTURES, enableTextures); } else { @@ -1821,6 +1825,9 @@ static void RB_IterateStagesGeneric( shaderCommands_t *input, const VertexArrays // set state // samplerBindingsWriter.AddAnimatedImage(&pStage->bundle[0], 0); + vec4_t enableTextures = {}; + enableTextures[0] = (float)pStage->glow; + uniformDataWriter.SetUniformVec4(UNIFORM_ENABLETEXTURES, enableTextures); } // diff --git a/shared/rd-rend2/tr_shader.cpp b/shared/rd-rend2/tr_shader.cpp index cce8e5dd61..6991eef201 100644 --- a/shared/rd-rend2/tr_shader.cpp +++ b/shared/rd-rend2/tr_shader.cpp @@ -3235,14 +3235,14 @@ static void CollapseStagesToLightall(shaderStage_t *stage, shaderStage_t *lightm defs |= LIGHTDEF_USE_TCGEN_AND_TCMOD; } - if (stage->glow) - defs |= LIGHTDEF_USE_GLOW_BUFFER; + /*if (stage->glow) + defs |= LIGHTDEF_USE_GLOW_BUFFER;*/ if (stage->cloth) defs |= LIGHTDEF_USE_CLOTH_BRDF; - if (stage->alphaTestType != ALPHA_TEST_NONE) - defs |= LIGHTDEF_USE_ALPHA_TEST; + /*if (stage->alphaTestType != ALPHA_TEST_NONE) + defs |= LIGHTDEF_USE_ALPHA_TEST;*/ //ri.Printf(PRINT_ALL, ".\n"); diff --git a/shared/rd-rend2/tr_sky.cpp b/shared/rd-rend2/tr_sky.cpp index 30011a3934..26f80c08a5 100644 --- a/shared/rd-rend2/tr_sky.cpp +++ b/shared/rd-rend2/tr_sky.cpp @@ -451,6 +451,8 @@ static void DrawSkySide( struct image_s *image, const int mins[2], const int max UNIFORM_DIFFUSETEXMATRIX, 1.0f, 0.0f, 0.0f, 1.0f); uniformDataWriter.SetUniformVec4( UNIFORM_DIFFUSETEXOFFTURB, 0.0f, 0.0f, 0.0f, 0.0f); + uniformDataWriter.SetUniformVec4( + UNIFORM_ENABLETEXTURES, 0.0f, 0.0f, 0.0f, 0.0f); samplerBindingsWriter.AddStaticImage(image, TB_DIFFUSEMAP); diff --git a/shared/rd-rend2/tr_surface.cpp b/shared/rd-rend2/tr_surface.cpp index ad6dfdef96..a8ab779abd 100644 --- a/shared/rd-rend2/tr_surface.cpp +++ b/shared/rd-rend2/tr_surface.cpp @@ -2590,8 +2590,8 @@ static void RB_SurfaceSprites( srfSprites_t *surf ) const surfaceSprite_t *ss = surf->sprite; uint32_t shaderFlags = 0; - if ( surf->alphaTestType != ALPHA_TEST_NONE ) - shaderFlags |= SSDEF_ALPHA_TEST; + /*if ( surf->alphaTestType != ALPHA_TEST_NONE ) + shaderFlags |= SSDEF_ALPHA_TEST;*/ if ( ss->type == SURFSPRITE_ORIENTED ) shaderFlags |= SSDEF_FACE_CAMERA;