Closed phr00t closed 2 years ago
Stepping through a test scene with a point light & shadows enabled, it looks like all 6 views are "rendered"...
It goes here: https://github.com/phr00t/xenko/blob/master/sources/engine/Xenko.Rendering/Rendering/MeshRenderFeature.cs#L142
... and when it gets to the ShadowCasterRenderFeature element, it goes to an empty Draw function... which seems suspicious. However, looks like DirectX 11 has the same behavior.
Stuff then seems to get passed to the Vulkan Command List, where DirectX 11 & Vulkan will definitely branch... meaning the problem probably lies somewhere in https://github.com/phr00t/xenko/blob/master/sources/engine/Xenko.Graphics/Vulkan/CommandList.Vulkan.cs
Fixed with https://github.com/phr00t/FocusEngine/commit/a3d6934a2d5f83319573590bface3bc17bd406ef
Basically, there are a bunch of extra shadow stages for cubemaps and parabolas... removing these and just pointing to the 1 "shadowmapcaster" stage (which spotlight and directional light shadows already are) fixes the problem. I like the simplification of fewer stages that just seem to introduce bugs, so this fix is good enough for me! Existing projects will need to fix their own shadow stages to fix this problem.
Shadows seem to work for Directional & Spotlights in Vulkan -- but not Point Lights. In the editor, which is using the DirectX 11 API, I see shadows. When running the project in Vulkan, no shadows appear.