Shadow mapping sample scene selection
This commit is contained in:
parent
5ed78c19ef
commit
b820cf0a53
1 changed files with 15 additions and 3 deletions
|
|
@ -69,10 +69,13 @@ public:
|
||||||
});
|
});
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
vks::Model scene;
|
|
||||||
vks::Model quad;
|
vks::Model quad;
|
||||||
} models;
|
} models;
|
||||||
|
|
||||||
|
std::vector<vks::Model> scenes;
|
||||||
|
std::vector<std::string> sceneNames;
|
||||||
|
int32_t sceneIndex = 0;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
VkPipelineVertexInputStateCreateInfo inputState;
|
VkPipelineVertexInputStateCreateInfo inputState;
|
||||||
std::vector<VkVertexInputBindingDescription> bindingDescriptions;
|
std::vector<VkVertexInputBindingDescription> bindingDescriptions;
|
||||||
|
|
@ -177,7 +180,9 @@ public:
|
||||||
vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr);
|
vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr);
|
||||||
|
|
||||||
// Meshes
|
// Meshes
|
||||||
models.scene.destroy();
|
for (auto scene : scenes) {
|
||||||
|
scene.destroy();
|
||||||
|
}
|
||||||
models.quad.destroy();
|
models.quad.destroy();
|
||||||
|
|
||||||
// Uniform buffers
|
// Uniform buffers
|
||||||
|
|
@ -433,7 +438,10 @@ public:
|
||||||
|
|
||||||
void loadAssets()
|
void loadAssets()
|
||||||
{
|
{
|
||||||
models.scene.loadFromFile(getAssetPath() + "models/vulkanscene_shadow.dae", vertexLayout, 4.0f, vulkanDevice, queue);
|
scenes.resize(2);
|
||||||
|
scenes[0].loadFromFile(getAssetPath() + "models/vulkanscene_shadow.dae", vertexLayout, 4.0f, vulkanDevice, queue);
|
||||||
|
scenes[1].loadFromFile(getAssetPath() + "models/samplescene.dae", vertexLayout, 0.25f, vulkanDevice, queue);
|
||||||
|
sceneNames = {"Vulkan scene", "Teapots and pillars" };
|
||||||
}
|
}
|
||||||
|
|
||||||
void generateQuad()
|
void generateQuad()
|
||||||
|
|
@ -927,6 +935,10 @@ public:
|
||||||
{
|
{
|
||||||
if (overlay->header("Settings")) {
|
if (overlay->header("Settings")) {
|
||||||
if (overlay->checkBox("Display shadow render target", &displayShadowMap)) {
|
if (overlay->checkBox("Display shadow render target", &displayShadowMap)) {
|
||||||
|
if (overlay->comboBox("Scenes", &sceneIndex, sceneNames)) {
|
||||||
|
buildCommandBuffers();
|
||||||
|
buildOffscreenCommandBuffer();
|
||||||
|
}
|
||||||
buildCommandBuffers();
|
buildCommandBuffers();
|
||||||
}
|
}
|
||||||
if (overlay->checkBox("PCF filtering", &filterPCF)) {
|
if (overlay->checkBox("PCF filtering", &filterPCF)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue