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-07-02 11:59:42 +0400
committerTon Roosendaal <ton@blender.org>2006-07-02 11:59:42 +0400
commit0cbb917e6083ca7b9ffddfd3b3fa5ce61c3a20c0 (patch)
treee8cb68ad933b3b6214a0f7d72ae212d4106888e4 /source
parent577494dc05241df82099e55aa73b9e4390e54a6b (diff)
Bugfix #4558
Thread render error: a flag was stored in read-only data to indicate whether top or bottom hemisphere of sky was rendered. That can't work with tiles (but did work when scanlines were threads).
Diffstat (limited to 'source')
-rw-r--r--source/blender/render/intern/include/texture.h2
-rw-r--r--source/blender/render/intern/source/pixelshading.c10
-rw-r--r--source/blender/render/intern/source/texture.c6
3 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/render/intern/include/texture.h b/source/blender/render/intern/include/texture.h
index 59c842559f4..13ab6f7cd67 100644
--- a/source/blender/render/intern/include/texture.h
+++ b/source/blender/render/intern/include/texture.h
@@ -55,7 +55,7 @@ struct Image;
/* texture.h */
void do_halo_tex(struct HaloRen *har, float xn, float yn, float *colf);
-void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, float *blend);
+void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, float *blend, int skyflag);
void do_material_tex(struct ShadeInput *shi);
void do_lamp_tex(LampRen *la, float *lavec, struct ShadeInput *shi, float *colf);
diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c
index 9dff90dda0c..fbd7d4ee04d 100644
--- a/source/blender/render/intern/source/pixelshading.c
+++ b/source/blender/render/intern/source/pixelshading.c
@@ -551,16 +551,18 @@ void shadeSkyPixel(float *collector, float fx, float fy, float *rco)
void shadeSkyPixelFloat(float *colf, float *rco, float *view, float *dxyview)
{
float lo[3], zen[3], hor[3], blend, blendm;
+ int skyflag;
- /* Why is this setting forced? Seems silly to me. It is tested in the texture unit. */
- R.wrld.skytype |= WO_ZENUP;
+ /* flag indicating if we render the top hemisphere */
+ skyflag = WO_ZENUP;
/* Some view vector stuff. */
if(R.wrld.skytype & WO_SKYREAL) {
blend= view[0]*R.grvec[0]+ view[1]*R.grvec[1]+ view[2]*R.grvec[2];
- if(blend<0.0) R.wrld.skytype-= WO_ZENUP;
+ if(blend<0.0) skyflag= 0;
+
blend= fabs(blend);
}
else if(R.wrld.skytype & WO_SKYPAPER) {
@@ -585,7 +587,7 @@ void shadeSkyPixelFloat(float *colf, float *rco, float *view, float *dxyview)
SWAP(float, lo[1], lo[2]);
}
- do_sky_tex(rco, lo, dxyview, hor, zen, &blend);
+ do_sky_tex(rco, lo, dxyview, hor, zen, &blend, skyflag);
}
if(blend>1.0) blend= 1.0;
diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c
index 46001855b2a..dd6092d4a1b 100644
--- a/source/blender/render/intern/source/texture.c
+++ b/source/blender/render/intern/source/texture.c
@@ -2024,7 +2024,7 @@ void do_halo_tex(HaloRen *har, float xn, float yn, float *colf)
/* ------------------------------------------------------------------------- */
/* hor and zen are RGB vectors, blend is 1 float, should all be initialized */
-void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, float *blend)
+void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, float *blend, int skyflag)
{
MTex *mtex;
TexResult texres;
@@ -2068,7 +2068,7 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f
case TEXCO_H_SPHEREMAP:
case TEXCO_H_TUBEMAP:
- if(R.wrld.skytype & WO_ZENUP) {
+ 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);
/* tube/spheremap maps for outside view, not inside */
@@ -2174,7 +2174,7 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f
if(mtex->mapto & (WOMAP_ZENUP+WOMAP_ZENDOWN)) {
ok= 0;
if(R.wrld.skytype & WO_SKYREAL) {
- if((R.wrld.skytype & WO_ZENUP)) {
+ if((skyflag & WO_ZENUP)) {
if(mtex->mapto & WOMAP_ZENUP) ok= 1;
}
else if(mtex->mapto & WOMAP_ZENDOWN) ok= 1;