OpenGL2: Fix applying tcMod turb

Shader stage tcMods for matrix and turb effects need to be applied in
order for turb to be correct and all tcMod turb need to be applied
instead of only the last one.

Quake 3's textures/liquids/slime1 had tcMod turb and then tcMod scale.
OpenGL2 applied the matrix first and then turb which had the wrong result.
This commit is contained in:
Zack Middleton committed 2024-01-18 03:16:39 -05:00
1 parent 5ede35d8dd
commit 93abc60a5b
6 files changed
+190 -77

No files matched your search

+11 -6
View File
@@ -435,7 +435,7 @@ static void DrawSkySide( struct image_s *image, const int mins[2], const int max
*/
{
shaderProgram_t *sp = &tr.lightallShader[0];
vec4_t vector;
vec4_t st[2];
GLSL_BindProgram(sp);
@@ -453,11 +453,16 @@ static void DrawSkySide( struct image_s *image, const int mins[2], const int max
color[3] = 0.0f;
GLSL_SetUniformVec4(sp, UNIFORM_VERTCOLOR, color);
VectorSet4(vector, 1.0, 0.0, 0.0, 1.0);
GLSL_SetUniformVec4(sp, UNIFORM_DIFFUSETEXMATRIX, vector);
VectorSet4(vector, 0.0, 0.0, 0.0, 0.0);
GLSL_SetUniformVec4(sp, UNIFORM_DIFFUSETEXOFFTURB, vector);
VectorSet4(st[0], 1.0f, 0.0f, 0.0f, 0.0f);
VectorSet4(st[1], 0.0f, 1.0f, 0.0f, 0.0f);
GLSL_SetUniformVec4(sp, UNIFORM_DIFFUSETEXMATRIX0, st[0]);
GLSL_SetUniformVec4(sp, UNIFORM_DIFFUSETEXMATRIX1, st[1]);
GLSL_SetUniformVec4(sp, UNIFORM_DIFFUSETEXMATRIX2, st[0]);
GLSL_SetUniformVec4(sp, UNIFORM_DIFFUSETEXMATRIX3, st[1]);
GLSL_SetUniformVec4(sp, UNIFORM_DIFFUSETEXMATRIX4, st[0]);
GLSL_SetUniformVec4(sp, UNIFORM_DIFFUSETEXMATRIX5, st[1]);
GLSL_SetUniformVec4(sp, UNIFORM_DIFFUSETEXMATRIX6, st[0]);
GLSL_SetUniformVec4(sp, UNIFORM_DIFFUSETEXMATRIX7, st[1]);
GLSL_SetUniformInt(sp, UNIFORM_ALPHATEST, 0);
}