Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (535)
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 882 times)
0 Members and 1 Guest are viewing this topic.
Offline Preston

Senior Member


Medals: 4



« Posted 2003-12-12 07: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:
1  
2  
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 Member




Speak Java!


« Reply #1 - Posted 2003-12-12 08: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

Yuri Vl. Gushchin
JProof Group
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


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

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

Cheers

Endolf

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

Senior Member




Speak Java!


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

Hi,

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

Yuri Vl. Gushchin
JProof Group
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.

Riven (7 views)
2014-07-29 12:53:52

Dwinin (7 views)
2014-07-29 10:59:34

E.R. Fleming (23 views)
2014-07-29 03:07:13

E.R. Fleming (9 views)
2014-07-29 03:06:25

pw (39 views)
2014-07-24 01:59:36

Riven (39 views)
2014-07-23 21:16:32

Riven (26 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21

Zero Volt (51 views)
2014-07-17 23:47:54
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!