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-17 19:28:32 +0400
committerTon Roosendaal <ton@blender.org>2006-09-17 19:28:32 +0400
commitb50a32ce9d86db2b1c0a4df36010d6146e24ee3d (patch)
treedc23333729747607855a6ccb6ff2831c1f90f259 /source
parent0d4f5335bf7ea1b8548ba8a30c4a5fa909729b18 (diff)
Bugfix #4999
The Sky render option "Ang Map", which should support spherical probes, was always in local camera view space, instead of world space. Check this report, it has cool images! http://projects.blender.org/tracker/index.php?func=detail&aid=4999&group_id=9&atid=125
Diffstat (limited to 'source')
-rw-r--r--source/blender/render/intern/source/texture.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c
index fdd1ce274df..146e8daafe7 100644
--- a/source/blender/render/intern/source/texture.c
+++ b/source/blender/render/intern/source/texture.c
@@ -2083,12 +2083,16 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f
/* Grab the mapping settings for this texture */
switch(mtex->texco) {
case TEXCO_ANGMAP:
-
- fact= (1.0/M_PI)*acos(lo[2])/(sqrt(lo[0]*lo[0] + lo[1]*lo[1]));
- tempvec[0]= lo[0]*fact;
- tempvec[1]= lo[1]*fact;
- tempvec[2]= 0.0;
+ /* move view vector to global world space */
+ VECCOPY(tempvec, lo);
+ Mat4Mul3Vecfl(R.viewinv, tempvec);
co= tempvec;
+
+ /* note, this converion assumes 'sphere probes' are front view */
+ fact= (1.0f/M_PI)*acos(co[1])/(sqrt(co[0]*co[0] + co[2]*co[2]));
+ co[0]= co[0]*fact;
+ co[1]= co[2]*fact;
+ co[2]= 0.0f;
break;
case TEXCO_H_SPHEREMAP: