Announcement

Collapse
No announcement yet.

Finally, Parallax Occlusion Mapping!!

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

    #31
    SF: For other distribution methods, you could look at Sellfy; they have a good thing where the item is bought, and if you upload another version, the people that have paid for it already can re-download it for no cost. Not exactly an "updater" per se, but its another option for you.

    I'm looking forward to this shader btw. Thanks for tackling this!
    WIP: Science Project - A collection of middle school through advanced college level science theory and formula-based functions for use in your own projects
    World Machine to UE4 Export Macro
    WM Folder Generator - Creates a folder that you name with HeightMap, NormalMap, SplatMap, and Tile sub-folders

    Comment


      #32
      Just added the first version of self-shadowing!

      Here's a visualization of the displaced heights I'll use as an example. White is closer to the camera:



      This is an unmodified /Engine/MapTemplates/TestCard being displayed on a flat quad. I like to use TestCard with a really large parallax scale for debugging because it demonstrates a bunch of worst case scenarios (nearly-vertical drops, axis-unaligned shapes, high frequency surfaces, and thin features to be exact). You can assume that any examples I show using TestCard will look even better with typical assets, or assets authored with POM's limitations in mind.

      Hard shadowing:



      (Just multiply this by a fraction to get lighter shadows, or leave as-is for a very stark comic book lighting effect)

      Soft shadowing raised to the power of 3:





      The shadow layer is its own output so you can use it in your PBR or unlit material workflows however you like. This flexibility even allows you to process the shadows separately. Imagine a small amethyst structure letting glassy purple light through, or a magical water structure forming and casting panned caustic patterns on itself!

      It also includes a tweakable shadow offset so you can trade artifacts for accuracy as you like, or do weird effects.

      Note too how unlike most solutions which assume a directional light vector, the shadows are distorted as if emanating from a point source. This makes the effect much more convincing on large surfaces. The function simply takes a world space position as input. This is a huge advantage if you have multiple self shadowed materials, as it means you don't need to calculate and pass a different light vector to each one in the blueprints. If you want a directional light, you can simply pass in a light source position relative to the the pixel position. Want to simulate a flickering fire? Just jitter the position input over time! You can also do neat glitch effects by passing in positions which change per-pixel in unrealistic ways. Maybe a phantom that emits light but causes shadows that ripple?

      Next I'm going to add support for light sources of varying widths. Will update with results!
      Senior CEO in Chief of Game Builder Club and Building 3d Game Birds Gameapp Maker Co.

      Oldskooler PreDigital CRTify illustrious Patreon

      Comment


        #33
        Experimented with penumbra estimation for soft shadows. It added a huge amount of graph complexity for a relatively minor effect. Couldn't get it to a state I'd be happy with in a timely manner so I'm shelving that feature for now. May or may not come back in a future version.
        Senior CEO in Chief of Game Builder Club and Building 3d Game Birds Gameapp Maker Co.

        Oldskooler PreDigital CRTify illustrious Patreon

        Comment


          #34
          This looks pretty amazing! I'm excited to see this being implemented with such care and precision.
          CTO Villusion Studios
          Grad Student in Interactive Design and Game Development, SCAD
          company site: http://www.villusionstudios.com/

          Comment


            #35
            Hey look, working POM on landscapes!!



            Big thanks to mAlkAv!An for pointing out the bug preventing this from working in the other thread. What a ridiculous naming collision!
            Senior CEO in Chief of Game Builder Club and Building 3d Game Birds Gameapp Maker Co.

            Oldskooler PreDigital CRTify illustrious Patreon

            Comment


              #36
              Wow !

              This gonna be good !
              ArtStation

              General Development Blog

              Comment


                #37
                holy moly. amazing stuff.

                Comment


                  #38
                  So I experimented further with the issue that causes POM to look totally flat on terrain. It's not actually the naming collision mAlkAv!An pointed out after all! I'm not sure what it is, but it reoccurs after editor restarts even if I named the heightmap texture object parameter something like "flippitygibbert". If I then rename it again, it'll go back to working. This definitely seems to be an engine bug, and worth noting if you plan to use this on terrain.

                  So anyway, I updated the silhouette clipping to no longer generate an opacity mask, it just discards pixels it shouldn't care about. I do this in two passes: First to discard anything outside of the user-specified UV boundaries, and again to carve out the edges defined by the parallax effect. This is easier to set up for the user, needs way fewer wires, and provides some great early-outs. I'm making sure that the ray tracer terminates as soon as it realizes a pixel won't be used. This also means (I think?) that said pixels will be culled from the depth buffer like they should be, preventing them from interfering with other effects, and no longer requiring you to use a "masked" material. The results are really good! Here are some shots of just the shadow layer on a flat surface:









                  These are with reasonable sample values too, I didn't turn them way up for the screenshot.

                  Worth noting: Contrary to what's been said in the other thread, samples can be quite expensive, especially since these loops involve dependent texture fetches. ATI specifically recommends people use procedurals or conditional branching in lieu of sampling values wherever possible these days. Clipping can also be expensive, but it's of most concern on older hardware where you probably wouldn't be using this effect anyway.

                  Speaking of shadows, here are some examples of shadows from a point light on terrain!







                  I'll try it with a less distractingly noisy heightmap some time, but you can see the ridges darkening on faces shielded from the light source, as well as how the light vector is being determined per-pixel in world space (this also makes the Blueprint setup much easier). All I'm doing is raising the shadow output to an aesthetically pleasing power, then multiplying it with my AO map. They're never going to be physically accurate for PBR, but they still do a great job of conveying believable shape. You can of course use the shadows however you want, since they're output separately. This means they work especially nicely with stylized environments, "fake" lighting, or all-emissive workflows (imagine this + hard shadows in a cel shaded game!).

                  Here's a more typical use case. Look at how nice the definition on the bricks becomes:





                  More to come soon!
                  Senior CEO in Chief of Game Builder Club and Building 3d Game Birds Gameapp Maker Co.

                  Oldskooler PreDigital CRTify illustrious Patreon

                  Comment


                    #39
                    Originally posted by SF View Post
                    So I experimented further with the issue that causes POM to look totally flat on terrain. It's not actually the naming collision mAlkAv!An pointed out after all! I'm not sure what it is, but it reoccurs after editor restarts even if I named the heightmap texture object parameter something like "flippitygibbert". If I then rename it again, it'll go back to working. This definitely seems to be an engine bug, and worth noting if you plan to use this on terrain.

                    So anyway, I updated the silhouette clipping to no longer generate an opacity mask, it just discards pixels it shouldn't care about. I do this in two passes: First to discard anything outside of the user-specified UV boundaries, and again to carve out the edges defined by the parallax effect. This is easier to set up for the user, needs way fewer wires, and provides some great early-outs. I'm making sure that the ray tracer terminates as soon as it realizes a pixel won't be used. This also means (I think?) that said pixels will be culled from the depth buffer like they should be, preventing them from interfering with other effects, and no longer requiring you to use a "masked" material. The results are really good! Here are some shots of just the shadow layer on a flat surface:



                    These are with reasonable sample values too, I didn't turn them way up for the screenshot.

                    Worth noting: Contrary to what's been said in the other thread, samples can be quite expensive, especially since these loops involve dependent texture fetches. ATI specifically recommends people use procedurals or conditional branching in lieu of sampling values wherever possible these days. Clipping can also be expensive, but it's of most concern on older hardware where you probably wouldn't be using this effect anyway.

                    Speaking of shadows, here are some examples of shadows from a point light on terrain!



                    I'll try it with a less distractingly noisy heightmap some time, but you can see the ridges darkening on faces shielded from the light source, as well as how the light vector is being determined per-pixel in world space (this also makes the Blueprint setup much easier). All I'm doing is raising the shadow output to an aesthetically pleasing power, then multiplying it with my AO map. They're never going to be physically accurate for PBR, but they still do a great job of conveying believable shape. You can of course use the shadows however you want, since they're output separately. This means they work especially nicely with stylized environments, "fake" lighting, or all-emissive workflows (imagine this + hard shadows in a cel shaded game!).

                    Here's a more typical use case. Look at how nice the definition on the bricks becomes:



                    More to come soon!
                    Fantastic!
                    Really hope the landscape issue can be fixed though, being able to use proper POM on landscape is important for our project.

                    Comment


                      #40
                      I haven't tested it with packaged projects. It's possible the flatten-on-reset thing only happens inside the editor.
                      Senior CEO in Chief of Game Builder Club and Building 3d Game Birds Gameapp Maker Co.

                      Oldskooler PreDigital CRTify illustrious Patreon

                      Comment


                        #41
                        Originally posted by SF View Post
                        I haven't tested it with packaged projects. It's possible the flatten-on-reset thing only happens inside the editor.
                        Right, hopefully that works! Really looking forward to testing out your pom setup.
                        Any news on when you'll submit it?

                        Comment


                          #42
                          Originally posted by Sitrec View Post
                          Right, hopefully that works! Really looking forward to testing out your pom setup.
                          Any news on when you'll submit it?
                          I hesitate to say outright because it's so hard for me to keep to a schedule ; ; Especially since I'm in the middle of switching meds and it's wrecking my ability to perform basic tasks let alone focus on work. Here's what's left to do at any rate:
                          • Make the content/tutorial walkthrough
                          • Fix the LOD system on Macs (I was relying on CalculateLevelOfDetail)
                          • Work out the boring legal stuff


                          So not that much really! I'm also juggling multiple other graphics effect projects I haven't talked about yet which should be out much faster than this one.

                          Oh one other thing I plan to do is create several leaner versions of the material function, so the user can just drag and drop the one they want rather than having a giant set of unused inputs all the time. This will also be more performant as well as more modding friendly, since the graph is complex enough without adding a forest of static switches.
                          Senior CEO in Chief of Game Builder Club and Building 3d Game Birds Gameapp Maker Co.

                          Oldskooler PreDigital CRTify illustrious Patreon

                          Comment


                            #43
                            Good news! I just confirmed on AnswerHub that I can sell this package on 3rd party sites! That means the day it's ready I'll have it up on my itch.io page for you to purchase! I can then use its customer tracking to email everyone who buys it with update links as they're released. I'm tempted to put it up there as an early access thing even, if you don't mind paying for it still unpolished.
                            Senior CEO in Chief of Game Builder Club and Building 3d Game Birds Gameapp Maker Co.

                            Oldskooler PreDigital CRTify illustrious Patreon

                            Comment


                              #44
                              I would love early access! Would you mind also making a short video tutorial on how it works and all the material hookups?
                              --
                              Joshua
                              Multimedia Artist, Druid Gameworks
                              www.joshuaezzell.com
                              www.druidgameworks.com

                              Comment


                                #45
                                Will do! At least, I'll make a video post-release. The 1.0 version will include lots of drag and drop working material examples as well.
                                Senior CEO in Chief of Game Builder Club and Building 3d Game Birds Gameapp Maker Co.

                                Oldskooler PreDigital CRTify illustrious Patreon

                                Comment

                                Working...
                                X