Announcement

Collapse
No announcement yet.

Distance Field Ambient Occlusion (Movable Skylight shadowing)

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

    #31
    There's one part I didn't get: since there is a field per mesh, how are they iterated? Are all fields loaded at once and the GPU picks the ones that intersect with the current sample point or is it the other way around, iterating over each field and finding out which sample points fall inside them?
    I ended up using the rasterizer to scatter each object into tile lists by rendering a bounding sphere. It turned out to be 10x faster than a tiled gather implementation. There are a lot of small samples, which tiled culling doesn't do well with.

    I also don't quite understand why they need to be signed. Wouldn't just the distance to the closest surface be enough?
    The sign is required for interpolation to work correctly. The magic of using distance fields to represent surfaces is that you can store the distance field at a pretty low resolution, and reconstruct the original surface (distance = 0) after interpolation really accurately (except on corners, they get rounded out). If you store unsigned distance, the distance field will never be 0 after interpolation.

    Comment


      #32
      Originally posted by DanielW View Post
      Only the pixels on your screen are considered for lighting, so if you moved the camera around you would quickly see areas that did not have lighting computed. It doesn't simulate the entire level. The algorithm already reuses shading work on surfaces that do not move between frames.
      Oh, I didn't realise it was being done in the traditional deferred way, as usually this sort of thing is done globally from what I've seen. Looking forward to messing around with it, and thanks again for the reply. Glad to hear about the optimisation also, because now you've explained it there's no real need for a static version anymore in my head.

      Comment


        #33
        Originally posted by DanielW View Post
        That does make me sad. I'm looking into it
        I downloaded latest build from GitHub and now it works, but I discovered another bug.

        When you enable Distance Fields in rendering settings and place any full meshes (that is fully closed) this happens in viewport:

        https://dl.dropboxusercontent.com/u/...ance-field.png

        The black walls are BPS and the black mesh in middle in static mesh without one face.

        Disabling this option put everything to normal (or just not using closed meshes).
        https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

        Comment


          #34
          Will landscape support be added in the future?

          Love how it looks btw. Really great work.

          Comment


            #35
            I think it can work with landscape, the main challenge is getting the distance field volumes to tightly bound each section. Large objects tend to cause artifacts as they don't get high enough resolution, because volume textures don't scale up very well (memory gets out of hand quickly).

            Comment


              #36
              Doc is now up!

              And a video of it in action (Fortnite)
              http://youtu.be/FmbrnbpHT9E

              Comment


                #37
                Originally posted by DanielW View Post
                Doc is now up!

                And a video of it in action (Fortnite)
                http://youtu.be/FmbrnbpHT9E
                Awesome video!

                I particularly liked watching what happened when you started deleting stuff from the scene! Amazing!

                Thanks for sharing Daniel!



                Rama
                UE4 Marketplace: Melee Weapon Plugin & Compressed Binary Save System Plugin | Rama's C++ AI Jumping Videos | Vertex Snap Editor Plugin

                ♥ Rama

                Comment


                  #38
                  So exactly how unstable is the solution? I tried it in the FPS template of the preview build with the starter architecture meshes and the AO shadows seem to move a lot when I rotate or move the view. The shadows sort of shimmer or move.

                  Comment

                  Working...
                  X