Repository navigation
Enabled shadow effect for PreComp layers - #454
Conversation
| Visual? source = ((CompositionVisualSurface)node.Object).SourceVisual; | ||
| if (source is not null) | ||
| { | ||
| graph[source].IsSource = true; |
There was a problem hiding this comment.
Optimization can merge two ContainerVisuals together if they have common parent. So I decided to mark node that it is used as source of VisualSurface to not optimize it out
| // The parent may have been removed already. | ||
| let parent = n.Node.Parent | ||
| where parent is not null | ||
| where parent is not null && !n.Node.IsSource |
There was a problem hiding this comment.
Hm, it is not very clear to me. We can't detect if Visual node was used as Source somewhere else if we didn't walk the graph, right?
| new Vector3( | ||
| x: Math.Sin(directionRadians) * distance, | ||
| y: Math.Cos(directionRadians) * distance, | ||
| y: -Math.Cos(directionRadians) * distance, |
There was a problem hiding this comment.
Why negative? Also I am having trouble remembering but I wonder why we have sin for x.... and 1 for z.... I guess I will have to re-review the code.... #Closed
There was a problem hiding this comment.
In AE 0Β° is up, and 90Β° is right. So for 0Β° we need (0, -1) direction vector and (1, 0) for 90Β°
There was a problem hiding this comment.
I see. That is strange....
There was a problem hiding this comment.
Yeah I guess that does make sense from a intuitiveness perspective...

Shadow effect rewritten to use SurfaceBrush. Now there is no more visual glitches.
Also added CompositionMaskBrush since we need it to apply shadow color to the Visual node.