Home Technical Talk

Differed Rendering and BnW Specular Workflow

polycounter lvl 18
Offline / Send Message
oXYnary polycounter lvl 18
I'm curious, how did/does engines that use a Deferred rendering system* (non PBR) deal with gloss and specular? As in, how do they control both per pixel versus per material? Additionally, with metals, does it use a check-box to get the specular color from diffuse?

*Not just lighting, the whole thing.

Replies

  • monster
    Offline / Send Message
    monster polycounter
    I think your question is too general. For example in Unity the built-in "Specular" shader is calculated per vertex, but the built-in "Bump Spec Diffuse" shader is calculated per pixel. Neither uses specular power map, but those use a gloss map in the alpha of the diffuse map.

    And it works this way in both deferred and forward rendering paths.

    Maybe be more specific about the engine you are interested in.
  • Farfarer
    Depends on the engine - some will store a separate gloss and specular value as part of a G-Buffer.

    Some, like Unity, do some hacky stuff - storing the specular value in the alpha of the albedo G-Buffer - means you don't get coloured specular.
  • EarthQuake
    Odd question, deferred rendering has nothing to do with PBR first off (you can have either or both or neither).

    How exactly you input gloss/spec will be really engine specific, so its better to figure out what engine you're thinking of using and then ask.
  • marks
    Offline / Send Message
    marks greentooth
  • oXYnary
    Offline / Send Message
    oXYnary polycounter lvl 18
    Long story short, there is a push to make Torque 3d MIT* totally deferred. The person doing to brunt of the work cannot justify colored speculars because the of hit. I read from an earlier thread on polycount that this is a known challenge.
    http://www.polycount.com/forum/showthread.php?p=1035922

    I mentioned no PBR, because from what I understand a bnw metalness map will get the color from the albedo.. Thats why UE4 can be totally deferred in part while UE3 cant.

    This isn't the case in the old system, yet the main guy was under the impression he could grab the color values from specular (they are pure programmers). Had to explain then all highlights would have diffuse color making everything look like metal. I wanted to give an example of a deferred pipeline to help. I know of non. I also haven't gotten a straight answer yet if we still will have two channels to separate the specular from the gloss. With what little I understood, they were going to rely on the diffuse for one of them...

    Even better than all this, calling all game rendering coders and shaders to help some pure programmers figure out whats what.

    IRC Network: irc.maxgaming.net
    IRC Channel: #garagegames

    Look for Andrew or Az.

    TBH though, not understanding the push to deferred since its a dead end for 4K. Forward+ seems the way to go to keep abreast of whats coming ahead.
    http://goo.gl/EFL006

    *Please don't turn this into why would one use this engine, or it sucks. Not helpful in the least.
  • EarthQuake
    Someone smarter can correct me if I'm wrong, but I don't think forward/deffered rendering has anything to do with whether you're using physically based shaders, 8bit spec, 24 bit spec, etc.

    In general terms, I believe deferred renderers often have limitations on the amount of shaders you can use, and usually you'll have one sort of uber shader that handles almost all of your materials in a completely deferred pipeline. However, what that ubershader actually is and the inputs it takes shouldn't be limited to non-pbr or anything like that simply due to being deferred.

    Metalness input is also not mutually exclusive to PBR, and I think what you say about UE3 and UE4 is incorrect and really neither here nor there.
  • monkeyscience
    Offline / Send Message
    monkeyscience polycounter lvl 12
    EarthQuake wrote: »
    Someone smarter can correct me if I'm wrong, but I don't think forward/deffered rendering has anything to do with whether you're using physically based shaders, 8bit spec, 24 bit spec, etc.

    This is technically true but PBR introduces a bunch of variables and requirements that make deferred rendering harder to write. You need to write more things to the G-Buffer (like gloss and RGB reflectance), and Unity's approach of RGB diffuse A specular-everything doesn't cut it anymore.
  • oXYnary
    Offline / Send Message
    oXYnary polycounter lvl 18
    I wasn't aware of any engine before PBR that used a metalness map EQ. This is why its the blind leading the blind (with them asking me things I just don't know), and why I was hoping someone could give the workflow for making specular and gloss for a deferred engine that doesn't use colored specs.

    Whomever popped into that IRC, I meant Az, sorry!
  • EarthQuake
    I am not aware of any engines that use the metalness workflow but don't claim to have physically based shaders, but that in itself doesn't mean much. Again, its not mutually exclusive.

    However, you do not need a metalness input to have physically based shaders, its simply not a requirement. If you take the time to understand what metalness maps do, that should become more clear. (Hint: its mostly an optimization thing).

    While i'm not aware of any engines with non-pbr shaders that uses metalness maps, there is not anything stopping you from setting one up. You certainly could use the metalness workflow with a NPR (non-photo realistic) shader for instance. You could set up a metalness shader to use a non-realistic fixed reflectance value higher than 0.04 if you wanted a stylized, look where non-metals are more reflective than they typically are in reality.

    Maybe give this thread a read, its been quite active lately: http://www.polycount.com/forum/showthread.php?t=136390

    I think if general you're focusing too much on what maps the shaders take, and not the basic foundations of physically based rendering. I would worry less about metalness vs 8bit spec vs 24bit spec and more about image based lighting, local probe baking, physically grounded dynamic lights energy conservation, fresnel, etc. Though even IBL is not technically required for PBR, its just hard to get realistic ambient reflections without it.

    If I were you I would:
    1. Figure out what sort of rendering system you want (I would recommend some sort of PBR as it is essentially industry standard at this point). Write up a technical document with all of the rendering features that would require. This will involve researching other engines like UE4, Crytek, Toolbag, etc.
    2. Talk to your engineers about what is doable with deferred vs forward etc.
    3. Figure out how to feed the shaders/pack the maps (metalness vs spec etc)
  • oXYnary
    Offline / Send Message
    oXYnary polycounter lvl 18
    They are specifically not wanting to focus on any PBR implementations yet. They want to optimize the engine as it stands now, which they have decided a deferred shader system is best. After they get that working with the current shader system in the engine, then they will focus on PBR/IBL, etc. Thats why I have been specifically attempting to steer conversation away from PBR discussion.

    Probably will give a better sense just to link you to the thread.
    http://www.garagegames.com/community/forums/viewthread/137917

    It sounds like the metalness map in this case will be the same idea I had in the initial post with it basically acting as a mask for when to pick up the diffuse color versus not.
Sign In or Register to comment.