EmbarkStudios / kajiya

💡 Experimental real-time global illumination renderer 🦀

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The sun's center has a darker spot in reflections

SeppahBaws opened this issue · comments

Describe the bug
When looking at the sun through a reflection, the sun's center has a black pixel. After attaching Nsight, I saw that the light_gbuffer.hlsl shader outputs inf for the pixel in the center of the sun's reflection.

I 'fixed' it by clamping the shader output between zero and a large value, but I don't properly understand all the PBR shader code so I don't know a more correct way of fixing it.

To Reproduce

  1. Go to this commit on main: 6145eaa (the latest at the time of submitting this bug report)
  2. Load a model with a mirror-like reflective surface (I used the car.ron scene)
  3. Rotate the sun so that it's visible in the reflection
  4. The sun has a dark spot in the center.

Expected behavior
The sun's center should not have a darker spot like that.

Screenshots
image
image

Device:

  • OS: Windows 11
  • OS version: 21H2 build 22000.739
  • GPU: 3080 Ti
  • GPU driver version: 516.59
  • rust version: rustc 1.64.0-nightly (ddcbba036 2022-06-29)
  • cargo version: cargo 1.64.0-nightly (dbff32b27 2022-06-24)