Search Unity

HDR particle colours

Discussion in 'General Graphics' started by Nicksaccount, Dec 19, 2018.

  1. Nicksaccount

    Nicksaccount

    Joined:
    Jan 10, 2013
    Posts:
    24
    Hi,

    I'm getting the following in 2018.3.0f2. My particle system shows my colour gradient as HDR but when trying to change the colour, the intensity option isn't there. Is it HDR or isn't it?

    Untitled-1.png

    The material used is "Lightweight Render Pipeline / Particles / Unlit".

    Thanks,

    Nick
     
    Kokowolo and haendelee like this.
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Hi,

    This looks like a bug - the Color over Lifetime module does not support HDR colors and it should not be possible to get it into a state where it has HDR color content. Could you submit a bug report via the instructions on https://unity3d.com/unity/qa/bug-reporting please?

    Regarding HDR particle colors in general, it's only possible to do it via the Custom Data Module and a custom shader that reads the Custom Data and uses that for its colors. Unfortunately, all the built-in particle colors are LDR, for legacy reasons. (Only stored as 0-255 bytes).
     
  3. frankadoriv

    frankadoriv

    Joined:
    Jul 19, 2017
    Posts:
    14
    On 2018.3.4.f1 i have this error when i try to set the colorOverLifetime with a Gradient object:

    Code (CSharp):
    1.                
    2. var gradient = new Gradient();
    3. var colorKeys = new List<GradientColorKey>();
    4. var alphaKeys = new List<GradientAlphaKey>();
    5. var colorOverLifeTimeVals = JsonHelper.FromJson<GradientColor[]>(value ?? "[]");
    6. colorOverLifeTimeVals.ForEach(c => {
    7.      //colorKeys.Add(new GradientColorKey(new Color(c.r, c.g, c.b), c.p));
    8.      alphaKeys.Add(new GradientAlphaKey(c.a, c.p));
    9. });
    10. gradient.SetKeys(colorKeys.ToArray(), alphaKeys.ToArray());
    11. colorOverLifetimeModule.color = gradient;
    12.  
    In this example colorKeys.Add is commented, the problem is that line, alphaKeys works fine, if colorKeys are set, the color over lifetime HDR becomes activated
     
  4. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Hi please submit a bug report for this and we will investigate, thanks!
     
    haendelee likes this.
  5. Studiomaurer

    Studiomaurer

    Joined:
    Sep 5, 2012
    Posts:
    56
    Hi, has this been solved yet? Whenever I create a Gradient by Script (as seen above)it is generated in HDR (quite ramped up) and I cannot find a way to either switch HDR off or to adjust the intensity value.
     
  6. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    I seem to recall that the user above did submit a bug report and the outcome was they were setting colors in the 0-255 range, which should be used with ColorRGBA32, but they were using the floating point ColorRGBAf type, which expects 0-1 range values. Maybe you made the same mistake?

    (Apologies if my memory has failed me) :)
     
    haendelee likes this.
  7. Studiomaurer

    Studiomaurer

    Joined:
    Sep 5, 2012
    Posts:
    56
    Yep, stupid me. Forgot to normalize the values. Thanks!
     
    richardkettlewell likes this.
  8. Aliosa

    Aliosa

    Joined:
    Dec 20, 2013
    Posts:
    8
    it's 2022 and particle color still cannot use hdr
     
  9. JJRivers

    JJRivers

    Joined:
    Oct 16, 2018
    Posts:
    137
    This is highly suspect in an actual build so verify before using it BUT:
    It's kind of silly but it can actually use it if you copy paste the HDR Gradient there from elsewhere