Terminating the Shadow Terminator Problem (Jagged Shadows)

Поділитися
Вставка
  • Опубліковано 15 лис 2024

КОМЕНТАРІ • 40

  • @Siphonife
    @Siphonife 8 місяців тому +1

    amazing explanation and multiple options demonstrated.

  • @AndreySokolovRu
    @AndreySokolovRu Рік тому +1

    Thank you! For some reason the hints with splitting shadow pass for World Position Offset doesn't work in Path Tracer (Evaluate World Position Offset in Ray Tracing is enabled). You can offset the whole mesh, you can even affect indirect passes with PathTracingRayTypeSwitch node, but artefacts in shadows remain.

    • @TechArtAlex
      @TechArtAlex  Рік тому +1

      Indeed, I am unfortunately not aware of any way to make this work with the path tracer. You'll have to just use higher resolution geometry and hope for the best there. Thanks for watching!

  • @ahtiandr
    @ahtiandr Рік тому +4

    Wow, the timing of your video is very spot on. I have been struggling with this exact issue while rendering with path tracer whole day and finally this looks like a solution to try! Thanks a lot and I will update my progress here.

    • @TechArtAlex
      @TechArtAlex  Рік тому

      This issue definitely happens often with the Pathtracer, however unfortunately I don't believe the Shadow Pass Switch applies to Raytraced Shadows or the Pathtracer. There is a Pathtracing Switch and a Raytracing Switch, but neither seem to work with the WPO output. Therefore I think the only method that will work in the Pathtracer at this time is to subdivide the model until the terminator problem disappears. I'd love to hear if you have success though. Thanks for watching!

    • @Bashyb
      @Bashyb Місяць тому

      I’m running into the same issue with only path tracer mode, but only with the geometry collection after the fracture happens with my low poly wood crate that I’m splintering and breaking, and I also noticed it only happens when the reference atmosphere option is enabled in post process volume. I’ve used the fix vertex normals utility tool and it hasn’t worked. Im using the Cvar for enabling ray tracing and wpo on static and instanced static meshes but the shadow flickering keeps happening. I’m looking into the path tracing switch node at the moment

  • @EarlyMorrow3D
    @EarlyMorrow3D 8 місяців тому

    Thanks for creating this video and explaining it in full detail!

  • @YuuJer
    @YuuJer Рік тому +1

    oooh thanks! I've seen this issue before, but didn't delve deep into ways that it could be addressed, the shadow pass switch is pretty cool

    • @TechArtAlex
      @TechArtAlex  Рік тому +1

      It is a great feature and often overlooked. Thanks for watching!

    • @YuuJer
      @YuuJer Рік тому +1

      @@TechArtAlex your video tricks are great!

  • @miabrown777
    @miabrown777 Рік тому +1

    Thank you. Amazing explanation

    • @TechArtAlex
      @TechArtAlex  Рік тому +1

      You're welcome - Thanks for watching!

  • @redsnow936
    @redsnow936 Рік тому

    As always some really high quality advanced techniques! i really love ur tutorials, thank you

  • @armondtanz
    @armondtanz Рік тому +1

    Hey this is brilliant, learned so much, subbed ;). Was hoping you could look into Rect Lights, when i use them they always cast a blocky shadow , drives me nuts for a solution. Cheers

    • @TechArtAlex
      @TechArtAlex  Рік тому

      Sorry for the late reply, unfortunately I haven't been able to replicate this issue, so I'm not sure what is wrong.

  • @matteckenrodt
    @matteckenrodt Рік тому +1

    Really cool learning about a problem I didn't even know I had until watching this video! haha. I might not actually try to implement this but its cool to know about incase it comes up. However, one shadow problem I've had for a while(even in UE4) was my grass billboards have a strange multi banded shadow on them when the sun was at certain angles. I might try and see if this could help, but I dont now because its just a plane with 2 triangles. Keep making these cool videos about things most people never talk about!

    • @TechArtAlex
      @TechArtAlex  Рік тому

      Thanks for the support! Banding on shadows is indeed often related to the biasing or lack thereof. You can see those bands changing frequency when adjusting the cascading shadow map bias setting on the video. Unfortunately too much bias will cause other issues so it's all about finding the right balance.
      For cards you'd have to slightly modify the technique. Maybe biasing them along the cameras normal direction would be the best fit, so that the shadow caster is always just behind the card from the players perspective.

  • @Eclectic_Chicken
    @Eclectic_Chicken Рік тому +1

    oooooh yeees ! Let's call you my saviour !

  • @SuperMontana2008
    @SuperMontana2008 Рік тому

    Any ideas why I get hard black shadows on normal maps?

    • @TechArtAlex
      @TechArtAlex  Рік тому

      I'd need to know more about your material setup to offer much of value, but it is usually very helpful to look in the world normal buffer visualizer to see if the surface normal vector is pointing in the correct direction.

  • @annthomas9516
    @annthomas9516 6 місяців тому

    This seems to be a very good video with lots of really important information. But, even displayed on a 4K monitor full screen, the most of the text of the UE menus is illegible, totally blurry. I hate to ask you this, since it seems you've put so much into this, but can you do zoom ins on the menu options you are clicking on?

    • @TechArtAlex
      @TechArtAlex  6 місяців тому

      Make sure your quality setting in the bottom right is set to 4k. It should be crystal clear on that setting, as it was recorded at 3440 ultrawide. Lower quality settings may be difficult to read, due to the small size of the menus. Thanks for the feedback though, I'll see if there's something I can do about that in the future.

  • @impheris
    @impheris Рік тому +1

    i do not understand, why would someone have that problem? i have never had that problem with any other game engine or 3d software even with very low poly art

    • @TechArtAlex
      @TechArtAlex  Рік тому

      I explain why it happens in the video. If the mesh is shaded smooth, renderers shadow casting wont line up with its per pixel lighting. It happens in every engine - including offline renders - unless special care is taken. You may not have noticed it, because older low res shadow maps blurred and filtered the issue.
      This is also directly related to "Shadow Acne," another well known shadow artifact. You'll find references to both these issues on basically all renderers going back decades if you search for it.

  • @mushudamaschin2608
    @mushudamaschin2608 Рік тому

    The core shadow isn't a vertex shader though. The core shadow is calculated per pixel, using the pixel normals like you said. So why do you call it vertex lighting?
    I'm actually working on a project and I would love to know how to get Gouraud dynamic vertex lighting like on the PS2 in unreal

    • @TechArtAlex
      @TechArtAlex  Рік тому +1

      You're correct, the core shadow is per pixel and the cast shadow is per vertex - hence the misalignment in terminators. I don't really script any of these videos so sometimes something slips out wrong.
      One way you should be able to imitate Gouraud shading is in the material by reading the light vector(s) and taking the dot product against the vertex normal instead of the pixel normal.
      This would require using an unlit material so that the standard per pixel lighting isn't applied.
      It sounds limiting but it's not so bad since PS2 games often had very few dynamic lights anyway and the sun light vector is already available in material, so you'd only need to decide how you want to handle point and spot lights (such as passing values over with MPCs).

    • @mushudamaschin2608
      @mushudamaschin2608 Рік тому +1

      @@TechArtAlex Wow this Material Parameter Collection sounds super useful! Plus this will leave the vertex color channels empty so I can use them for other things.
      With your help I finally have something to go on, this all makes sense to me thanks a lot, i really had a hard time finding help on this matter.

  • @FishMan1nsk
    @FishMan1nsk Рік тому

    Wait isn't adding WPO to material makes it more expensive for VSM?
    I mean even Epic Games had to add an evaluate WPO switch in actor properties to optimize this in Fortnite...
    I mean it would be even cheaper to add more geometry...

    • @TechArtAlex
      @TechArtAlex  Рік тому

      An object using WPO will invalidate the VSM cache for the relevant pages.
      This is a problem with grass especially, because usually there is some in almost every page. So WPO grass constantly invalidates all of the shadows and forces them to be redrawn every frame.
      For skeletal meshes and objects that are already moving, they were already invalidating the page anyway so this is irrelevant.
      For random objects whose shadow doesn't cover much of the screen, the invalid page will have minimal impact - but technically yes, it has increased the shadow cost.
      The only time I see this being an issue is if you use it on a huge object that is casting a shadow over a large area, like a building, or tons of objects scattered everywhere (like grass).
      This is really meant to just spot treat a problem mesh, not be applied to everything.
      In fact, if you want to apply it to everything, you don't need the WPO at all. There is a cvar that can bias all shadows at once: "shadow.virtual.normalbias", but I think it is heavy handed to alter the shadow bias of everything just because one mesh is causing problems, since it could cause artifacts on other meshes that are now too biased.
      In some cases it may indeed be better to increase the geo, which is why I included it as a solution.

  • @MustafaBerkeGureltol
    @MustafaBerkeGureltol Рік тому +1

    Or just use a normal map

    • @TechArtAlex
      @TechArtAlex  Рік тому

      Normal maps actually make the problem worse, because it is caused by discrepancies between the polygon geometry and the pixel normals. By altering the pixel normals, you may increase the difference between the pixel shading and the shadow casting.

    • @MustafaBerkeGureltol
      @MustafaBerkeGureltol Рік тому

      @@TechArtAlex using hardened normals on a mesh that's supposed to look smooth is not a sane choice at the first place. But if you choose to do so, you can instead smooth the normals, and bake a normal map from a higher poly version to this one for the actual look. When I faced this problem, there were two solutions: using a normal map to perturb the existing normals, or fixing the compression settings of my imported normal map. UE5 is not that good at detecting normal maps for compression.

    • @TechArtAlex
      @TechArtAlex  Рік тому +1

      @@MustafaBerkeGureltol I think you've missed the point. The sphere in this video *does* have smoothed vertex normals. The artifact is because its smooth vertex normals will shade smooth, but shadow casting via shadowmaps uses the polygonal geometry which is hard regardless of the smoothness of the normals. This artifact will happen on any smooth shaded object whether it has smooth mesh normals or normal maps if the surface normal deviates too far from the shadow casting geometry. This is why shadow bias exists, even in offline renderers.

    • @MustafaBerkeGureltol
      @MustafaBerkeGureltol Рік тому

      @@TechArtAlex Oh I see. Does it only happen when using ray tracing? Because I've never encountered this issue while using the older versions of Unreal Engine.

    • @TechArtAlex
      @TechArtAlex  Рік тому +1

      @@MustafaBerkeGureltol It happens with all shadowing methods. It's less noticeable with old cascading shadow maps because they are blurrier, so the issue is partially hidden by the filtering.