Announcement

Collapse
No announcement yet.

Dynamic blob shadow ?

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

    #61
    Originally posted by xDiavalx View Post
    If that doesn't work, you can get the showdown VR demo and look at the Robot blueprint in the scene. There is BlobShadow1 through 4 static meshes with an instance of the WorldSpaceBehindTranslucency material set up. I guess it is best if you just copy that.
    That's what I am using. The thing is that Showdown happens on a flat floor at constant Z. So it's not applicable to general levels, where actors that should be casting blob shadows can be anywhere on Z and floors can be as uneven as they come.

    Also, I can't use deferred decals for mobile - they too performance taxing (and I don't recall if they even work in mobile VR)

    Comment


      #62
      Originally posted by xDiavalx View Post
      [MENTION=3692]RyanB[/MENTION] :
      1.a.:Are Sphere_AO and SphereMask the same thing (under the hood)? - I guess SphereMask also has a built-in power function (to control the "Hardness").
      1.b.: Is SphereMask as expensive as Sphere_AO with a power node and its position calculation tweaked?

      2.a.: If I understood you correctly, the WorldSpaceBehindTranslucency method is performance equivalent to a decal actor, but has the advantage that it is possible to optimize the mesh shape (which saves on overdraw). Is this still correct? Are decal actors not more optimized, because they are built for the specific purpose?
      2.b.: I can copy the WorldSpaceBehindTranslucency method from the Showdown VR demo, so this is not very important to me, but I suggest Epic could use the subUV-cut-out tech that you use for particles and apply it on decal meshes (as an opt-in option). Does that sound like a good idea?
      2.c.: I compared the system suggested in 2.b. with the new decal mesh feature. And as far as I understand decal meshes derive their projection direction from their vertex or point normals. Is that correct?

      3. How is the new forward render (theoretically) affecting the WorldSpaceBehindTranslucency and the decal method performance wise?

      [MENTION=1680]motorsep[/MENTION]: You can get the CouchKnight project and look at the blueprint of the playable character (the knight girl). It has decals attached to its feet that function as shadows. You should try using that method.

      If that doesn't work, you can get the showdown VR demo and look at the Robot blueprint in the scene. There is BlobShadow1 through 4 static meshes with an instance of the WorldSpaceBehindTranslucency material set up. I guess it is best if you just copy that.

      SphereAO is different from spheremask. It is meant to return the fraction of a hemisphere that would be occluded by a sphere of a given size and location. It returns this value for a given position in the world. It can be used in lighting functions or used directly but it probably will not look that interesting by itself.

      Sphere AO shown as an unlit material. Note that sphere AO goes black when the geometry is inside of the sphere radius as shown when the sphere is hidden:



      Here is the whole material. A blueprint sets the S parameter based on an editable vector variable that I marked "show 3d widget" which lets it be dragged around. Great feature for debugging:
      Click image for larger version

Name:	sphereAOmat.JPG
Views:	2
Size:	33.7 KB
ID:	1120019

      Mesh decals are more intended for things like destruction of edges where you can model the decal geometry to fit exactly. For foot shadow type stuff youd probably want to stick to either regular decals or box mesh with world position behind translucency.

      The more uneven gaps you want to support, the more conservative you need to be with the oversizing of your geometry. Ie in the bullet train case they could be relatively flat since we knew the floor was flat in the gameplay area and the effect was disabled until enemies got there.
      Attached Files
      Last edited by RyanB; 12-12-2016, 11:44 PM.
      Ryan Brucks
      Principal Technical Artist, Epic Games

      Comment


        #63
        As far as how to set up the worldposition behind translucency, here is a super basic example with emissive green, using actor position. Actual implementations will need to pick shadow color somehow or use alphacomposite to decide how to blend, and ActorPosition will likely need to be set via a bone location using an MID, or use 0,0,0 transform local->world or something, depending on how you attach. And you can definitely try to fit the shape better since I just used a cube here:



        To support camera going inside the box, use a box with inverted faces, disable depth test in the material settings and use depthfade as a final multiplier on the opacity. This is effectively doing custom sorting with opaque geometry.
        Last edited by RyanB; 12-12-2016, 11:41 PM.
        Ryan Brucks
        Principal Technical Artist, Epic Games

        Comment


          #64
          Originally posted by RyanB View Post
          As far as how to set up the worldposition behind translucency, here is a super basic example with emissive green, using actor position. Actual implementations will need to pick shadow color somehow or use alphacomposite to decide how to blend, and ActorPosition will likely need to be set via a bone location using an MID, or use 0,0,0 transform local->world or something, depending on how you attach. And you can definitely try to fit the shape better since I just used a cube here:

          [ATTACH=CONFIG]121329[/ATTACH]

          To support camera going inside the box, use a box with inverted faces, disable depth test in the material settings and use depthfade as a final multiplier on the opacity. This is effectively doing custom sorting with opaque geometry.
          It seems that attachment is borked. Could you please re-attach ?

          Comment


            #65
            retrying attachment
            Click image for larger version

Name:	FakeShadow.JPG
Views:	1
Size:	75.2 KB
ID:	1120086
            Attached Files
            Last edited by RyanB; 12-14-2016, 01:04 AM.
            Ryan Brucks
            Principal Technical Artist, Epic Games

            Comment


              #66
              [MENTION=3692]RyanB[/MENTION] I've tried the box + position behind translucency approach and it works, except that the character is also shadowed since it's inside the box. What would you recommend to avoid the cube/shadow from being rendered over the character?

              Comment


                #67
                There are a few options. I usually get the World Normal and extract the B channel and use that as a mask. That way only upwards facing polys get affected strongly which tends to help. You could also try masking by things like shading model.
                Ryan Brucks
                Principal Technical Artist, Epic Games

                Comment


                  #68
                  Originally posted by RicarDog View Post
                  [MENTION=3692]RyanB[/MENTION] I've tried the box + position behind translucency approach and it works, except that the character is also shadowed since it's inside the box. What would you recommend to avoid the cube/shadow from being rendered over the character?
                  Do you think you can post your scene setup and material setup, please?

                  Comment


                    #69
                    Originally posted by motorsep View Post
                    Do you think you can post your scene setup and material setup, please?
                    This is my blob material:
                    Click image for larger version

Name:	blob material.png
Views:	1
Size:	189.1 KB
ID:	1129405

                    I use BlobRadius as a scalar parameter to set the blob radius and ShadowColor as a vector parameter to set the shadow color and opacity. My texture sample uses a texture from the engine contents located in EngineVolumetrics\LightBeam\Materials\T_EV_LightBeam_Falloff_02.uasset.

                    This material is applied to a cube mesh that is bound to the character position.
                    Last edited by RicarDog; 06-11-2017, 11:32 PM.

                    Comment


                      #70
                      [MENTION=59499]RicarDog[/MENTION]

                      Tested your setup - unfortunately it doesn't quite work (size/intensity doesn't change as object moves away from the surface) and it totally doesn't work in Android (ES2) preview



                      This is how it looks on the device:
                      Click image for larger version

Name:	com.Supranormal.GVR_Ph_C_Titan_08-20170612-215623.jpg
Views:	1
Size:	59.1 KB
ID:	1129447
                      [MENTION=3692]RyanB[/MENTION] Any idea by chance why that material won't work in ES2 ?
                      Last edited by motorsep; 06-12-2017, 11:02 PM.

                      Comment


                        #71
                        Originally posted by motorsep View Post
                        [MENTION=59499]RicarDog[/MENTION]
                        Tested your setup - unfortunately it doesn't quite work (size/intensity doesn't change as object moves away from the surface) and it totally doesn't work in Android (ES2) preview
                        Well, it's not supposed to change as it moves away. The cube must remain on the surface at all times. If you want your character to jump and change the blob accordingly, you have to manually set the desired the radius / color depending on the character's height.

                        I use this to set the cube position according to the character's position (based on a bone) in the character blueprint:
                        Click image for larger version

Name:	blob.png
Views:	1
Size:	102.3 KB
ID:	1129770
                        The Shadow Blob here is the cube mesh. I ignore the height to keep the cube grounded. You can work from there to set material properties such as the blob radius and color based on the Z coordinate.

                        Comment


                          #72
                          Hello, I looking for the way to make blow shadow mat, can anyone share please the material? Thank you.

                          Comment


                            #73
                            Originally posted by RyanB View Post
                            There are a few options. I usually get the World Normal and extract the B channel and use that as a mask. That way only upwards facing polys get affected strongly which tends to help. You could also try masking by things like shading model.
                            Sorry for the necropost, but can anyone help me out with this? RyanB's "worldposition behind translucency" method is working great, but I can't figure out either of the two options he mentioned for preventing the shadow from affecting the character.

                            Comment

                            Working...
                            X