Search Unity

Question Recording Bloom / transparent object on alpha background?

Discussion in 'Audio & Video' started by Thall33, Apr 15, 2022.

  1. Thall33

    Thall33

    Joined:
    Sep 18, 2013
    Posts:
    134
    Using HDRP

    My setup is - Cam has background set to black with zero alpha, The recorder is using image sequencing with alpha.

    The problem is if there are any transparent surfaces or bloom is in use, it will ONLY work on opaque objects, meaning they wont be in the final render images if its casting on the cameras alpha background

    How do it set my HDRP to use postfx and objects using transparent surfaces when there is isn't any opaque objects behind them?
     
    Last edited: Apr 17, 2022
    newguy123 likes this.
  2. Thall33

    Thall33

    Joined:
    Sep 18, 2013
    Posts:
    134
    Visual Explanation:

    Camera with black color background and zero alpha (You can see the green bloom on the edges)
    upload_2022-4-17_20-26-47.png

    The rendered image using recorder (bloom is not present) (used a black gradient on background to see it better)

    upload_2022-4-17_20-25-20.png
     

    Attached Files:

    newguy123 likes this.
  3. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
  4. Thall33

    Thall33

    Joined:
    Sep 18, 2013
    Posts:
    134
  5. Thall33

    Thall33

    Joined:
    Sep 18, 2013
    Posts:
    134
    Just wondering if I'm talking ancient Egyptian or using the wrong terminology. Is there a way to render out bloom fx over an alpha background or not? UNITY?!
     
  6. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    I suggest you submit a bug report and post the case number here. The more people having the issue the more likely is that it gets fixex sooner.

    If you can repo it on a new scene with the simplest setup, even better.
     
  7. Thall33

    Thall33

    Joined:
    Sep 18, 2013
    Posts:
    134
    BUMP!
     
    newguy123 likes this.
  8. Thall33

    Thall33

    Joined:
    Sep 18, 2013
    Posts:
    134
    BUMP!
     
    newguy123 likes this.
  9. cyanspark

    cyanspark

    Joined:
    Mar 12, 2022
    Posts:
    57
    I suggest that you go into the code of the recorder and fix it for yourself... It's a render texutre to RGB PNG, there used to be a bug where imageRecorder had RGB24 that you have to change to RGBA32 but that won't fix your problem...

    Somewhere in your recorder, there is a TEX2D from render texture converted to an image... It is within that process that the bloom is going missing, and perhaps things like smoke are becoming opaque because tex2d to PNG doesn't know if they are transparent or not.

    To fix this problem, you will have to add some lines based on color maths or another trick, so that the tex2D to PNG can deal with special cases like smoke and bloom effects. Please post any progress from that and I will be happy to learn more, because I understand the pixel color maths well, I don't know how the render texture/pipelines/tex2d to png is handled though... I mean, perhaps the best would be to use a custom PNG encoder from github which takes special reference to transparency, perhaps just create a new layer whereby the bloom is added to the conversion process, I dunno. good luck.
     
  10. cyanspark

    cyanspark

    Joined:
    Mar 12, 2022
    Posts:
    57