Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2006-09-18 16:53:52 +0400
committerTon Roosendaal <ton@blender.org>2006-09-18 16:53:52 +0400
commit8e7e7e209a76e2848690cd722a0cbd0137f79930 (patch)
tree20a96a7346a75256b0999337a9600541837e3a53 /source
parenta36377abd9951504f21b39b42d86c90e2f47cb55 (diff)
Bugfix #4999 part 2
Sky texture mapping option "Sphere" or "Tube" map now correctly maps to world space as well, so a camera orientation or mirroring works fine.
Diffstat (limited to 'source')
-rw-r--r--source/blender/render/intern/source/texture.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c
index 146e8daafe7..fb41ba837d9 100644
--- a/source/blender/render/intern/source/texture.c
+++ b/source/blender/render/intern/source/texture.c
@@ -2098,8 +2098,12 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f
case TEXCO_H_SPHEREMAP:
case TEXCO_H_TUBEMAP:
if(skyflag & WO_ZENUP) {
- if(mtex->texco==TEXCO_H_TUBEMAP) tubemap(lo[0], lo[2], lo[1], tempvec, tempvec+1);
- else spheremap(lo[0], lo[2], lo[1], tempvec, tempvec+1);
+ /* move view vector to global world space */
+ VECCOPY(tempvec, lo);
+ Mat4Mul3Vecfl(R.viewinv, tempvec);
+
+ if(mtex->texco==TEXCO_H_TUBEMAP) tubemap(tempvec[0], tempvec[1], tempvec[2], tempvec, tempvec+1);
+ else spheremap(tempvec[0], tempvec[1], tempvec[2], tempvec, tempvec+1);
/* tube/spheremap maps for outside view, not inside */
tempvec[0]= 1.0-tempvec[0];
/* only top half */