Jump to content
  • Advertisement
Sign in to follow this  

Vulkan vulkan and instanceindex

This topic is 659 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I would create an instanced boxes drawing in vulkan.
I have 2 variables that change during the time and are selected and visible .
I seen in documentation and examples that use instanceindex and an ubo and every change the ubo is remapped.
i have 3 questions:
1)i must choose from an texture and an ubo for changing variables(selected and visible)
and for example if a piking on a box is executed i must remap the data variables to the new value selected in the texture or ubo , but i must change only 3 byte in the entire buffer or texture,
then in the shader when i get the value from the texture or the ubo i must get the selected color.
2)i'm using instancing drawing and i have 300000 objects
3)is better to use ubo or a 1d texture?

Share this post

Link to post
Share on other sites

1, no, you don't have to remap all the buffer. You can just update the parts that have changed. Also, don't forget, you have to align your data properly. So be careful with single byte reads.

2, what is the question here?

3, use UBOs. Less limitations on size, and less code is spent on unpacking data. But, as always, benchmark it yourself. There might be differences between different architectures, and you might have to maintain both approaches.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!