ShaderParticleEngine icon indicating copy to clipboard operation
ShaderParticleEngine copied to clipboard

Would it be possible to have an option on groups/emitters to interpolate between positions?

Open code-matt opened this issue 7 years ago • 3 comments

https://gamedevelopment.tutsplus.com/tutorials/creating-smooth-particle-emission-with-sub-frame-interpolation--gamedev-10914

It's useful(required) for smoke trails on rockets and other moderately fast effects. I took a stab at adding it myself and failed miserably. Is this possible to add without adding too much of a performance hit?

I mean the world position, after 'attaching' the emitter to a quickly moving object by updating its position to match the object each frame. I imagine it would be a boolean on the emitter or group.

code-matt avatar Mar 28 '18 22:03 code-matt

Hey man, does this help? https://github.com/squarefeet/ShaderParticleEngine/pull/129

rpsirois avatar Jul 21 '18 02:07 rpsirois

I think it could be better option than is available now for high speed straight kind of effects, like some rocket trails.

I gave it a whirl, pretty cool except I think one would need to be able to do:

emitter.start.value = emitter.start.value.copy(newPosition)

The same way we are able to update an emitters position. This way the start of the line could be kept behind the traveling object. Right now it stays in place as the object zooms away and particles get thinner on the line as it gets longer.

I guess as it is now, could be made to be some kind of laser cannon :D

code-matt avatar Jul 22 '18 17:07 code-matt

Ah gotcha. I suggest just branching the code for yourself then and just tweaking that part of it so it's customized for your own project.

On Sun, Jul 22, 2018, 11:16 AM code-matt [email protected] wrote:

I think it could be better option high speed straight kind of effects, like a some rocket trails. It would not work for something like a homing rocket.

I gave it a whirl, pretty cool except I think one would need to be able to do:

emitter.start.value = emitter.start.value.copy(newPosition)

The same way we are able to update an emitters position. This way the start of the line could be kept behind the traveling object. Right now it stays in place as the object zooms away and particles get thinner on the line as it gets longer.

I guess as it is now, could be made to be some kind of laser cannon :D

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/squarefeet/ShaderParticleEngine/issues/127#issuecomment-406882543, or mute the thread https://github.com/notifications/unsubscribe-auth/ABTgB2jeiEKwbF_ZO6EY2iZN3NDA-oLOks5uJLNagaJpZM4S_fgj .

rpsirois avatar Jul 22 '18 22:07 rpsirois