The wonders of technical art (Unreal Engine)

12346

Replies

  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
  • edoublea
    Offline / Send Message
    edoublea polycounter lvl 8
    Obscura said:
    .... Increasing the mesh sdf res doesn't help.
    Not sure if this helps at all, but per-asset Mesh Distance Field resolution/scale has no effect on the Global Distance Field.  To increase that, you'll want to check & modify r.AOGlobalDFResolution and r.AOInnerGlobalDFClipmapDistance

  • RadiusGordello
    The global sdf is very low res. You can try increasing its resolution or decreasing the global distance field view distance in world settings.
  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
    Okay, thanks, I'll check them out. When I display the sdf or do some traces, and I move a mesh around, the mesh surface crosses the voxel boundaries which obviously leads to unwanted hits. I get this even with some initial position offset along the world normal. I will be interested to see how much can be the global sdf res increased, and how much it will cost.
  • edoublea
    Offline / Send Message
    edoublea polycounter lvl 8
    Be sure and exclude the mesh with your shader applied from the GDF (so you don't get false-positives by it sampling itself).  [Disable "Affect Distance Field Lighting" on the Actor]
  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
    I think I'm getting somewhere...


    @edoublea - Thanks for the help, but I'm applying the shader as a post process. 
  • Obscura
  • Obscura
  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
    Performance is alright with few ao rays, which gives this noisyness. The pictures shows only the ao pass result.
  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
    Some major quality improvements... Still 5 rays.

  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
    Radius 1

    radius 200


    radius 700

    radius 1500

  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
    The 5 rays 20 max steps is around 2,5 ms on 1080p. It could be optimized a little bit by using a lookup texture for the random directions, instead of using cell noise. But the global distance field samples are much more expensive than the cell noise itself...

    Not good, not horrible.
  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
    It would be cool if Unreal had multiple channels on the distance fields so it could store color and other stuff as well. 
  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
    I'm wondering if the initial hits can be reduced by calculating the normal of the sdf first, making an offset along that, and then use the world normal.
  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
    I didn't find the option to directly increase the res of the global sdf. But I found the view distance option, and pulling it closer makes things somewhat more highres close to the camera. Its still fairly lowres though.
  • edoublea
    Offline / Send Message
    edoublea polycounter lvl 8
    edoublea said:

    r.AOGlobalDFResolution
  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
    edoublea said:
    edoublea said:

    r.AOGlobalDFResolution
    Thanks, will check that out at the next possibility. I need to say that "ao" appearing in the command makes me kinda sceptical, as I'm using this in an indirect way. Hopefully it will yield the result I'm looking for. I also noticed that disabling dfao in the console makes my code not working.
  • edoublea
    Offline / Send Message
    edoublea polycounter lvl 8
    Yeah, I agree that the parameter names are confusing, but can guarantee that r.AOGlobalDFResolution controls the overall Global Distance Field (regardless of what samples it).


  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
    Wearing a cube on my "head" if I want to see the effect is also ridiculous. :D:D Is there any way to fix this?

    For recap, if I use a post process utilizing distance to nearest surface function in code, it only works if I have a mesh using the same function as a node, on screen. Otherwise I get black image. Like it doesn't render the global sdf if there isn't a mesh on screen using it and it doesn't  take pp-s into account.
  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
    In my implementation, the dfao is a custom skylight as a post process. So. I haven't tried , but does this work without a skylight? Ideally, I'd also like to disable every other feature, but keep the global sdf for my traces. Do you think thats possible? Like I said disabling dfao from the console basically disables the global sdf.
  • edoublea
    Offline / Send Message
    edoublea polycounter lvl 8
    Obscura said:
    In my implementation, the dfao is a custom skylight as a post process. So. I haven't tried , but does this work without a skylight? Ideally, I'd also like to disable every other feature, but keep the global sdf for my traces. Do you think thats possible? Like I said disabling dfao from the console basically disables the global sdf.
    Yes, it works fine with out a skylight.  

    Not certain about the second part...  I just tested locally, and I can absolutely set ShowFlag.DistanceFieldAO to "0" (which disables the visible DFAO effect), and the GDF sampling is still working fine.  So I'm not sure why yours seems to be disabling.
  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
    Cool. I find the custom dfao being pretty good even on low sample count.If you've been following the more recent posts, you can see that I use a method of sphere tracing multiple light rays if an sdf medium is available. otherwise you can use uniform step size. so i use cell noise function to generate random ray directions per pixel in a 180 degrees angle cone. this setup requires a nested loop. like light rays multiplied by sphere trace max step count. My recent results are 5-6 light rays, 10-20 max steps. If max steps were reached without a hit, sample the sky texture on some mip. Ray results are averaged at the end to get the final skylight value. Ao radius is max "t".
  • edoublea
    Offline / Send Message
    edoublea polycounter lvl 8
    Oh yeah, I've been following along.  I've been doing raymarching tests in Unreal for a few months, and I'm super impressed by the stuff you've been posting.  Haven't gone down the fractal structure or AO-sampling rabbit hole yet, but I'm sure I'll be doing that eventually.  Great work.

    My stuff has been more focused around integrating pure raymarched assets in and amongst "regular" geometric assets:
    https://twitter.com/edoublea/status/1169812517574434817


  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
    edoublea said:
    Yeah, I agree that the parameter names are confusing, but can guarantee that r.AOGlobalDFResolution controls the overall Global Distance Field (regardless of what samples it).


    This worked wonderfully. Although setting it to 512 puts my video memory almost full and its a 2080ti :'D So it should be used with caution. Hoping to see 32 gb consumer videocards in the upcoming releases :P
  • edoublea
    Offline / Send Message
    edoublea polycounter lvl 8
    Yeah, volume texture resources get outta' hand super quick!  Glad it's working.
  • Obscura
    Offline / Send Message
    Obscura veteran polycounter
    A discovery. Using the volume texture asset (you can create a volume texture asset from your regular texture), you get seam free tiling by default with those pseudo volume textures. This opens up a lot of interesting opportunities with volumetric fog and ray marching in general.
12346
Sign In or Register to comment.