4.8 Emitters clamping values, 4.7 works ok

Yup, me again :wink:

Versions 4.8 and 4.10 works the same way (not the way I’d like), 4.7 works as expected. I want to fade out all the existing and alive particles when the emitter duration comes to end. I do not want to depend the opacity on a single particle lifetime, but on the emitter time. Problem is, if emitter time > 1, everything breaks in 4.8 and onward.

Emitter time: 3 | Particle Lifetime: 1

4.7: All the particles have the opacity set depending on the emitter duration, the effect gently fades out when the emitter duration comes to 3 sec.

4.8: After 1st second of emitter is reached it looks like no particles are ever updated again.

Since I’m not really making FXes myself, I asked our artist to make an explanation that would maybe show what it is that’s a problem. I’m also attaching a project that you can migrate to 4.8 and compare how it looks here and there. Hope it’s enough.

Hi vipeout -

Thank you for this report. We are currently tracking this issue as UE-21246 and have an internal fix. Barring issues in testing, this issue should be corrected in 4.11.

Eric Ketchum

Would you be please so kind and tell me where in the code is that fix? It proved that 4.11 creates too many problems to just merge and we’d really like to simply merge that one fix. Lines in a certain *.cpp file would be ok, even commit ID would cut it if it’s too much hassle to get the file and line.

The integration of the fix for this issue came from a private game repository and was in a mass integration of the game engine code back into main, but the fix is fairly simple to implement.

You will need to change the line in Distributions.cpp (Source/Runtime/Engine/Private) from:

const float Time = FMath::Clamp(MinIn + SampleIndex * TimeScale, 0.0f, 1.0f);

to:

const float Time = MinIn + SampleIndex * TimeScale;

And you will also need to change the following in DistributionVector.h (Source/Runtime/Engine/Classes/Distributions/) from:

	/** @return true of this distribution can be baked into a FRawDistribution lookup table, otherwise false */
	virtual bool CanBeBaked() const 
	{
		return true; 
	}

to:

	/** @return true of this distribution can be baked into a FRawDistribution lookup table, otherwise false */
	virtual bool CanBeBaked() const 
	{
		return bCanBeBaked; 
	}

Thank You

Eric Ketchum