Alchemist0823 / three.quarks

Three.quarks is a general purpose particle system / VFX engine for three.js
https://quarks.art
490 stars 23 forks source link

Synchronization of several particle systems (like Auto Random Seed in Unity) #89

Open ManHunter opened 1 month ago

ManHunter commented 1 month ago

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

It is often necessary to use particles with AdditiveBlending, but such particles are poorly visible on a light background. To solve this problem, I am creating the same particle system, but with NormalBlending and rendering under AdditiveBlending particles. In unity, there is a seed check mark for this case (Auto Random Seed) with the help of which it is possible to make the particles randomize in the same way.

image

Describe the solution you'd like

Could you add such a feature? or perhaps there is a similar alternative?

Alchemist0823 commented 1 month ago

Very interesting feature. This library use the browser's Math.random() to generate random numbers. Math.random() doesn't have a seed parameter. I guess we can replace every random function with a pseudo random generator from some third party library.

However, we are not supposed to duplicate a particle system. The following options are better for solving your problem and keeping everything rendered correctly.

  1. Use HDR Rendering: Use High Dynamic Range (HDR) rendering to allow a wider range of brightness values. HDR can help maintain the visibility of bright additive effects even on light screens.

  2. Adjust Contrast and Brightness: Adjust the overall contrast and brightness of your scene. You can reduce the brightness of the background or increase the contrast to make additive effects more noticeable.

  3. Alternative Blending Modes: Consider using different blending modes. Sometimes, using a different blend mode like screen or lighten can provide better visibility on light screens. (I am going to add Screen Blend option in the next patch)

  4. Testing on Different Backgrounds: Test your rendering on various background colors and brightness levels. This helps ensure that your effects are visible under different conditions.

  5. Gamma Correction: Ensure your rendering pipeline includes proper gamma correction. Incorrect gamma settings can affect the perceived brightness and contrast of your additive effects.

johnnyrainbow commented 1 month ago

Not the gpt response 🥲 @Alchemist0823 if it's possible I also would like it to be possible to have additive blend particles without them blending into scene. It would be a very good feature, maybe a sceneBlend Boolean param. Is it possible to build in?

Alchemist0823 commented 1 month ago

normal blend doesn't blend to the scene if the alpha of the texture is 1. additive blending adds src rgb to the dst rgb. it blends the scene by definition. Can you be clear about what sceneBlend achieves here.

Alchemist0823 commented 1 month ago

Not the gpt response 🥲 @Alchemist0823 if it's possible I also would like it to be possible to have additive blend particles without them blending into scene. It would be a very good feature, maybe a sceneBlend Boolean param. Is it possible to build in?

(I am going to add Screen Blend option in the next patch) it will probably solve some of your issue. The chatgpt response is actually pretty good. I did some filtering. I can give more examples how to achieve those/

johnnyrainbow commented 1 month ago

Awesome can't wait please let me know when that scene blend option is added!