Home Technical Talk

(Solved) [PBR] Should opacity affect emission?

polycounter lvl 6
Offline / Send Message
bitinn polycounter lvl 6
Hi all,

I recently discover Maya's Stingray PBS material base has this strange property: opacity somehow affects emission?

A quick demo (orange is wired to emissive channel, we are only changing the opacity channel here):



Sure, I can overwrite the opacity for my emissive. But I wonder if this composition makes sense in terms of PBR.

I double-checked in Unity and it does this as well:



So my question is not limited to Maya ShaderFX or Unity, but PBR in general:

- I read Epic's PBR paper and a few online primer, to me, it seems like opacity/transparency/blending doesn't participate in the core PBR rendering equation, but instead got applied at the end?

- Is overwriting opacity for emission the right approach here?

Thx!

(my layman understanding was: PBR output color = light reflected + light emitted, so intuitively, opacity shouldn't affect light emitted, but that's of course not the case here.)

Replies

  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    I imagine it's related to how the rendering of the material is separated up between passes at render time. 

    The depth pass required for opacity is generally  separate from the colouring in passes so they can't necessarily communicate fully with each other. 

    I can't say I've ever seen this as an issue tbh.  Illuminated glass is something we can't really handle correctly at realtime so I tend to just fudge it using custom alpha
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    poopipe said:
    I imagine it's related to how the rendering of the material is separated up between passes at render time. 

    The depth pass required for opacity is generally  separate from the colouring in passes so they can't necessarily communicate fully with each other. 

    I can't say I've ever seen this as an issue tbh.  Illuminated glass is something we can't really handle correctly at realtime so I tend to just fudge it using custom alpha
    Not sure I understand.

    - My maya screenshots might be misleading, I am not asking about transparent depth sorting. I just forgot to turn off back-culling.

    - Since transparent shader doesn't write to depth normally, I don't see it being the cause that opacity is added last; but I can see why opacity/emission isn't a part of core PBR.

    - To me, PBR describes how a surface might react to light, so I think opacity is never a part of it (nor is emission). They are no different in PBR or non-PBR.

    What I currently do is to expose an opacity overwrite toggle: if false, let material opacity influence emission as usual, if true, mask opacity to give emission an opaque alpha.
  • poopipe
    Options
    Offline / Send Message
    poopipe grand marshal polycounter
    ok - I get what you mean.  you're right too but I think you're missing something about how different bits of the rendering pipeline talk to each other (or dont)

    what i was failing to say was this.. 

    As you say, emission is usually simply added to the colour of a given pixel.  It's not dealt with in a special buffer or anything.

    The alpha stuff is dealt with elsewhere (probably after - who knows...) . Since there's nothing to pass emissive information around the system  the alpha part doesn't know that a given pixel is supposed to be emissive, it simply has a colour value and an alpha value to use for composition.  For this reason you can't have an emissive value higher than the cumulative opacity of the surface 

    * this isn't fact -  it's an educated guess (I just invent shaders and have cleverer people than me to write the render code.)


  • Eric Chadwick
    Options
    Offline / Send Message
    If using deferred rendering, all lighting is summed before transparency is calculated. Transparency is done separately, at the end.

    If you want Emissive parts to not be dulled by transparency, then simply make them opaque. 
  • bitinn
    Options
    Offline / Send Message
    bitinn polycounter lvl 6
    If using deferred rendering, all lighting is summed before transparency is calculated. Transparency is done separately, at the end.

    If you want Emissive parts to not be dulled by transparency, then simply make them opaque. 
    Yes. But I should note transparency is usually done with forward rendering after deferred rendering (it is in my case), so I think deferred pipeline doesn't applied here (eg. the transparent object, including its opaque part, should be using forward light).

    Either way, @poopipe is correct that modern shading language doesn't know emission anyway, so alpha mask looks like the best approach and perhaps the only approach.
Sign In or Register to comment.