A slight technical question - I noticed that the texture images for rendering onto an object needs to be an order of 2. Is there any way to specify a non-power image size (ex: 800 x 600) for mapping to a region, or am I going to be stuck with cutting the image into multiple pieces and using a multitexture technique? :-/
Does anyone have a bit-o-code to handle this already?
NVidia cards have an extension called “NV_TEXTURE_RECTANGLE” that allows you to use non-standard texture sizes. For all other cards, you have to use a power of two texture, fill in only the part you want, then draw your texture coordinates to use only the area you’ve filled.
I’m afraid that is a hardware issue rather than a java one. You could possibly use a larger square and use texture co-ordinates to map it to the right places.
That’s what I thought I just wanted to confirm that.
The bad news in this is that the images I need to break up are created dynamically, and can be of varying sizes. So, my strategy (for now) is to build a class that breaks an image into a Vector of images, each of which is a power of 2. It’ll probably have another underlying class that holds the images and coordinate info for restitching the images back together…a bit of a pain to set up, b ut it’ll be worth it in the end. I can have an image that’s 1x1, correct?
That I honestly don’t know. I don’t even know how easy it is to have multiple textures in different parts of the same shape- you may find you are having to redefine your geometries.
I can have an image that’s 1x1, correct?
Some cards have trouble with anything smaller than 64x64 (or so I’ve heard). 16x16 I think is the absolute minimum.
According to the Sun tutorials:
[quote]For rendering efficiency, Java 3D requires the size of the texture image to be a mathematical power of two (1, 2, 4, 8, 16, …) in each dimension. Failing to meet this restriction will result in a runtime exception.
[/quote]
If the graphics cards can’t handle it, then I am left wondering why they didn’t specify the lowest value as 16… ???
It’s amazing what I can find by reading the manual, huh? I should’ve done that before :-[
While i didn’t find any problems with low res textures on a voodoo card, others (like those godawful intergrated intel chipsets) might. Likewise theres a limit on the max size (256x256 for voodoo3 and earlier), but i’d expect j3d to be smart and resize these to the max possible size if you attempted anything too large.
It’s amazing what I can find by reading the manual, huh?
IIRC, the GL spec simply states that they have to be powers of 2 and only 64x64 must be supported. Actual card manufacturers can do whatever they want. Generally 64x64, 128x128, and 256x256 are supported by all cards. Many support 512x512.
others (like those godawful intergrated intel chipsets)
might.
Arrrgghh!!! Don’t even mention those things! They barely even give you a single texturing unit. Affordable Workstation Graphics my ass. Who’s the bozo who decided to redefine what a “workstation” is anyway? SGIs, Suns, or even a well loaded PC with a Quadro card are workstations. These things are office PCs with something akin to S3 Virge graphics.