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:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user