From c6bbe25c291b7729637871f6ddc1f4415b107763 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 16 Nov 2011 15:47:25 +0000 Subject: [PATCH] Fix #29093: world zenith up and down texture influence were not working correct. These were decoupled from horizon influence for 2.5, but not actually used in the render engine. --- .../render/intern/source/render_texture.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c index bd323a5b2d3..323f04cbd04 100644 --- a/source/blender/render/intern/source/render_texture.c +++ b/source/blender/render/intern/source/render_texture.c @@ -3007,7 +3007,7 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL}; float *co, fact, stencilTin=1.0; float tempvec[3], texvec[3], dxt[3], dyt[3]; - int tex_nr, rgb= 0, ok; + int tex_nr, rgb= 0; if (R.r.scemode & R_NO_TEX) return; /* todo: add flag to test if there's a tex */ @@ -3171,18 +3171,21 @@ void do_sky_tex(const float rco[3], float lo[3], const float dxyview[2], float h texture_rgb_blend(hor, tcol, hor, texres.tin, mtex->colfac, mtex->blendtype); } if(mtex->mapto & (WOMAP_ZENUP+WOMAP_ZENDOWN)) { - ok= 0; + float zenfac = 0.0f; + if(R.wrld.skytype & WO_SKYREAL) { if((skyflag & WO_ZENUP)) { - if(mtex->mapto & WOMAP_ZENUP) ok= 1; + if(mtex->mapto & WOMAP_ZENUP) zenfac= mtex->zenupfac; } - else if(mtex->mapto & WOMAP_ZENDOWN) ok= 1; + else if(mtex->mapto & WOMAP_ZENDOWN) zenfac= mtex->zendownfac; + } + else { + if(mtex->mapto & WOMAP_ZENUP) zenfac= mtex->zenupfac; + else if(mtex->mapto & WOMAP_ZENDOWN) zenfac= mtex->zendownfac; } - else ok= 1; - if(ok) { - texture_rgb_blend(zen, tcol, zen, texres.tin, mtex->colfac, mtex->blendtype); - } + if(zenfac != 0.0f) + texture_rgb_blend(zen, tcol, zen, texres.tin, zenfac, mtex->blendtype); } } if(mtex->mapto & WOMAP_BLEND) {