From f762bb1c71744d5fee971bc1f6c37e02a9b952b7 Mon Sep 17 00:00:00 2001 From: "divverent divverent@d7cf8633-e32d-0410-b094-e92efae38249" <> Date: Sun, 25 Jul 2010 14:56:25 +0000 Subject: [PATCH] UNMERGE fix a nasty bug in refraction/water renders. It is evil that GL20TU_FIRST must be matching, out of all texture units, the one of normalmaps. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10361 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::unmerge=a36bfc88b5c627a1f2aa17a53df482a20c5e76f0 --- gl_rmain.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index 7bde8905..035ca0c5 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -5832,8 +5832,8 @@ void R_SetupShader_Surface(const vec3_t lightcolorbase, qboolean modellighting, if (rsurfacepass == RSURFPASS_BACKGROUND) { R_Mesh_TexBind(GL20TU_REFRACTION , waterplane->texture_refraction ? waterplane->texture_refraction : r_texture_black); - if(mode == SHADERMODE_GENERIC) R_Mesh_TexBind(GL20TU_FIRST , waterplane->texture_camera ? waterplane->texture_camera : r_texture_black); R_Mesh_TexBind(GL20TU_REFLECTION , waterplane->texture_reflection ? waterplane->texture_reflection : r_texture_black); + R_Mesh_TexBind(GL20TU_FIRST , waterplane->texture_camera ? waterplane->texture_camera : r_texture_black); } else { @@ -5987,9 +5987,9 @@ void R_SetupShader_Surface(const vec3_t lightcolorbase, qboolean modellighting, if (r_glsl_permutation->loc_Texture_Attenuation >= 0) R_Mesh_TexBind(GL20TU_ATTENUATION , r_shadow_attenuationgradienttexture ); if (rsurfacepass == RSURFPASS_BACKGROUND) { - if(r_glsl_permutation->loc_Texture_Refraction >= 0) R_Mesh_TexBind(GL20TU_REFRACTION , waterplane->texture_refraction ? waterplane->texture_refraction : r_texture_black); - else if(r_glsl_permutation->loc_Texture_First >= 0) R_Mesh_TexBind(GL20TU_FIRST , waterplane->texture_camera ? waterplane->texture_camera : r_texture_black); - if(r_glsl_permutation->loc_Texture_Reflection >= 0) R_Mesh_TexBind(GL20TU_REFLECTION , waterplane->texture_reflection ? waterplane->texture_reflection : r_texture_black); + R_Mesh_TexBind(GL20TU_REFRACTION , waterplane->texture_refraction ? waterplane->texture_refraction : r_texture_black); + R_Mesh_TexBind(GL20TU_REFLECTION , waterplane->texture_reflection ? waterplane->texture_reflection : r_texture_black); + R_Mesh_TexBind(GL20TU_FIRST , waterplane->texture_camera ? waterplane->texture_camera : r_texture_black); } else { @@ -6158,8 +6158,8 @@ void R_SetupShader_Surface(const vec3_t lightcolorbase, qboolean modellighting, if (rsurfacepass == RSURFPASS_BACKGROUND) { if (r_cg_permutation->fp_Texture_Refraction ) CG_BindTexture(r_cg_permutation->fp_Texture_Refraction , waterplane->texture_refraction ? waterplane->texture_refraction : r_texture_black);CHECKCGERROR - else if (r_cg_permutation->fp_Texture_First ) CG_BindTexture(r_cg_permutation->fp_Texture_First , waterplane->texture_camera ? waterplane->texture_camera : r_texture_black);CHECKCGERROR if (r_cg_permutation->fp_Texture_Reflection ) CG_BindTexture(r_cg_permutation->fp_Texture_Reflection , waterplane->texture_reflection ? waterplane->texture_reflection : r_texture_black);CHECKCGERROR + if (r_cg_permutation->fp_Texture_First ) CG_BindTexture(r_cg_permutation->fp_Texture_First , waterplane->texture_camera ? waterplane->texture_camera : r_texture_black);CHECKCGERROR } else { -- 2.39.2