Shadows #17
Labels
No Label
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: SeanOMik/lyra-engine#17
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resources:
Was able to get directional shadows working!
Whats left to do:
Got point light shadows (mostly) working!
The green light is above the grid cubes, the blue one is above the closest top right corner of the right cube. The scene also has directional shadows.
I think there is an issue with the green shadow not having any ambient light for a portion of the shadow, I will have to dig into that. This is of course using a shadow map atlas. There is currently a bug with the atlas packer that makes the far right column unused, and no texture will be packed there; probably something simple.
PCF and PCSS have been implemented!! This ForgeJo instance went down for a week when I was working on PCF and PCSS, so I wasn't able to update this issue. Anyway, here's a picture without ambient lighting on the point light:
Here's an image showing PCSS on the directional light:
Notice how the shadows get fuzzier at the tip of the shadow due to how far away the blocker is, but they're still sharp near the blocker.
Shadows for spotlights are still not implemented at all. PCSS is also not implemented for point lights. I'm wondering if its worth doing so since its expensive and may not make much sense for them since they're usually small lights.
I want to make some improvements to the shadow bias by doing more than just a constant depth bias. I was thinking of Adaptive Depth Bias, normal-offset bias (GDC poster, dead blog), or Receiver Plane Depth Bias (slide 36).
The issue with receiver plane depth bias is that I'm using such an old version of wgpu and winit that it doesn't support dpdx and dpdy, so I would have to update those which could be a big pain. It looks like receiver plane depth bias is used by unity, so it may be the best option. Doing a quick google, it looks like implementations of normal-offset bias also use dpdx and dpdy, so I may be out of luck there too. Seems like the best option is to complete the tasks for this issue and create more issues for improving bias that will get done after updating wgpu and winit.
I got spot lights working a couple of weeks ago, but in the process kind of broke PCSS on directional lights. Due to burn out I took a short break by writing a shader preprocessor, and just fixed the issue. Here's a screenshot PCSS directional light and PCF spot light shadows:
I still need to do cascading shadow maps, but need a break from rendering so I created another issue for it: #22