Announcement

Collapse
No announcement yet.

Foliage shading softness

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Foliage shading softness

    Hello,

    Always having an issue with foliage shading model. It looks very nice and soft towards light source and so hard and noisy when you start looking to sides/back.
    I think if there was a way to make SSS affect surfaces even when you're not looking towards the light source it can help make the foliage look s a lot softer. Here's a detailed lighting view. You can see on the right it feels a lot more like grass and on the left it's more like hard spikes. Any solutions?


    Artstation
    Join the support channel
    Gumroad Store

    #2
    Are you using a normal map? What do your vertex normals look like? I can't say I've noticed this issue unless I have a very strong normal map and/or messy vertex normals. I generally have the meshes following the normal of the terrain, which helps make them feel more volumetric and softer in my opinion.
    Last edited by rosegoldslugs; 04-04-2018, 11:30 PM.
    Lighting Artist @ Rockstar Games
    ArtStation
    Twitter

    Comment


      #3
      Point all of the grass normals vertically or very close to it. It helps a lot with the shading. You shouldn't need to use SSS if you just use the foliage shading model(it has a lot of that stuff worked into it already).

      http://wiki.polycount.com/wiki/VertexNormal has some great information on normals.

      Comment


        #4
        Originally posted by rosegoldslugs View Post
        Are you using a normal map? What do your vertex normals look like? I can't say I've noticed this issue unless I have a very strong normal map and/or messy vertex normals. I generally have the meshes following the normal of the terrain, which helps make them feel more volumetric and softer in my opinion.

        It doesn't really look much different in regards to lighting whether there is a normal map or not. My mesh normals are pointing in their default directions. Making them point upwards means as if they are flat surfaces facing upwards and makes them reflect the Sun light unrealistically.






        I've setup a similar scene in cryengine, it helps demonstrating the issue better.
        In both cases Sun angle is 20 degrees. In cryengine it looks much more consistent. (It has a bit noise to it due to me not knowing how to switch to better AA in that engine).








        Artstation
        Join the support channel
        Gumroad Store

        Comment


          #5
          I can sleep a bit better now.
          Needs a bit more work though.



          Artstation
          Join the support channel
          Gumroad Store

          Comment


            #6
            well, how did you do it?
            Follow me on Twitter!
            Developer of Elium - Prison Escape
            Local Image-Based Lighting for UE4

            Comment


              #7
              Aye - be sure to post solution at some point!

              Comment


                #8
                Get directional light's right and left vector and use that to bump up SSS intensity in material, use forward vector to prevent SSS blowing up when looking towards direct light.
                I'm still tweaking and trying different things with it to make it look more like cryengine.
                Artstation
                Join the support channel
                Gumroad Store

                Comment


                  #9
                  So, here are my thoughts on foliage shading:

                  Firstly, it worth mentioning, that if tangent space normals are enabled in material, your normal will be flipped for backface. While it is desired behavior for grass cards with default normals, if you are using foliage with edited normals, the backfaces will have incorrect normals. Using foliage with edited normals implies disabling disabling tangent space normals and handling normals yourself in the material using two-sided sign.

                  Secondly, SSS and foliage shading models receive both direct and indirect subsurface color. The latter one is obtained by sampling environment cubemap in the direction, opposite of the normal. If your grass cluster normals are pointing upwards, they will sample the skylight from bottom part. Needless to say, that if skylight is set to use black for lower hemisphere, you won't get any subsurface from indirect light.

                  Thirdly, there needs to be a good balance between skylight and directional light intensity. In case, when latter is overly strong, there will be distinct separation between zones of dominant subsurface and surface, as shown by Maximum-Dev. It feels that tweaking subsurface intensity separately for direct and indirect light we pretty good thing to have, but this one would be only tweakable per light, not per material.

                  Fourthly, pointing grass normals straight up, as was mentioned, is a questionable suggestion, when realistic look is concerned. You'd want every grass blade to have some sort of distinct specular highlights, preferably corresponding to grass blade orientation, supported by normal map.

                  Fifthly, subsurface color should not differ considerably from albedo, when foliage is in question. This is actually quite important to overall look.

                  Sixthly, foliage shading model could be altered a bit.

                  Seventhly, if normal map is in use, it also helps if its intensity is high enough to shift surface-subsurface balance from card level to grass blade level.

                  Lastly, as suggested by Maximum-Dev, rotating normals towards camera instead of pointing them up, is a good supplement to unify grass shading, while not causing uniform ugly white sheen.
                  Last edited by Deathrey; 04-10-2018, 09:26 PM.

                  Comment


                    #10
                    Originally posted by Deathrey View Post
                    So, here are my thoughts on foliage shading:

                    Firstly, it worth mentioning, that if tangent space normals are enabled in material, your normal will be flipped for backface. While it is desired behavior for grass cards with default normals, if you are using foliage with edited normals, the backfaces will have incorrect normals. Using foliage with edited normals implies disabling disabling tangent space normals and handling normals yourself in the material using two-sided sign.

                    Secondly, SSS and foliage shading models receive both direct and indirect subsurface color. The latter one is obtained by sampling environment cubemap in the direction, opposite of the normal. If your grass cluster normals are pointing upwards, they will sample the skylight from bottom part. Needless to say, that if skylight is set to use black for lower hemisphere, you won't get any subsurface from indirect light.

                    Thirdly, there needs to be a good balance between skylight and directional light intensity. In case, when latter is overly strong, there will be distinct separation between zones of dominant subsurface and surface, as shown by Maximum-Dev. It feels that tweaking subsurface intensity separately for direct and indirect light we pretty good thing to have, but this one would be only tweakable per light, not per material.

                    Fourthly, pointing grass normals straight up, as was mentioned, is a questionable suggestion, when realistic look is concerned. You'd want every grass blade to have some sort of distinct specular highlights, preferably corresponding to grass blade orientation, supported by normal map.

                    Fifthly, subsurface color should not differ considerably from albedo, when foliage is in question. This is actually quite important to overall look.

                    Sixthly, foliage shading model could be altered a bit.

                    Seventhly, if normal map is in use, it also helps if its intensity is high enough to shift surface-subsurface balance from card level to grass blade level.

                    Lastly, as suggested by Maximum-Dev, rotating normals towards camera instead of pointing them up, is a good supplement to unify grass shading, while not causing uniform ugly white sheen.
                    Good post, but bending the normals is still an easier approach to take. Example: Look at how you handle foliage normals in speedtree. The same applies to grass. I should have reiterated that you don't have to point all of the vertices perfectly straight up, but transferring them from a spherelike object tends to give better results. Basically, all the normals bend slightly more toward the z-axis, with the topmost normals almost perfectly straight up. If needed, you can still mitigate a lot of the upper tip issues with normal maps or with a vector3 gradient for a normal(far cheaper route) that you have bending in a specific direction (you can calculate it based on things like light direction in an MPC).

                    It's always going to be a trade between quality vs performance. Strike a good balance of the two and accept that you're not going to get both.
                    Last edited by IronicParadox; 04-11-2018, 05:26 PM.

                    Comment


                      #11
                      Originally posted by Deathrey View Post
                      So, here are my thoughts on foliage shading:

                      Firstly, it worth mentioning, that if tangent space normals are enabled in material, your normal will be flipped for backface. While it is desired behavior for grass cards with default normals, if you are using foliage with edited normals, the backfaces will have incorrect normals. Using foliage with edited normals implies disabling disabling tangent space normals and handling normals yourself in the material using two-sided sign.

                      Secondly, SSS and foliage shading models receive both direct and indirect subsurface color. The latter one is obtained by sampling environment cubemap in the direction, opposite of the normal. If your grass cluster normals are pointing upwards, they will sample the skylight from bottom part. Needless to say, that if skylight is set to use black for lower hemisphere, you won't get any subsurface from indirect light.

                      Thirdly, there needs to be a good balance between skylight and directional light intensity. In case, when latter is overly strong, there will be distinct separation between zones of dominant subsurface and surface, as shown by Maximum-Dev. It feels that tweaking subsurface intensity separately for direct and indirect light we pretty good thing to have, but this one would be only tweakable per light, not per material.

                      Fourthly, pointing grass normals straight up, as was mentioned, is a questionable suggestion, when realistic look is concerned. You'd want every grass blade to have some sort of distinct specular highlights, preferably corresponding to grass blade orientation, supported by normal map.

                      Fifthly, subsurface color should not differ considerably from albedo, when foliage is in question. This is actually quite important to overall look.

                      Sixthly, foliage shading model could be altered a bit.

                      Seventhly, if normal map is in use, it also helps if its intensity is high enough to shift surface-subsurface balance from card level to grass blade level.

                      Lastly, as suggested by Maximum-Dev, rotating normals towards camera instead of pointing them up, is a good supplement to unify grass shading, while not causing uniform ugly white sheen.
                      Regarding that last line, here's how that looks like in cryengine.







                      It makes a lot of difference in grass softness and consistent lighting, reducing the spiky look as well as receiving better SSS.
                      I'm doing a bit of experimenting with two sided shader code atm (trial and error) and made some improvements. But I haven't been able to do this normal orientation thing in UE4 so far. :s
                      Artstation
                      Join the support channel
                      Gumroad Store

                      Comment


                        #12
                        It does help, but it is not targeted at issue with seeing distinct zones, when looking perpendicular to light direction. Well it does help, but to limited extent.

                        https://imgsli.com/MTM1NA

                        https://imgsli.com/MTM1NQ







                        Comment


                          #13
                          I'll just go ahead and mention, IMO, that in DEATHRAY's comparison I vastly prefer the left.

                          Every artist in every game seems to want the "soft, indistinct" grass look, and in my experience this just doesn't look good nor realistic. Grass doesn't magically fade into the ground, nor become blurry and indistinct in life. Why there's the obsession with doing so in ALL game art is beyond me. I understand art direction, but it's in every game regardless as if this is somehow "correct".

                          Here's an example I took personally of a little grassy dip. You can clearly see each blade of grass, just how distinct and contrasty it is from the ground, and just how sharp and spiky it feels:

                          Comment


                            #14
                            Originally posted by Frenetic Pony View Post
                            I'll just go ahead and mention, IMO, that in DEATHRAY's comparison I vastly prefer the left.

                            Every artist in every game seems to want the "soft, indistinct" grass look, and in my experience this just doesn't look good nor realistic. Grass doesn't magically fade into the ground, nor become blurry and indistinct in life. Why there's the obsession with doing so in ALL game art is beyond me. I understand art direction, but it's in every game regardless as if this is somehow "correct".

                            Here's an example I took personally of a little grassy dip. You can clearly see each blade of grass, just how distinct and contrasty it is from the ground, and just how sharp and spiky it feels:
                            An issue we have in game engines is that they are still very far from emulating real life physics, we just dont have the ability to make everything 100% accurate to real life, and in our attempt to do so with current techniques a lot of the time produces sub par results. So although the shading method above is not exactly accurate to real life, it is more pleasing on the eye within our current limitations.
                            Stylized Low Poly Environment
                            Stylized Low Poly Pine Forest
                            Stylized Low Poly Buildings
                            First Person Horror Template

                            Comment


                              #15
                              @Deathrey,

                              Found a solution. Changing 2 values in shader code solves the problem forever. Check it out in the link below!

                              https://imgsli.com/MTM1Ng

                              Up there I'm using one direct light at 20 degrees angle, it's shining from right to left with 125,000 Lux (bright sunny day) it's definitely the left image that's looking wrong and the modified shader looks a lot more believable.
                              And here's the material setup, a bit shifting SSS to yellow just so we can feel some light passing through.



                              If I use your normal orientation setup along with the modified shader it will look a little nicer than what I posted above. Thanks a lot for that.
                              Will do a some tweaking with values in shader code and share it here in a bit.
                              Last edited by Maximum-Dev; 04-11-2018, 07:39 PM.
                              Artstation
                              Join the support channel
                              Gumroad Store

                              Comment

                              Working...
                              X