Announcement

Collapse
No announcement yet.

Bloom shinethrough effect intended?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bloom shinethrough effect intended?



    I played around with the Bloom settings of the Texturecabinet and noticed that iobjects behind another one shine through with the bloom effect. (See video) when I increase the Bloom Threshold this "shining through" disappears. The banana object is solid and not transparent. Is that an intended behaviour of a Bloom effect?

  • #2
    Please note that bloom coefficient is taken from material's albedo color alpha-channel and it controls the strength of bloom/glare. In TextureCabinet (which is, technically, a G-Buffer, since Afterwarp uses hybrid deferred/forward rendering with an optional depth pre-pass, though it has an experimental option of rendering everything in a single pass) when rendering solid geometry, resulting alpha-channel contains these coefficients for each pixel. Therefore, you either have accidentally enabled alpha-blending when rendering solid geometry, or for some reason the object in front is not writing its bloom coefficients to texture cabinet.

    The Bloom Threshold is a different parameter, which means starting from that value the bloom would appear. In other words, if your object has bloom coefficient of 0.8 and your bloom threshold is 0.7, you'll get resulting bloom value of 0.1. So if you increase bloom threshold, the whole bloom effect diminishes and then disappears, which is what you are seeing.

    P.S. The video still looks nice. (and by the way, some of the features you previously requested will come as part of Afterwarp's minor update).

    Comment


    • #3
      Thanks for the info. I really just played around with those bloom values and looked what happened. Threshold did what I wanted so I just used that without thinking about it.

      "(and by the way, some of the features you previously requested will come as part of Afterwarp's minor update)."
      Exciting! Thanks again for all your work.

      Comment


      • #4
        Yep, seems it was a renderstate problem. Just to be sure :

        Code:
         //Setting a Renderstate for solid textures
        FillChar(LRenderingstate, SizeOf(TRenderingstate), 0);
        LRenderingState := FDevice.RenderingState;
        LRenderingState.CullFace := TTriangleFace.Back;
        LRenderingState.States := LRenderingState.States or StateBlendEnable;
        LRenderingState.BlendColor.Source := TBlendFactor.one;
        LRenderingState.BlendColor.Dest := TBlendFactor.zero;
        LRenderingState.BlendColor.Op := TBlendOp.add;
        LRenderingState.BlendAlpha.Source := TBlendFactor.one;
        LRenderingState.BlendAlpha.Dest := TBlendFactor.zero;
        LRenderingState.BlendAlpha.Op := TBlendOp.Add;
        Is that the correct default renderstate for solid objects? Just wanna make sure.

        Comment


        • #5
          That looks correct, but I would advice excluding StateBlendEnable in this case. Also, since you are reading LRenderingState from FDevice, there is no need to clear it with zeros with FillChar.

          Comment

          Working...
          X