Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
141 stars 2 forks source link

Add Color options to more particle emitters. #3138

Open BaxterOttoman opened 3 weeks ago

BaxterOttoman commented 3 weeks ago

Is your feature request related to a problem? Please describe.

The Box Emitter lets you set up colors per vertex for the emitter. Control over color like this would be a useful tool to have on other particle emitters.

Describe the solution you'd like

I would like to see color fields exposed for using with other emitters as they are on the box emitter. I don't have all the emitters figured out, but I would assume it'd things like being based on UV position, for cases like the torus, distance from center for sphere, and just a single value for the point emitter.

Image

Describe alternatives you've considered

Using the box emitter, or controlling the colors of the particles with the particle color field. Using the particle color field limits what you can do with the colors, and using the box emitter limits the shapes you can use for emissions.

Additional Context

No response

Requesters

No response

Frooxius commented 3 weeks ago

How would this work for other emitters? With box this works relatively simply, because it has identifiable verticies, but something like a sphere is more complicated - there's multiple ways to map the color.

BaxterOttoman commented 3 weeks ago

I figure it would need some trial and error, but a first idea I had for sphere would be color based on a UV unwrap of the sphere, or maybe just a transition from the center to the outside.

Or maybe there could be multiple mappings and you pass a component representing a mapping style to the emitter, like how there are point generators that can be used by the random event component.

Frooxius commented 3 weeks ago

It's not really trial and error thing - it's more... what are your usecases? There's no right/wrong way to do it, it's just there's a lot of ways to do it, so we need to pick which ones we'd implement.

That will depend on your usecases for this kind of thing.

UV unwrap doesn't work in this case - the sphere emitter is not a mesh, it's actual idealized sphere with volume, so UV doesn't apply there. You could use a sphere mesh with UV and the mesh emitter if you want that.

BaxterOttoman commented 3 weeks ago

Well, I can talk about what I'm specifically doing, I'm using multiple emitters, but I want them to share the same particle system. I'm using a vertex color material so I can control the color by emitter. Even being able to set just one vertex color that the entire emitter could use would be useful for my purposes.

Frooxius commented 3 weeks ago

So you want just a single color? That one is relatively easy.

However we can't really do colors per vertex, because the emitters like sphere don't have any - they're analytical shapes, not meshes.

BaxterOttoman commented 3 weeks ago

The per vertex thing I'd mentioned was just because that's how the box emitter works. It would be unreasonable to expect that from most other emitters, I agree. Either way, I should probably not have lead with that, it was confusing.

I was just saying that there may be use in making other means of mapping vertex colors to where in an emitter they come from, but all I am personally interested in is being able to give emitters a vertex color to use.