Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. Dismiss Notice

PBR specular shading, how does this work ?

Discussion in 'Unity 5 Pre-order Beta' started by BigB, Feb 3, 2015.

  1. BigB

    BigB

    Joined:
    Oct 16, 2008
    Posts:
    672
    Hi guys,

    Would someone please bare with me, and explain how does specular mapping works in the Standard PBR shader ?
    I can't get my materials to have specular only where I want.
    The specular maps look great and work in both Quixel and Substance Designer, but once I bring it to the Unity shader, I get specular all over the place.
     
  2. Axiomatic

    Axiomatic

    Joined:
    Feb 7, 2014
    Posts:
    30
    This is a common problem for folks, when using the specular standard shader the specular map slot requires spec in the RGB and gloss in the alpha of that same map. Otherwise it will come out as you described.

    The ideal for many would be that the standard inspector has every map type broken out separately and then unity would conflate them into the desired compiled channels before run-time. But it doesn't seem that is how it will work.
     
    Marc-Saubion likes this.
  3. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746

    Attached Files:

  4. DonJaket

    DonJaket

    Joined:
    Oct 14, 2013
    Posts:
    10
    I managed to get spec on specific places with putting the gloss and spec into one texture. But what texture format can I use except tga which is way to huge. Png, Jpg seams not to work no way I gonna use tga for every mesh.
     
  5. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I use PNG for a lot of my texture files and have no issues. Are you getting errors using them?
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    10,961
    Well.... why not? Hard-drives are pretty cheap nowadays.
     
  7. DonJaket

    DonJaket

    Joined:
    Oct 14, 2013
    Posts:
    10
    I tried it, it's not saving PNG in alpha channel. Only TIFF and TGA works.
     
  8. Psimoh

    Psimoh

    Joined:
    Apr 12, 2013
    Posts:
    22
    These kinds of discussions are a nightmare because there is no actual PBR 'standard', so when someone is talking about the 'specular' they might not actually mean specular map usage, as such, but the overall 'gloss' values manifesting themselves as a surface which seems to have a lot of 'specular'. See? I think I've confused myself already.

    So whenever you start a discussion like this, especially where it is possible to use both/either the specular or the metalness workflow, I think it is important to state categorically which one you are using.

    With that said I have to point out that I can only guess which workflow the OP is using. Personally I'm using the metalness workflow. I'm in the process of preparing an asset bundle for the Asset Store. I'm using the metalness shader in Substance Designer 4, testing in Unreal Engine 4, Toolbag 2, and also taking a look at how my assets will look in Unity 5. It is in my interest to make sure my assets can be used by as wide a customer base as possible. Thus I am creating a rod for my own back as there is no 'standard'.

    Currently I can report that Toolbag 2, UE4 and Substance Designer seem to produce results that are pretty close to one another. Unity shows a marked difference, specifically in the amount of glossiness (shinyness? specularity? please pick your preferred adjective). Please don't misunderstand me: I'm not using the spec/gloss workflow, I'm just describing how shiny my test assets look. The difference lies in how Unity is using the microsurface map (roughness in UE4/SD4 and Toolbag 2, but maddeningly inverted and called 'smoothness' in U5). I've just done a test between beta 18 and beta 22 and the devs have dialled down the shinyness but IMHO it needs to come down some more.

    Anyway, please forgive the ramble but this could be what the OP was talking about; currently things can look very shiny in U5.

    I can also report that out of Substance Designer I have no problem writing information to the alpha channel for PNG files.
     
  9. Marc-Saubion

    Marc-Saubion

    Joined:
    Jul 6, 2011
    Posts:
    643
    I totally agree. When working on a new material, most of the research work is done on the gloss/smoothness which is on the alpha channel and this is the less accessible on photoshop.
    It is also a pain to have to manually putt this map in the alpha channel after baking the textures of a model.

    Unity should allow the user to import a "grey levels" PSD that could be compiled with the specular/metalic RGB so it would automatically make its own RGBA file.