Vulkan shadow (cube) maps

Started by
23 comments, last by taby 1 year, 1 month ago

Does anyone have code for omnidirectional shadow cube maps, in Vulkan?

Here it is in OpenGL, thanks primarily to @joej

Advertisement

Vulkan/shadowmappingomni.cpp at master · SaschaWillems/Vulkan (github.com)

Thanks for that link. It's exactly what I asked for! Thank you!

As far as compiling and linking, then running, the only implementation that I could successfully build was a spotlight shadow map by Pawel Lapinksi – https://github.com/PacktPublishing/Vulkan-Cookbook

I've just compiled the Sascha Willems' implementation and it seems to work. Make sure to follow the building instructions.

Excellent. Thanks for trying it out. I will try to get that code working!

I"ve almost got it, but I have some linker errors. Any idea?

All the examples in the repo depend on the base project, so make sure to compile it as a static library (base.lib) and include it as a linker dependency (along with vulkan-1.lib) in the shadowmappingomi project.
You also need to include all the folders in the external directory, plus the base directory in the main folder, as additional Include Directories.

I'm not sure what you mean. It's missing function definitions, so I'm likely missing a cpp file somewhere. :(

LNK2001 is a linker error, which means that the source files for the shadowmappingomni project have been compiled to object code, but some symbols are externally defined in the base.lib, which the linker can't find to resolve the symbols (or maybe it can find it but can't find the symbols themselves in the lib).
To fix it, compile the base project and include the static library as a linker dependency in the shadowmappingomni project.
Alternatively, don't create your own project, compile from the original one, so that you don't need to make any modifications. Just follow the building instructions.

This might be helpful for beginners.

My question is: where is ktxTexture_Destroy is defined? It’s declared in ktx.h.

what file is the base project?

This topic is closed to new replies.

Advertisement