Search Unity

PostProcessVolume.Weight screwy for Bloom?

Discussion in 'Image Effects' started by sarahnorthway, May 31, 2021.

  1. sarahnorthway

    sarahnorthway

    Joined:
    Jul 16, 2015
    Posts:
    78
    So I would like a flickering effect on a starfield-ish animation. I'm doing it with a Bloom PostProcess (3.1.0) effect and an Animation timeline.

    In the timeline, my artists can change PostProcessVolume.Weight, but not PostProcessVolume.Profile.Bloom.Intensity or whatever.

    Problem is that changing the Weight of a bloom has very strange results, it almost looks like it is affecting the Threshold? The screen is brighter at weight 0.5 than weight 1.0, which is the opposite of most effects. Feels like this might be a bug? But I don't understand what exactly PostProcessVolume.Weight does.

    So, say I wanted to write my own version of Bloom.cs and Bloom.shader, and I want PostProcessVolume.Weight to change the Intensity of the Bloom instead of Threshold or whatever it does now. Is this possible? I'm looking through the code but don't see anything obvious.

    Any other suggestions for changing the "amount" of bloom via an animation timeline?
     
    Last edited: Jun 1, 2021
    Radivarig likes this.
  2. Radivarig

    Radivarig

    Joined:
    May 15, 2013
    Posts:
    121
    Another weird thing that happens is if the weight is not 1 and there are multiple returns in the frag function then it ignores the conditions and switches between those returns:

    Code (hlsl):
    1. int k = 0;
    2. if (_Effect == k++) return col1;
    3. if (_Effect == k++) return col2;
    4. ...
    But when there's a single return it does what you described..