vsg-dev / vsgExamples

Example programs that test and illustrate how to use the VSG and optional add-on libraries
MIT License
148 stars 67 forks source link

vsgshadow has black patches flickering on the ground #273

Closed simwangrui closed 11 months ago

simwangrui commented 1 year ago

Hi, I run vsgshadow on Windows 11,most of the time, it seems fine,but sometimes there are black patches flickering on the shadow receiving surface.using --debug console output none information.I have carefully studied the pre RenderCommandGraph (submitOrder=-1) code, but I do not know how to ensure that the shadow RTT is rendered before being used by subsequent CommandGraph (submitOrder=0)

2 3
robertosfield commented 1 year ago

I haven't seen issue like this before so I can only guess that it's something related to the hardware/drivers. What hardware and drivers are you using?

Could you try setting the shadow map bias so a higher value to see if it's depth precision issue. I wrote up about this on the Discussion thread about the shadow map work.

The render order of the shadow map is controlled by nested CommandGrsph support that I introduced last month, just setting the submit order to -1 will ensure that the associated command buffer gets submitted before any CommandGraph with 0 or greater submit value.

robertosfield commented 11 months ago

As a follow up, I have fixed a bug in the TransferTask/RecordAndSubmitTasks that caused problems on NVidia cards when a separate transfer queue was used to transfer the light and shadowmap data to the GPU, this resulted in odd out of sync shadows that was visible when the camera position moved rapidly.

The fix was merged with the PR: https://github.com/vsg-dev/VulkanSceneGraph/pull/1033

@simwangrui Could you test VSG and vsgExamples master to see how things are behaving now. If the problem persists then please let us know what hardware and drivers you are working with so we can see if others in the community can reproduce the problem.

simwangrui commented 11 months ago

Hi, Sorry, it took too long before I could access github. I pulled the latest master branch code of VulkanSceneGraph, compiled and ran vsgshadow, and it is now running perfectly. My system is Windows 11, the graphics card is Nvidia RTX A4500 ada, and the driver version is R535 U6 (537.42). Thank you for solving this issue.

robertosfield commented 11 months ago

Thanks for the testing, good to hear the problem is solved.