Sign in to follow this  
svnstrk

OpenGL 2D array of texture2D

Recommended Posts

hi,

i have a 2D array of texture. so its like an image with width and height, but each pixel is an image. and if i want to grab texture at index let say (3.5, 4.5), it will interpolate the texture at index (3, 3), (3, 4), (4, 3), (4, 4).

currently im trying to do this manually, but im curious is there any easy way to implement this in OpenGL+GLSL? is there some kind of way to keep texture2D in 2D array that interpolates automatically in OpenGL+GLSL? if yes, any hint/link/sample how to to that?

thanks in advance

Share this post


Link to post
Share on other sites
Quote:
Original post by svnstrk
currently im trying to do this manually, but im curious is there any easy way to implement this in OpenGL+GLSL?
Sure. Tile all your textures into a single large texture, and index sub-textures manually using fract/mod operations.

Ysaneya posted code for this a while ago.

Share this post


Link to post
Share on other sites
hi,

i think its kinda different for you and me. im not having a large texture and have subtextures in it, i have a (let say) 4D texture. so I have a set of images which is captured from a certain set of camera movement which follow a spherical coordinate (elevation and azimuth).

so my texture, instead of a simple (x, y) texture, is an (x, y, rho, theta). im curious if opengl/glsl able to do a mipmap based on a 4 coordinate system.

ofcourse i can do it with your way, but my texture is 500*500*30*30, which is i think too large to be placed in 1 texture. but i guess i have the idea that opengl cant do such thing.

any idea/hint/help/link will be appriciated!

thanks in advance

Share this post


Link to post
Share on other sites

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