Sign in to follow this  

width, height - singleindex

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

This topic is 2659 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this