Search Unity

Andy Touch[es] on Physical-Based Shading, Reflection Probes, WebGL in Unity 5

Discussion in 'General Discussion' started by Aurore, Aug 11, 2014.

  1. Aurore

    Aurore

    Head of Learn Content Production Unity Technologies

    Joined:
    Aug 1, 2012
    Posts:
    3,104






    No apology for that terrible pun.
     
  2. NomadKing

    NomadKing

    Joined:
    Feb 11, 2010
    Posts:
    1,462
    Puntastic.
     
  3. Deleted User

    Deleted User

    Guest

    Interesting stuff.
     
  4. landon912

    landon912

    Joined:
    Nov 8, 2011
    Posts:
    1,572
    I always think it's cool to see the real faces behind the usernames. I think we should have a day where we switch our avatars to our faces for one day.

    Interesting talk.
     
    Cascho01 and carking1996 like this.
  5. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,433
    Cool stuff! =)

    tough crowd though..
     
    spraycanmansam, superpig and Whippets like this.
  6. zDemonhunter99

    zDemonhunter99

    Joined:
    Apr 23, 2014
    Posts:
    478
    Thanks for the (H)andy video. :D
     
    Aurore and angrypenguin like this.
  7. Dabeh

    Dabeh

    Joined:
    Oct 26, 2011
    Posts:
    1,603
    Why not start now ;)? Become one of the elite.
     
    Last edited: Aug 12, 2014
    landon912 and SememeS like this.
  8. landon912

    landon912

    Joined:
    Nov 8, 2011
    Posts:
    1,572
    I'll look for/take a picture!
     
    SememeS and Dabeh like this.
  9. Ferazel

    Ferazel

    Joined:
    Apr 18, 2010
    Posts:
    326
    It's too bad about the projector causing a lot of the scenes/visuals to being completely darkened out.

    I'm really interested to see what the "standard" shader is actually going to be capable of, and what kind of performance impact the settings will incur. I'm sure artists will love it, but programmers need to love it too. Does the final compiled shader require a multiply on every fragment for the normal map when you increase/decrease the scale or is that modifier value "baked" into the shader's source? How well does it handle transparency, what do we do to make the cat balloon transparent?
     
  10. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,563
    Looks great!

    ..Time to get a picture of myself.
     
    landon912 likes this.
  11. landon912

    landon912

    Joined:
    Nov 8, 2011
    Posts:
    1,572
    Would anyone like me to write up a thread and pick a day? Maybe we can get a lot of the oftens to participate!
     
    calmcarrots likes this.
  12. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,563
    Go ahead. Now let's get back on topic.
     
  13. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,196
    Like Ferazel and his wand, I'm curious about how much the standard shader will support, and how easy it will be to extend, if at all. Will we be able to "build" upon it, adding individual features like blending several diffuse maps based on vertex colors, for example, or would one have to start from scratch?
     
  14. inafield

    inafield

    Joined:
    Feb 26, 2013
    Posts:
    281
    I listened to this at work with Youtube's 1.25x speed turned on and was able to peek at the video during the important parts. Great presentation, concise, and informative. Definitely a tough crowd though.
     
  15. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,420
    Nice, love the shading!
     
  16. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,094
    Look at 17:30:
    Seems like in Unity5 we´ll have a Marmoset-Skyshop-like functionality!
    Would like to have more information on this...., will it really be comparable to Skyshop?
     
    Last edited: Aug 12, 2014
  17. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,535
    It will be similar, yes. Cubemap specular convolution, HDR texture/cubemap import, reflection probes placed around scene and picked up by objects.
     
    Cascho01 and NomadKing like this.
  18. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,094
    also with different glossiness/blurry levels?
     
  19. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,774
    Looking great.
    In the example Viking scene, it says the standard shader is used for everything. Does this mean that it's perfectly happy being used for terrains too, and if so, how does this affect splats and render speed (terrains being quite heavy)?
     
  20. GCat

    GCat

    Joined:
    Jul 31, 2012
    Posts:
    172
    Keep updating with more videos like this, love them.
     
  21. Grimwolf

    Grimwolf

    Joined:
    Oct 12, 2013
    Posts:
    296
    Technically, I think that's what Avatars are for. Most people just don't use them that way.
     
  22. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    686
    You better call it UberShader again, or I'm totally switching to Unreal!!!11! :mad::mad::mad:

    Question:
    Can you alter the properties of the UberShader (;)) during runtime? Basically doing doing stuff like swapping the normal maps or manipulating their weight.
    That'd be sweet.
     
  23. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,535
    Yes, that's what "specular convolution" does.
     
  24. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,535
    Yes. It's really no different from any other shader in Unity. Can you change texture for another? Of course you can. Can you change property X on it? Of course you can.
     
  25. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,276
    Excellent stuff all. And is it possible to choose say, a mobile variant of the ubershader rather than it be automatic, so that if a desktop or console game is getting a bit breathless for performance, there's the option to pick a lighter, faster version?
     
  26. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,535
    Not right now (we may or might not happen to do it). But hey, there's nothing stopping you from taking that shader source, copying it into your project and changing it however you want. Add/remove features, add/remove more fallbacks/subshaders/LODs, whatever. It's just a shader, really.
     
  27. Zeblote

    Zeblote

    Joined:
    Feb 8, 2013
    Posts:
    1,102
    He said that those webgl demos are online, so where to find them?
     
  28. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    945
    Can't wait!!!
     
  29. Deleted User

    Deleted User

    Guest

    I can't fathom how everything specular in Unity looks like it's covered in a highly glossy plastic / saran wrap. Is this a Bling Thong lighting model? It should look more like this:

     
    Last edited by a moderator: Aug 12, 2014
  30. calmcarrots

    calmcarrots

    Joined:
    Mar 7, 2014
    Posts:
    681
    Andy Touch's avatar is the funniest thing I have seen on the internet hahah
     
  31. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,156
    Note that shader multiplication doesn't work that way: if you hard-code a multiplier value into the shader source, all that happens is the compiler pulls it out into a constant register and still generates a multiply. So there's no benefit to hard-coding values like that. (The only exception to this might be a x2 multiplier, but I think the modifiers for that went away in SM4).
     
  32. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,156
    Isn't that usually just because people have crappy/absent specular maps?
     
  33. Deleted User

    Deleted User

    Guest

    Well I'm not going to say no because they can do, it's noticeable on Lux shaders / marmoset shaders with or without specular maps and with plastic cat on Andys demo (hence why I mention it). Try the same assets in Unreal or CryEngine with the same maps and it looks nothing like it.. I was going to try something other than Bling 9ct Thong on a surface shader, but never got around to it.

    Just to also mention, if you generate specular maps from the likes of Quixel chances are they are going to be guurd!.

    But now my interest is peaked so I'm going to mess around with it over the weekend.

    Edit: Very interesting, could very well be the standardised lighting models dadada it's plastic man. http://docs.unity3d.com/Manual/SL-SurfaceShaderLightingExamples.html

    Is there no BRDF / Microsurfacing / Fresnel in the base shaders with Unity 5.0?




    CE ILLUM uses a normalised Blinn-Phong shading method, with energy preserving methodology. An Ubershader (which is a Crytek term HAHA) contains way too much to try and list.
     
    Last edited by a moderator: Aug 13, 2014
  34. Ferazel

    Ferazel

    Joined:
    Apr 18, 2010
    Posts:
    326
    Good to know, thanks for the information. I just thought it might be cool if some of that extra computation could be skipped for values that would be flagged as static. So for things like the normal depth, the build process could do a final precomputed bake into a final normal texture so that an additional multiplication step would be skipped and a single tex2D could occur. Rather than needing to incur a runtime hit for something that didn't change or remained at 1.
     
  35. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,156
    In theory that's all possible, but in practice it's going to be a lot easier for individual projects to customise the shader and modify their assets, according to their specific needs.
     
  36. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,121
    I have a couple of questions.

    What is a detail mask? Is that for masking out secondary detail textures/normals? And if thats the case are u able to include more detail textures for other areas? For example leader clothing that leads into scratched up armor on the same material.

    Also do you have way of handling sub surface scattering for things like flesh?
     
  37. Deleted User

    Deleted User

    Guest

    Pretty much what you're thinking, detail masks are overlays . E.g. want to add bits of moss to a brick wall / macro indentations, you can with a detail mask. http://docs.unity3d.com/Manual/HOWTO-UseDetailTexture.html

    From what I've seen there is no SSS in that shader, for it to really be a general purpose "Ubershader" you're going to need tesselation / Dirt mask (Blend) and some sort of SSS index. (P.S I'd love some POM in there by default).

    It's far from impossible to do it yourself, but hey there is a couple of options Unity to can chuck in the mix to make the out the box experience more pleasent.
     
    Last edited by a moderator: Aug 13, 2014
  38. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,355
    Well....Aras said no out of the box link here
     
  39. Deleted User

    Deleted User

    Guest

    Well if they don't I will, this sort of stuff should be out of the box a long time ago. If Unity are releasing a material editor then I get it, but apart from that I can't think of a good enough reason not to add it.

    It's fine if you're good with coding shaders, for level designers and artists or even viz arch then they don't want to be messing around with this sort of stuff.
     
  40. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    If we get the possibility to create our own Uber-Shaders, I am pretty sure that someone is going to publish that kind of shader within a short amount of time.
     
  41. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,156
    It's already entirely possible to create your own UberShaders. The 'loads of methods in one shader' thing is less a 5.0-specific thing than the fact that they're shipping a PBR one.

    It's possible there's some things we can't easily drive from parameters that are changing in Unity 5, I can't remember off the top of my head.
     
  42. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,121
    What about my other question. Are you able to include different detail textures and mask them out appropriately? Like one area a cracked stone and another area a fine grainy sand.
     
    Jingle-Fett likes this.
  43. Deleted User

    Deleted User

    Guest

    I'm pretty sure I said you already can, I'm not complaining for me it's not an issue. It's just a nice thing to do for your customers, like what you get out the box with CryEngine and the material editor with UE4.
     
  44. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,156
    Sure, I agree - I was responding to Dantus more than to you.
     
  45. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,156
    With the out-of-the-box shader, I doubt it; introducing extra detail shaders like that doesn't play well with the GPU, because it has to sample all detail textures and then throw away the samples that aren't needed, and sampling all these textures has a cost. Most of the time you'll be better off using two separate materials, one with cracked stone and one with grainy sand. But I imagine you'll be able to create your own custom version of the PBR shaders that use two detail maps if you want to.
     
  46. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,535
    How is this relevant at all? That's a non-physical-based example from unity documentation, where shading is done super-simple on purpose ("here's a very simple shading model").

    This makes me think you don't know what at least two of these terms actually mean... (hint: all shaders have BRDF... even the ones that look like crap).
     
  47. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    2,640
    And not adjusting the color appropriately for the material. Metal should have a specular the color of metal for instance. However,,that does require a Specular Color shader and that had to be hunted for back in the day. Anisotropy is another effect that used subtly can have dramatic improvements on surface look.

    But does it obey Helmholtz reciprocity? Is it a pain to up-convert it for subsurface scattering using BSSRDF? Do we get anisotropic speculars in the deal or have to code that in as well?
     
  48. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    How could I miss that? Thanks for the correction!
     
  49. Deleted User

    Deleted User

    Guest

    I'm fine with you thinking that, but it wasn't my point at all. Obviously all shaders have BRDF calculations or it wouldn't be a reflective bounce to the viewer (but it's supposed to bounce smooth shinies right? Not encapsulate an object in cling film) sorry it was a bad joke (lack of BRDF that is), so a bit of Lambert here a bit of Oren-Nayar there all is well. The point being, even though phong has a plastic look to it. It shouldn't look like Saran wrap with bad reflections..

    The relevance "was" the specularity between the "simple shader" and the Unity 5.0 one didn't look to far from each other.

    Also edited to note what Hippo said, the other Unity demos show all looks well. Just looked a bit odd on Andys demo.

    Microsurface is for your tiny imperfections, not really much to it. Fresnel, light on an angle is more likely to reflect than one that hits it dead on, none of this is that hard to comprehend,

    The physically based model should encapsulate, positivity, helmholtz and conserving energy. that demo didn't quite sit right for some reason.

    P.S not jumping on the work here, it looks mighty good in most cases. Just asking a simple question, I'm very curious.

     
    Last edited by a moderator: Aug 14, 2014
  50. Deleted User

    Deleted User

    Guest

    Hippo pointed me back to the teleporter demo, which looks in all accounts perfectly fine.

    Now he's going to be picking on me all night, thanks!. Just that demo made me think Unity 5.0 standard shader was going to look what comes out of Unity 4.0 and I'd have to re-do all the shaders again.

    I'm wrong, slap my hands up in the air and wiggle my bottom for forgiveness. (Not to you Aras, for picking on me too).