Anyone know of an easy way (easy being relative I guess) to spawn particles from a texture?
I followed this tutorial but this really isn’t what I want. This basically creates a grid of particles and then colors them from the texture sample.
I want to actually JUST emit from the white parts of the texture (or any color really as long as I can control where it’s emitting from)
I can’t speak for others, but this is pretty much how I do it. The only extra thing I generally do is to kill the particles which will not be visible by checking if the value of any tex color channel is below certain threshold. There is an aptly named module “kill particle” then do a “bool from float comparison”.
Also there is no need to sample the texture in Particle Update. Sampling the texture, applying the tex color on the particles and killing the invisible particles can all be done in Particle Spawn which can improve the performance somehow.
Is this all done through scratchpad?
I’m just learning the scratchpad stuff so not quite to the point that I can construct things on my own just yet.
In this specific case the scratch pad can be avoided, but you would end up exposing what is done in the scratch pad back to the emitter stack which may look a bit messy and unorganized if you stick with the default dynamic inputs. You can use a “custom expression” if you are familiar with HLSL/C-like syntax:
float3(Particles.ParticleUV * 500, 0) + float3(-250,-250,0)
But the problem is the 2 other input parameters involved (“Add Vector” and “Scale”).
Again, you can’t really order a particle to be spawned at a specific texture pixel. The Shape Location module uses mathematical methods to assign particles to specific locations of any primitive shape. But because a raster image can be anything totally random, it can’t be easily or efficiently described in mathematical terms.