- Fix for bug #17825: baking SSS is not supported, but it didn't give

proper results, should bake as if SSS was disabled.
- Fix for GLSL to handle failing shadow buffer creation better.
- Fix for sky/atmosphere version patch, was not doing files from 2.46
  and newer.
This commit is contained in:
2008-10-12 13:32:28 +00:00
parent 23a02bbead
commit 96e9debe1f
5 changed files with 32 additions and 22 deletions

View File

@@ -59,7 +59,7 @@ void sss_add_points(Render *re, float (*co)[3], float (*color)[3], float *area,
void free_sss(struct Render *re);
int sample_sss(struct Render *re, struct Material *mat, float *co, float *col);
int has_sss_tree(struct Render *re, struct Material *mat);
int sss_pass_done(struct Render *re, struct Material *mat);
#endif /*SSS_H*/

View File

@@ -1568,7 +1568,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
shr->col[2]= shi->b*shi->alpha;
shr->col[3]= shi->alpha;
if((ma->sss_flag & MA_DIFF_SSS) && !has_sss_tree(&R, ma)) {
if((ma->sss_flag & MA_DIFF_SSS) && !sss_pass_done(&R, ma)) {
if(ma->sss_texfac == 0.0f) {
shi->r= shi->g= shi->b= shi->alpha= 1.0f;
shr->col[0]= shr->col[1]= shr->col[2]= shr->col[3]= 1.0f;
@@ -1722,7 +1722,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
shr->alpha= shi->alpha;
/* from now stuff everything in shr->combined: ambient, AO, radio, ramps, exposure */
if(!(ma->sss_flag & MA_DIFF_SSS) || !has_sss_tree(&R, ma)) {
if(!(ma->sss_flag & MA_DIFF_SSS) || !sss_pass_done(&R, ma)) {
shr->combined[0]+= shi->ambr;
shr->combined[1]+= shi->ambg;
shr->combined[2]+= shi->ambb;
@@ -1772,7 +1772,7 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
/* modulate by the object color */
if((ma->shade_flag & MA_OBCOLOR) && shi->obr->ob) {
if(!(ma->sss_flag & MA_DIFF_SSS) || !has_sss_tree(&R, ma)) {
if(!(ma->sss_flag & MA_DIFF_SSS) || !sss_pass_done(&R, ma)) {
float obcol[4];
QUATCOPY(obcol, shi->obr->ob->col);

View File

@@ -1023,8 +1023,8 @@ int sample_sss(Render *re, Material *mat, float *co, float *color)
return 0;
}
int has_sss_tree(struct Render *re, struct Material *mat)
int sss_pass_done(struct Render *re, struct Material *mat)
{
return (re->sss_hash && BLI_ghash_lookup(re->sss_hash, mat));
return ((re->flag & R_BAKING) || (re->sss_hash && BLI_ghash_lookup(re->sss_hash, mat)));
}