SaschaWillems / Vulkan-glTF-PBR

Physical based rendering with Vulkan using glTF 2.0 models
MIT License
979 stars 132 forks source link

weird cone-shaped shading illusion #54

Closed alexkh closed 2 years ago

alexkh commented 2 years ago

screenshot

I'm using your renderer in my game engine, and currently am having a few weird visual artifacts.

Ths scene is just a green plane with a hi-color skybox. FIrst of all, there is this conic shape around the 0,0,0 coordinate. Do you haven any idea why is it formed and how to fix it?

Also, the direction of the highlight is not in the direction of the sun for some weird reason.

And also, there is a blue dot in the middle of the Sun, i'm not sure what's the deal there. Can it be a bug in the shader code?

the scene: https://wizstaff.com/test.glb the skybox: https://wizstaff.com/mountain.ktx

Best regards,

-Alexandre Kharlamov

SaschaWillems commented 2 years ago

Is that screenshot from my repo or from your custom engine (I'm asking because of the different caption)?

As for your questions:

alexkh commented 2 years ago

Is that screenshot from my repo or from your custom engine (I'm asking because of the different caption)?

It's my engine, but i didn't modify much in the renderer code: just switched to firstperson camera and made the skybox sharp like you suggested in #53... This cone thing happens only when the camera is very close to world position 0,0,0

I don't mind sharing sources, I'm only a bit shy because i modified the code to use SDL, so that i can use its input abstraction and also changed the build system to meson/ninja...

As for your questions:

  • The blue dot is most likely the default clear color and caused by the far clipping plane

Can it be because the color value in the HDR texture itself is out of range somehow?

  • The "shading illusion" is not an illusion but the way how specular lighting works I guess the floor doesn't have proper normals.

Thanks for the suggestion, I'll look into it.