Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

SpeedTree shader broken ?

Discussion in '5.4 Beta' started by AdamGoodrich, Apr 22, 2016.

  1. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    I also feel I should say:

    1) I am glad you guys are going to try to shoehorn in the fixes to SpeedTrees at the last possible minute because I do need them, but:

    2) "RC" is supposed to be "release candidate" and the point when a beta is feature complete. You really shouldn't be shoehorning new, untested things like an overhaul of the Standard Shader's core BRDF at the very last minute into an RC 2. This is why Unity has a reputation for releasing unstable, unfinished features at release instead of testing them in a beta like they should.
     
  2. Alex-Lian

    Alex-Lian

    Guest

    We're balancing risk with benefit here. In this case, it's a one line change to the cginc which I believe users could still modify to their need. (There's also some additional cleanup, but it's clean removal). So, in this case, yes we are willing to take the dice roll because it's small, contained, easy to rollback, and users should be able workaround if not.
     
  3. Alex-Lian

    Alex-Lian

    Guest

    the lambert-diffuse fix is my understanding. Will ask Marcin to confirm.
     
  4. dreyhal

    dreyhal

    Unity Technologies

    Joined:
    Jan 5, 2016
    Posts:
    15
    Hi
    The Lambert lighting fix made it's way to RC2 - so you won't have unwanted specular in Lambert lighting anymore. The normals are not being flipped nor shifted. Instancing for SpeedTree didn't make it's way to 5.4 for reasons mentioned earlier - there was too little time to test it.
     
    makeshiftwings likes this.
  5. uiniti

    uiniti

    Joined:
    Feb 4, 2015
    Posts:
    74
    What about Unity 5.3.x?

    I can't delay the fix for too long to test the 5.4 and hopefully be sure that there are no bugs.
     
  6. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Sorry to keep bringing up this thread but I still have questions. So the current fix, as I understand it, is that "Lambert" objects (ideal matte surfaces) now properly get rendered with zero specular highlights. This is probably a good fix but it means that now all SpeedTrees are rendered completely as infinite roughness Lambert surfaces? Leaves are not Lambert in real life; some of them are quite shiny. So I'm guessing this fix will only work until Unity at some point updates the SpeedTree shader to actually import the spec maps as well, right? And then we'll be back to white leaves again? It seems that the underlying problem is that the normals are messed up on leaves... this was maybe done on purpose to fake translucency? And now the fake translucency was just scrapped? Just trying to figure out how the trees will look in a month or so.
     
    uiniti likes this.
  7. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    smoothed normals are mainly used to hide the simple and flat geometry of the leave planes which usually would give you rather harsh lighting.
    using smoothed normals is ok as far as diffuse lighting is concerned. but unfortunately it breaks specular lighting.
    with current speedtree models?most likely yes.
    for my quick and dirty hack: "bring real translucency and specular lighting to speedtree" which i have posted earlier i had to edit the models in speedtree modeler and lower the smoothness factor for the normals.
    then the result looked like this (please notice: leaves do have specular highlights!):



    faked translucency btw. is not effected by doing "real" lambert lighting. it is achieved by setting cull to off, so faces pointing away from the camera still get rendered – but these faces point towards the light source thus they are lit much brighter which looks a bit like translucency in case half of the leaves ate lit "incorrectly" and the other half is lit properly. and shadows are enabled.
     
    makeshiftwings likes this.
  8. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    From the release notes of 5.4.0F2:

    Can anybody test it and see how it looks now? :)
     
  9. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    looks good
     
    eskovas likes this.
  10. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,902
    hi there,
    now that lambert lighting is fixed you should make the grass to render in deferred again as now it still looks like this:
    #pragma surface surf Lambert vertex:WavingGrassVert addshadow exclude_path:deferred
     
    makeshiftwings likes this.