vircadia / vircadia-native-core

Vircadia open source agent-based metaverse ecosystem.
https://vircadia.com/
Other
533 stars 175 forks source link

ParticleEffect.colorSpread would be more flexible if the range were based on HSB rather RGB #588

Open AleziaKurdis opened 4 years ago

AleziaKurdis commented 4 years ago

The attribute "colorSpread" of the Particle entity is not a color, but a Vec3 with the variation range for the 3 RGB channels. Having a color picker for that attribute in the "Create" app doesn't make sense. When you really used this, the color that it renders in the create app has just no meaning. This even makes this very confusing for any newbie that tries to understand how particle works.

This was the easy part to address.

But there is worse in my opinion. The fact that the colorSpread is ranges based on rgb make this a bit anything when it comes time to use that thing. What I think we would expect to do with a colorSpread for a particle effect would be:

To be really usable, the colorSpread attribute would need to be ranges based on HSL (Hue, Saturation, Lightness) or HSB (Hue, Saturation, Brightness) and consider the Hue as a circular axis.

image

As it is today, I don't think that there is a serious usage of colorSpread. (I think it's still time to address this.)

AleziaKurdis commented 4 years ago

After analysis, HSB would be better than HSL for that. Because for a specific hue, the saturation would go from "white" to "color" which is more what we want than HSL that would go from "Gray" to "Color" instead of "White" to "Color" (Particles would lose intensity if we go with gray)

1st-BrainStormer commented 4 years ago

The old firework launcher that was in playa used the hslToRGB function that was in utils.js so accomplish the color calculations for these settings.

AleziaKurdis commented 4 years ago

"colorSpread" is not a color. It was certainly doing "something". Probably not what we expect from "colorSpread". I'm not saying that it can't be nice. It's just won't do what you aimed to do in many cases. Try it by yourself. Try "cyan", to have a spread to random from "green" to "blue", and not get "white" or "grey" in the equation.

AleziaKurdis commented 4 years ago

Splitting this bug. The part for the Create App will have it's separated issue (to replace the color picker for a vec3) This current bug will be specifically for the HSB versus RGB enhancement request.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

AleziaKurdis commented 3 years ago

Still a potential enhancement to have.

stale[bot] commented 2 years ago

Hello! Is this still an issue?