stride3d / stride

Stride (formerly Xenko), a free and open-source cross-platform C# game engine.
https://stride3d.net
MIT License
6.65k stars 957 forks source link

Black Black probably NaN error #325

Open wozeparrot opened 5 years ago

wozeparrot commented 5 years ago

Release Type: Official Release/GitHub (please choose appropriate option) Official

Version: Version number and/or git branch 3.1.0.1-beta01-0359

Platform(s): Does the problem occur on Windows, Android...? Windows

Describe the bug A clear and concise description of what the bug is. Really Black Black.

To Reproduce Steps to reproduce the behavior:

  1. Run the project exe.
  2. See the darkness.

Screenshots If applicable, add screenshots to help explain your problem (use GitHub drag & drop) blackestblack

Log and callstacks If any, please attach here any log or callstack (preferably in a .txt file using GitHub drag and drop)

Additional context Add any other context about the problem here. Project Files: https://www.filehosting.org/file/details/776346/Debug.zip

Eideren commented 4 years ago

This issue has been fixed afaict. I had to do a repro on windows d3d11 as the given link doesn't work anymore and the 'Bright Filter' worked fine.

tebjan commented 2 years ago

This was also reported to happen with 4.1 so it needs another investigation. One could use RenderDoc to create the error and then debug the pixels.

ericwj commented 2 years ago

I had this with Starbreach, newly cloned, changed the TFM's to net6.0 (x2) and net6.0-windows and updated the package references to version 4.1.0.1734. Verified that it happens on my UHD 770 as well as my 1080 Ti.

froce commented 1 year ago

Still in 4.2 (Popped up on discord again (https://discord.com/channels/500285081265635328/500292370923913222/1175390122313781278).

Digging into it a bit, there are zero length tangents in the character model for Starbreach: grafik

These get normalized in GetTangentMatrix in NormalUpdate.sdsl leading to NaNs in the RT eventually. The NaNs then get spread around by the LightStreakShader and GaussianBlurShader.

(🤦‍♂️ reading the linked issues would have made it obvious that there's an issue with tangents.)

PR soon(tm). Not sure what to do about the missing tangents on GeometricPrimitives (https://github.com/stride3d/stride/issues/413)

froce commented 1 year ago

That takes care of the issue in Starbreach. (Delete Starbreach.Windows/obj and rebuild, to reimport the assets.)

Should we also protect LightStreakShader/GaussianBlurShader and similar ones from NaNs? With NaNs at least it's usually obvious that something went wrong, some black or just darkened pixels will be harder to track down.

ArieLeo commented 5 months ago

I found the same issue, this one caused by the shadowmap texture image I do manage to fixed this one by saturate the shadow output from the PCF filtering, not sure if it's a proper fixed though, but i never see the issue across projects anymore. image