0 like 0 dislike


I am working on an energy field/force field effect that includes a blinking background and animated, horizontal beams moving vertically across the field. I have managed to do the effect based on GDC 2015, however, the tricky part is that the entire effect has to be attached to a fast moving object, which doesn't work with my current solution. The effect is illustrated below (please pardon the programmer graphics):

I know that traditionally energy beams would be implemented as shader, however, my constraint is, that they have to be done using particles.

The way I've structured the effect so far is to have the main layer with a mesh renderer to represent the background.

The other layer (BeamCenters) represents "seeds" or centers of the beams.

Then the actual beam effect is defined in a LayerGroup, that is triggered by the BeamCenters events. The actual beam particles have their positions defined based on virtual parent's LifeRatio and minimum and maximum width based on the current height (the width of the beams needs to change as they go up due to the field's shape).

I've tried several approaches to make the whole effect adjust to the changes in emitter's transform including:

- using localscape evolvers

- using projection

- shortening the Life of beam particles

None of the above solutions worked for me. I'm starting to consider using a hybrid solution e.g. separate the background and beam effects and control the beams separately from the engine, however, if another solution that can be implemented completly inside PopcornFX exists, I'd very much prefer it.

I'd appreciate any advice. Info that it currently can't be done would also be useful if that's the case.

Thanks in advance!

asked by Hargrimms (160 points)

1 Answer

2 like 0 dislike
Best answer

Hello Hargrimms,

Your problem here is that you are spawning your beams in world space through LayerGroups events, when you actually need to spawn them in localspace inside you spawner. This means you're using events to spawn particles outside of your spawner's transform matrix so indeed, you won't be able to "bring your children with you" when moving your actor since your children are spawned outside, without any knowledge of your parents' movements every frame.
So to avoid that, my best solution is to spawn your beam through the Spawner evolver.
With that, you can keep your child particles along and move them with your spawner when using Localspace evolvers, both on the parent particle and on the children.
I've made a example effect doing what you're trying to achieve, grab it here.
Let me know if everything is clear or if you need something.
answered by PierrePK (1.3k points)
This is exactly what I was looking for. Thank you!