Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Draping imagery of non-standard sizes...  (Read 2238 times)
0 Members and 1 Guest are viewing this topic.
Offline abarczak

Junior Newbie




Excuse me...your bits are showing.


« Posted 2003-05-13 18:37:59 »

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?
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #1 - Posted 2003-05-13 18:56:58 »

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.

Java Game Console Project
Last Journal Entry: 12/17/04
Offline Breakfast

Senior Devvie




for great justice!


« Reply #2 - Posted 2003-05-14 10:49:23 »

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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline abarczak

Junior Newbie




Excuse me...your bits are showing.


« Reply #3 - Posted 2003-05-14 10:59:42 »

That's what I thought  Sad 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?
Offline Breakfast

Senior Devvie




for great justice!


« Reply #4 - Posted 2003-05-14 14:01:30 »

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.
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #5 - Posted 2003-05-14 14:09:13 »

> 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.

Java Game Console Project
Last Journal Entry: 12/17/04
Offline abarczak

Junior Newbie




Excuse me...your bits are showing.


« Reply #6 - Posted 2003-05-14 15:55:51 »

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.


If the graphics cards can't handle it, then I am left wondering why they didn't specify the lowest value as 16... Huh

It's amazing what I can find by reading the manual, huh? I should've done that before  Embarrassed
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #7 - Posted 2003-05-14 16:09:02 »

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.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #8 - Posted 2003-05-14 16:39:31 »

> 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.

Java Game Console Project
Last Journal Entry: 12/17/04
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (37 views)
2014-12-15 09:26:44

Mr.CodeIt (31 views)
2014-12-14 19:50:38

BurntPizza (62 views)
2014-12-09 22:41:13

BurntPizza (99 views)
2014-12-08 04:46:31

JscottyBieshaar (60 views)
2014-12-05 12:39:02

SHC (74 views)
2014-12-03 16:27:13

CopyableCougar4 (77 views)
2014-11-29 21:32:03

toopeicgaming1999 (138 views)
2014-11-26 15:22:04

toopeicgaming1999 (127 views)
2014-11-26 15:20:36

toopeicgaming1999 (38 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!