Fix #31754: strand width fade value 2.0 gives wrong result, should fade out

strand entirely. Fix based on patch by Philipp Oeser.
This commit is contained in:
Brecht Van Lommel
2012-06-13 15:33:59 +00:00
parent 0bed750c3a
commit 01b036f5c6
2 changed files with 2 additions and 2 deletions

View File

@@ -1729,7 +1729,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem
strandbuf->minwidth= ma->strand_min;
if (ma->strand_widthfade == 0.0f)
strandbuf->widthfade= 0.0f;
strandbuf->widthfade= -1.0f;
else if (ma->strand_widthfade >= 1.0f)
strandbuf->widthfade= 2.0f - ma->strand_widthfade;
else

View File

@@ -400,7 +400,7 @@ void strand_shade_segment(Render *re, StrandShadeCache *cache, StrandSegment *ss
interpolate_shade_result(&shr1, &shr2, t, ssamp->shr, addpassflag);
/* apply alpha along width */
if (sseg->buffer->widthfade != 0.0f) {
if (sseg->buffer->widthfade != -1.0f) {
s = 1.0f - powf(fabsf(s), sseg->buffer->widthfade);
strand_apply_shaderesult_alpha(ssamp->shr, s);