Announcement

Collapse
No announcement yet.

Dynamic blob shadow ?

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

    Dynamic blob shadow ?

    As you may know, dynamic shadowing in mobile VR is a no-go.

    Is there a way to have super basic blob shadows under the character?

    In idTech 4 engine (Doom 3) there was a special type of light called blend light. You could create a blob shadow image and have it projected under character's feet (light source would be attached to the character to follow around). Is something similar (or better and as cheap, performance wise) possible with UE4 ?

    Thanks.

    #2
    Im pretty sure 4.11 has introduced this to capsule components or something similar.
    Stylized Low Poly Environment
    Stylized Low Poly Pine Forest
    Stylized Low Poly Buildings
    First Person Horror Template

    Comment


      #3
      Yeah, saw that, but I don't know if it will perform well in mobile VR.

      Comment


        #4
        You can use either a decal or the material function "world position behind translucency" to map a blob shadow that is attached to your character to the ground.
        Ryan Brucks
        Principal Technical Artist, Epic Games

        Comment


          #5
          Originally posted by RyanB View Post
          You can use either a decal or the material function "world position behind translucency" to map a blob shadow that is attached to your character to the ground.
          Which one is less performance taxing out of those two?

          Are there any tutorials about either of those methods? (I am quite new to UE4)

          Thanks.

          Comment


            #6
            well the 'Worldpos behind translucency' is in theory able to work on lower spec since it will not require gbuffer or decals to be enabled. If they are enabled I would expect a pretty similar cost for both methods but haven't compared. I would probably use translucency for simplicity as well but thats just me.
            Ryan Brucks
            Principal Technical Artist, Epic Games

            Comment


              #7
              Originally posted by RyanB View Post
              well the 'Worldpos behind translucency' is in theory able to work on lower spec since it will not require gbuffer or decals to be enabled. If they are enabled I would expect a pretty similar cost for both methods but haven't compared. I would probably use translucency for simplicity as well but thats just me.
              Aye, but Google returns nothing about "world position behind translucency" :/

              I found a link to blob shadows with UDK https://udn.epicgames.com/Three/Deve...lobShadow.html but not sure if it's translatable into UE4 as is (except Unreal script part).

              Comment


                #8
                Originally posted by RyanB View Post
                You can use either a decal or the material function "world position behind translucency" to map a blob shadow that is attached to your character to the ground.
                noob question, in what context are you referring to with regards to the material function of blob shadow for "world position behind translucency" method? do you mean like a separate static mesh attached?

                Comment


                  #9
                  When you draw transparent object you can get world position from pixel behind it using "world position behind translucency" node. If you know position of shadow caster and receiver you can easily calculate blob shadow analytically. There is Sphere_AO node that you can use.

                  Comment


                    #10
                    Originally posted by Jenny Gore View Post
                    When you draw transparent object you can get world position from pixel behind it using "world position behind translucency" node. If you know position of shadow caster and receiver you can easily calculate blob shadow analytically. There is Sphere_AO node that you can use.
                    thanks! learnt something new

                    Comment


                      #11
                      Originally posted by Jenny Gore View Post
                      When you draw transparent object you can get world position from pixel behind it using "world position behind translucency" node. If you know position of shadow caster and receiver you can easily calculate blob shadow analytically. There is Sphere_AO node that you can use.
                      Would that be performance taxing in mobile VR ?

                      Comment


                        #12
                        Not especially, but it will depend on how conservative you are with your mesh sizes and overdraw etc . I prefer the wpo-behind-translucency since it lets you cut your geo closer to your alpha to get to optimize the overdraw a bit more than you can do using a decal.
                        Ryan Brucks
                        Principal Technical Artist, Epic Games

                        Comment


                          #13
                          Aye, sounds almost like reading John Carmack's twitter :P I totally have no clue what you just said, RyanB, sorry

                          I am surprised no tutorials available on this subject

                          Comment


                            #14
                            Overdraw is simply where multiple layers of translucency stack on screen. If your translucent material had black in the alpha, that means that parts of the material were "rendered" only to be invisible in the final result. Even though those pixels were invisible, they cost just as much as the visible pixels. So you can see how if you have a HUGE polygon just to have a small translucent effect, it will be very inefficient. Making the geometry fit closely around only the visible parts of your opacity mask is something you should always do when possible.

                            For instance if you have a blob shadow (round), then all of the corners of a square polygon are going to be wasted overdraw. Simply turning the quad into an octagon by cutting a bit off all of the corners will make a big difference and save many wasted pixels from rendering. You could tesellate more and more to reduce overdraw but at some point you would start causing the scene to be too expensive from polygons so it is best to find some middle ground. Ie just making the shape an octagon is a good compromise because its still low poly and cuts away most of the overdraw.

                            For a circle or blob shadow you could calculate the savings.

                            A square of pixels 100x100 has an area of 10,000 pixels that all have to be rendered.
                            A circle with a diameter of 100 has an area of only 7,853. So by rendering a circle using square geometry you would be wasting ~1,200 pixels or 12% of the cost. This is probably not a huge deal in this case but for some shapes it can make a huge difference.

                            for particle systems, a feature was recently added to cut out the geomtry specifically for subUVs automatically for particle systems. Probably 4.12.
                            Ryan Brucks
                            Principal Technical Artist, Epic Games

                            Comment


                              #15
                              Alright, thanks. Make sense. How do I set up the whole thing?

                              I assume I need to make octagon mesh with my black'ish blob image on it, bring it to UE4, attach it to the character at character's feet and make it not show in the game. How do I set up material for it, so it's "projected" to the floor/ground? Or is it a blueprint setup?

                              Comment

                              Working...
                              X