Trying to render 3D shadow_maps with Vulkan, but getting buffer update de-sync I suspect.
My question is, how do I solve the problem, when rendering, and uniform buffer data updates are not in sync, so the mesh starts jumping around while getting rendered.
Can I use MemoryBarrier to solve this? I have tried, but no lucks so far.
Below is my render loop in simple terms
render_loop ->
foreach (light: scene_lights) {
// Render whole scene from **light_pos** view point to depth_maps
Matrix4 light_view_matrix
uniform_buffer.update_view(light_view_matrix);
foreach(mesh: scene_meshes) {
render_mesh(mesh);
}
}
// Set uniform buffer back to using **camera_view** and render the scene again for color ..etc
uniform_buffer.update_view(camera_view_matrix);
foreach(mesh: scene_meshes) {
render_mesh(mesh);
}
