Vulkan UBO management -

Started by hydos06, March 10, 2020, 09:51:26

Previous topic - Next topic

hydos06

I have been recently working on vulkan because i wanted to learn somthing different from openGL. ive got to the point where 2 models load. but this is where the problem starts. i want both models to be able to move on their own but somewhere in my code previously i had made it affect all models and im unsure of how to fix it . the latest version of where this happens is here: https://github.com/Fulira/Litecraft https://gyazo.com/3d682ae31e90a29846f1a6ba4796600a is what is happening currently in gif form


abcdef

UBO's are updated as soon as you update the buffer memory, when drawing you record commands then pass them to the GPU to execute. I would guess you have a loop where you update the UBO then draw a mesh and you repeat this x times. The thing is the commands aren't executed till the end so I you are probably always getting the last UBO value. This is a big mindset change compared to opengl.

Just a guess on my part but i had a similar issue myself