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).
This commit is contained in:
Ton Roosendaal 2006-07-02 07:59:42 +00:00
parent 577494dc05
commit 0cbb917e60
3 changed files with 10 additions and 8 deletions

@ -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);

@ -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;

@ -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;