Corrected usage flag for instancing buffer
This commit is contained in:
parent
0463d5b1e3
commit
6d54900c4d
2 changed files with 6 additions and 3 deletions
|
|
@ -99,7 +99,7 @@ Uses [assimp](https://github.com/assimp/assimp) to load and a mesh from a common
|
|||
## [Mesh instancing](instancing/)
|
||||
<img src="./screenshots/instancing.jpg" height="96px" align="right">
|
||||
|
||||
Shows the use of instancing for rendering many copies of the same mesh using different attributes and textures. A secondary uniform buffer containing instanced data, stored in device local memory, is used to pass instance data to the shader via vertex attributes with a per-instance step rate. The instance data also contains a texture layer index for having different textures for the instanced meshes.
|
||||
Shows the use of instancing for rendering many copies of the same mesh using different attributes and textures. A secondary vertex buffer containing instanced data, stored in device local memory, is used to pass instance data to the shader via vertex attributes with a per-instance step rate. The instance data also contains a texture layer index for having different textures for the instanced meshes.
|
||||
<br><br>
|
||||
|
||||
## [Multi sampling](multisampling/)
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ public:
|
|||
&stagingBuffer.memory);
|
||||
|
||||
VulkanExampleBase::createBuffer(
|
||||
VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT |VK_BUFFER_USAGE_TRANSFER_DST_BIT,
|
||||
VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT,
|
||||
VK_MEMORY_HEAP_DEVICE_LOCAL_BIT,
|
||||
instanceBuffer.size,
|
||||
nullptr,
|
||||
|
|
@ -553,7 +553,10 @@ public:
|
|||
uboVS.view = glm::rotate(uboVS.view, glm::radians(rotation.z), glm::vec3(0.0f, 0.0f, 1.0f));
|
||||
}
|
||||
|
||||
uboVS.time += frameTimer * 0.05f;
|
||||
if (!paused)
|
||||
{
|
||||
uboVS.time += frameTimer * 0.05f;
|
||||
}
|
||||
|
||||
memcpy(uniformData.vsScene.mapped, &uboVS, sizeof(uboVS));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue