How can I create the effect of a smoke trail emitting from an object’s animated position, using TSL?
In this case the red box is orbiting the origin of the scene.
Specifically, I want to smoke particle to emit from the box position, and then trail off, independent for the box.
I’m working with code based on an example:
const offsetRange = range(new THREE.Vector3(-2, 3, -2), new THREE.Vector3(2, 5, 2));
const timeTime = time.mod(1);
smokeNodeMaterial.positionNode = offsetRange.mul(lifeTime);
I’ve tried adding in the box emitter position, but it fails, since the smokeInstancedSprite is a child of the box emitter. (The whole honking smoke cloud moves with the emitter).
I’ve used variations of this TSL demo to create all kinds of smoke, including (1) vertical smoke from a volcano or ship and (2) trailing smoke, such as jet exhaust, a ship wake and smoke and fire from a burning airplane.
Let me know if any of those sound sound like what you are trying to do and I can add a link to that example so you can see what parameters I changed.
3 Likes
Hey! The code bit above is based on that same example 
Turns out that this example: webgpu_tsl_vfx_linkedparticles is a better fit for my smoke trail effect.
2 Likes
I wasn’t sure if you were using that example.
I think I now see the problem you were trying to address and it is something I have run into myself - the fact that, with a particle emitter, the particles retain their orientation relative to the source, not the environment. So, for example, if I use a particle emitter to create a ship wake and if the ship starts turning, the wake created by an emitter tends to shoot straight back rather than following a curved path. I think this can be addressed by adding non-linear formulae to change the lateral offset of the particles relative to the source. But that is merely an approximation.
A better solution is to have the source emitter drop the individual particles so that they are linked to the environment, like a trail of breadcrumbs. I have used this to create long trails behind maneuvering airplanes. But I am waiting for a TSL or WebGPU example that is undoubtedly more efficient than what I have created.
Is that the problem you were trying to address? If so, the linked particle example appears to provide an interesting variation.
1 Like