Jump to content
  • Advertisement
Sign in to follow this  
svnstrk

width, height - singleindex

This topic is 2847 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

hi,

so i want to convert my texture to a single index array and put it on GPU memory. how can i treat the width and height let say if i loop it with w and h respectively, and the size of the image is texWidth, texHeight, so it match how the gpu treat the singleindex. is it

w*texHeight + h

or

h*texWidth + w?

thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by svnstrk
hi,

so i want to convert my texture to a single index array and put it on GPU memory. how can i treat the width and height let say if i loop it with w and h respectively, and the size of the image is texWidth, texHeight, so it match how the gpu treat the singleindex. is it

w*texHeight + h

or

h*texWidth + w?

thanks in advance
Since image data is typically stored by row and then by column, it would probably be the second one. (If I understand your question correctly, that is.)

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!