SaschaWillems / Vulkan-glTF-PBR

Physical based rendering with Vulkan using glTF 2.0 models
MIT License
915 stars 124 forks source link

How to make the backgrund sharp? #53

Closed alexkh closed 2 years ago

alexkh commented 2 years ago

On all examples the background is blurred. What is the correct way to make it sharp for using in a game?

Also, for some reason my converted hdr image appears in the demo upside-down. What would be the correct way to make it right side up again?

Best regards,

-Alexandre

SaschaWillems commented 2 years ago

On all examples the background is blurred. What is the correct way to make it sharp for using in a game?

That's intentional. I'm binding the pre-filtered cubemap for the background descriptor set. If you instead want to display the unfiltered source background image, just bind the environmentCube texture to the background's descriptor set instead of the prefilteredCube texture and sample from lod 0 instead of 1.5 in skybox.frag.

Also, for some reason my converted hdr image appears in the demo upside-down. What would be the correct way to make it right side up again?

I don't know how you create the cubemap, but easiest way would be flipping it in your conversion process with the tool you use for creating the cubemap. If that's not possible, simply flip uv's in the shaders.