Page MenuHome

[ON HOLD] Line Art feature update: Shadow Projection
Needs ReviewPublic

Authored by YimingWu (NicksBest) on Jul 30 2021, 1:55 AM.

Details

Reviewers
None
Group Reviewers
Grease Pencil
Maniphest Tasks
T87739: Line Art further improvement list
Summary

Due to the research of the new algorithm based on embree, this specific revision can be put on hold.


This is a WIP patch for shadow projection. The way it works is by:

  1. Running a separate line art from the light's perspective and get the light contour,
  2. Then project visible segments onto surfaces,
  3. Load projected segments into the "real" line art stage and compute visibility together with the rest of the scene.

Problems for now:

  • Rarely there will be a shadow segment that will ended up in a "occluded" state although it should be perfectly visible.
  • No distinguish between projected onto which side of the triangle, which means the shadow will "show through when viewed from behind the wall" if you only have 1 layer of face as "the wall". Considered resolved, although not perfect.

Try out the function using lineart-shadow branch. This patch is not really meant for master any time soon but it's here so you guys can give feedbacks.

This patch applies on top of branch temp-lineart-contained.

Diff Detail

Repository
rB Blender

Event Timeline

YimingWu (NicksBest) requested review of this revision.Jul 30 2021, 1:55 AM
YimingWu (NicksBest) created this revision.

Updated to only include change between temp-lineart-contained and lineart-shadow

YimingWu (NicksBest) added a comment.EditedJul 30 2021, 2:10 AM

The problem at the moment is that we need to pass info between 2 line art calculations so we know "if the edge is projected onto this exact triangle".

This problem doesn't only affect shadow, but if we solve it properly it should also benefit stuff like:

  • Shadow region edge removal.
  • Illuminated light contour only.
  • Other styles that require 2-time calculation from the light object and the camera.

Current idea is to use index but thread loading has made the it a bit problematic, (Also, the object will cull differently in visibility check stage). Will come up with a efficient way of doing it.

After some struggle today I get the occlusion right for the front/back facing shadow receiving surface. Due to occlusion function precision issue, light contour will sometimes be a bit problematic as they are essentially "overlapping edges" in that context. This needs to have an architectural solution as current shadow is algorithmetically correct, we do not have a way to share "this is the matching edge that we tested in the shadow computation" between two runs of line art. Due to different culling, we might not be able to use a set of loaded geometry again which enables shadow and occlusion calculation in one go, so there needs to be a data passage. This will also enable us to select edges that are in the occluded region differently as stated before.

Updated UI for better clarity

YimingWu (NicksBest) edited the summary of this revision. (Show Details)Aug 2 2021, 9:05 AM
YimingWu (NicksBest) retitled this revision from Line Art feature update: Shadow Projection to [ON HOLD] Line Art feature update: Shadow Projection.Jan 17 2022, 1:30 AM
YimingWu (NicksBest) edited the summary of this revision. (Show Details)