Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (723)
Games in Android Showcase (216)
games submitted by our members
Games in WIP (790)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / Java 3D / Texture Chugginess on: 2002-12-30 07:58:54

First of all I'm new to j3d and these forums, so a big hello to anyone that reads this!

Now, my first j3d problem....I've noticed that my untextued objects render really fast, but when I add a texture (even to a single tri) then the frame rate drops below 1fps.

I figure this is something to do with the way I'm loading the textures and setting up the appearance (as the sample code didn't work for me), as other applets with textures seem to work fine so i've ruled out a vm/video card/driver problem.

If i use code from the samples e.g.:

TextureLoader loader = new TextureLoader("bob.gif", 0, myApplet);
ImageComponent2D image = loader.getImage();
Texture2D texture = new Texture2D();
texture.setImage(0, image);

Then i get an exception on the last line when setting the image....

java.lang.IllegalArgumentException: cannot set image in default texture

If i use something like:
TextureLoader loader = new TextureLoader("bob.gif", 0, myApplet);
Texture2D texture = (Texture2D)loader.getTexture();

and then use and modify this texture e.g.

if (texture != null) {

Then it renders with the texture, but goes very, very slow.

The texture is only 32x32 pixels btw.

I'm hoping this is to do with the dodgy way I'm loading and using the texture  Wink but any idea why I can't get it to work?

Many Thanks

Pages: [1]
buddyBro (185 views)
2017-04-05 03:38:00

CopyableCougar4 (615 views)
2017-03-24 15:39:42

theagentd (608 views)
2017-03-24 15:32:08

Rule (659 views)
2017-03-19 12:43:22

Rule (633 views)
2017-03-19 12:42:17

Rule (637 views)
2017-03-19 12:36:21

theagentd (649 views)
2017-03-16 05:07:07

theagentd (583 views)
2017-03-15 22:37:06

theagentd (423 views)
2017-03-15 22:32:18

theagentd (352 views)
2017-03-15 22:31:11
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 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‑
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!