Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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  
  Sharing textures problem  (Read 1603 times)
0 Members and 1 Guest are viewing this topic.
Offline Preston

Senior Devvie

Medals: 4

« Posted 2003-12-12 06:17:30 »

According to the Java3d javadoc you're allowed to share Texture2D objects among different Shape3Ds.
However I notice strange effects when I do this and load a shared texture in the following way:
BufferedImage bimg; // loaded in an own way
Texture2D texture = (Texture2D) TextureLoader.loadTexture(bimg, "RGBA", true, Texture.NICEST, Texture.NICEST, Texture.WRAP);

There's the following problem then: when I zoom in one of those Shape3ds sharing this texture, the textured surfaces of the Shape3d become white.

Is it maybe a problem that I use the TextureLoader.loadTexture method with an BufferedImage instead of a file name?
Do I have to use a seperate BufferedImage with this call for each Shape3d wanting to use the same texture file?
Offline Yuri Vl. Gushchin

Senior Devvie

Speak Java!

« Reply #1 - Posted 2003-12-12 07:01:48 »

I intensively use texture sharing, both mip-mapped and non-mip-mapped, and it works fine for me.

Can you please create small test caseso we can test? [and file an issue with the test case as an attachment]

Thanks for testing,

Yuri Vl. Gushchin
JProof Group
Offline endolf

JGO Coder

Medals: 7
Exp: 15 years

Current project release date: sometime in 3003

« Reply #2 - Posted 2003-12-12 10:12:34 »

 I share them too, take a look at my ac3d loader, even has a texture resource pool to cache them all Smiley

I know it's a 'works for me' type answer, but it points to something in your code or a change in xith. Like Yuri says, a small test case would be good.



Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Yuri Vl. Gushchin

Senior Devvie

Speak Java!

« Reply #3 - Posted 2003-12-12 15:48:57 »


That's definitely nothing to do with MipMaps, but something wrond happens with texture sharing - you are right. I don't know yet if this is in your code or somewhere in Xith3D, but we definitely should check this.

With your test, the sphere looses texture ONLY in the case when the bigger shape (opaque one) is visible, i.e. not culled.

Try to do the following: open the app, click on the big square shape, and using a,s,d,w keys move it off the visible area - you will see that texture on the sphere will appear.

Looks like this shape is rendered before the sphere, and causes wrong behavior of TexCoordGeneration [somehow?]. Note that transparent shape always rendering after the sphere and does not cause such problem.

So, as a bottom line, if it would be a bug report in IssueZilla, I would mark this issue as confirmed Smiley

What can I say - we definitely need to put this test in a simple test case, say, based on the test code from com.xith3d.test...


Yuri Vl. Gushchin
JProof Group
Pages: [1]
  ignore  |  Print  

EgonOlsen (79 views)
2018-06-10 19:43:48

EgonOlsen (59 views)
2018-06-10 19:43:44

EgonOlsen (78 views)
2018-06-10 19:43:20

DesertCoockie (261 views)
2018-05-13 18:23:11

nelsongames (160 views)
2018-04-24 18:15:36

nelsongames (158 views)
2018-04-24 18:14:32

ivj94 (901 views)
2018-03-24 14:47:39

ivj94 (162 views)
2018-03-24 14:46:31

ivj94 (813 views)
2018-03-24 14:43:53

Solater (177 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

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