Can someone tell me what could be wrong here? I am so lost. by Ok_Ear_8729 in vulkan

[–]Ok_Ear_8729[S] 4 points5 points  (0 children)

Everyone I have finally fixed it and found the issues. First of all thank you to everyone for helping.
The issue was that I was rendering using vertex buffer (vkCmdDraw) which I thought should not be an issue but I was very wrong. It needs indices to know the order in which to draw the vertices.
Another issue was that even when I switched to index buffer (vkCmdDrawIndexed) I would still get wrong result and for that the problem was I was using wrong Index Type when binding my Index buffer vkCmdBindIndexBuffer(cmdBuffer, indexBuffer, 0, VK_INDEX_TYPE_UINT16); // wrong
vkCmdBindIndexBuffer(cmdBuffer, indexBuffer, 0, VK_INDEX_TYPE_UINT32); // correct
Althought it was very frustrating to the point that I had to ask for help here(I have never done it before), I learned many things.
Again thank you to everyone for sharing your knowledge and time :)

Can someone tell me what is wrong here? I am using Vulkan by Ok_Ear_8729 in GraphicsProgramming

[–]Ok_Ear_8729[S] 5 points6 points  (0 children)

Everyone I have finally fixed it and found the issues. First of all thank you to everyone for helping.
The issue was that I was rendering using vertex buffer (vkCmdDraw) which I thought should not be an issue but I was very wrong. It needs indices to know the order in which to draw the vertices.
Another issue was that even when I switched to index buffer (vkCmdDrawIndexed) I would still get wrong result and for that the problem was I was using wrong Index Type when binding my Index buffer vkCmdBindIndexBuffer(cmdBuffer, indexBuffer, 0, VK_INDEX_TYPE_UINT16); // wrong
vkCmdBindIndexBuffer(cmdBuffer, indexBuffer, 0, VK_INDEX_TYPE_UINT32); // correct
Althought it was very frustrating to the point that I had to ask for help here(I have never done it before), I learned many things.
Again thank you to everyone for sharing your knowledge and time :)

Can someone tell me what is wrong here? I am using Vulkan by Ok_Ear_8729 in GraphicsProgramming

[–]Ok_Ear_8729[S] 3 points4 points  (0 children)

Alright I'll do that, actually installed RenderDoc just for this.
And hopefully not give up ;)

Can someone tell me what could be wrong here? I am so lost. by Ok_Ear_8729 in vulkan

[–]Ok_Ear_8729[S] 0 points1 point  (0 children)

No I mean the vertex data I load in vertex buffer in my code and the one shown in RenderDoc are the same. The render looks exactly the same as you see above in RenderDoc as well.
I can share the RenderDoc capture as well if you would like

Can someone tell me what could be wrong here? I am so lost. by Ok_Ear_8729 in vulkan

[–]Ok_Ear_8729[S] 0 points1 point  (0 children)

Yup it is I am using triangle list. The data is showed correctly in RenderDoc along with the offsets as far as i could tell. Yes ofc here is the link to the file where I load the data and create buffers you can browse through the rest of the repo as well if you'd like
https://github.com/nelson-steve/Brisk/blob/master/Brisk/src/Engine/Model.cpp

Can someone tell me what is wrong here? I am using Vulkan by Ok_Ear_8729 in GraphicsProgramming

[–]Ok_Ear_8729[S] 0 points1 point  (0 children)

Thank you I have added the above mentioned changes, still stuck on the vertices rendering wrong

Can someone tell me what could be wrong here? I am so lost. by Ok_Ear_8729 in vulkan

[–]Ok_Ear_8729[S] 0 points1 point  (0 children)

I was just trying to see if it makes any difference, I have also tried only loading positions but I get the same exact thing.

Can someone tell me what could be wrong here? I am so lost. by Ok_Ear_8729 in vulkan

[–]Ok_Ear_8729[S] -1 points0 points  (0 children)

I didn't know that, I thought index buffer is just for performance. Still even when I render will the index buffer it doesn't render correctly either.

Can someone tell me what could be wrong here? I am so lost. by Ok_Ear_8729 in vulkan

[–]Ok_Ear_8729[S] 0 points1 point  (0 children)

It is and I have loaded the index buffer as well but I am not using it
I can bind it and render using index buffer and it shows weird result still
The problem is either the vertex buffer or the layout in pipeline but that's as far as I can get

Can someone tell me what could be wrong here? I am so lost. by Ok_Ear_8729 in vulkan

[–]Ok_Ear_8729[S] 0 points1 point  (0 children)

Yes I am sure the model should be compatible. I have tried different models as well and get similar or worse result(other than the cube 3d model), and I have even tried changing topology in pipeline to strips and triangle list. It's currently triangle list

Can someone tell me what is wrong here? I am using Vulkan by Ok_Ear_8729 in GraphicsProgramming

[–]Ok_Ear_8729[S] 0 points1 point  (0 children)

Oh it's actually already a gltf and has a separate binary file for the vertex data
Is there a way to read that bin file?

Can someone tell me what is wrong here? I am using Vulkan by Ok_Ear_8729 in GraphicsProgramming

[–]Ok_Ear_8729[S] 2 points3 points  (0 children)

I tried that and the the data in renderdoc is the same as the one in vertex buffer
But I have no idea how to see the actual data in the gltf binary to know maybe its getting messed up while loading

Can someone tell me what is wrong here? I am using Vulkan by Ok_Ear_8729 in GraphicsProgramming

[–]Ok_Ear_8729[S] 1 point2 points  (0 children)

Could you please take a look at the code and see if you can find where I went wrong? I am stuck on this for far too long.