PDA

View Full Version : Texture tiling and odd sizes



craydog
11-18-2009, 01:00 AM
I need to create odd size textures of things like 640X485 and
1080X809 and 387X512. These are too big for textures so I need to break it up. I thought I could tile it but don't know how to break it up given the texture limitation of power of 2. What would be the best approach for this situation.

scratt
11-18-2009, 01:20 AM
What hardware are you on?
Most reasonably recent HW will allow NPOT textures. And most recent hardware will easily accommodate textures of the dimensions you require, and even bigger allowing you to put them into oversized textures of say 1024x1024 or 2048x2048.

You can also index into textures with texture coords to access them in any dimension you like. So you can have bits and bobs of textures you render from "tiled" in unit size chunks in any way you dream up on a large texture which you use as a "canvas".

Also, what application is this for? i.e. Are you working with these sizes when you upload to the texture, or are you drawing from a texture using subsections of this size? It's worth noting that textureSubImage modifications can also be NPOT on most / all hardware AFAIK.

You need to be a bit more specific about your plans...

DmitryM
11-18-2009, 06:33 AM
AFAIK, The texture rectangles work on larger amount of GPU (EXT version requires just OpenGL 1.1). They serve for me perfectly.

craydog
11-18-2009, 06:52 AM
I am working on a VxWorks embedded environment with a Quantum3D graphics card. I am creating the textures myself.

mfort
11-18-2009, 11:10 AM
check what is the texture size limit on your hardware.
load it to several textures.
use texture border for seamless tiles
draw one primitive with one texture.

if only power of two textures are supported.
then you would have to make texture bigger and sacrifice
some unused space.