www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: raft on February 13, 2008, 04:28:45 pm

Title: FengGUI menu breaks jPCT textures
Post by: raft on February 13, 2008, 04:28:45 pm
hello,

i'm toying with new version of FengGUI. but somehow it breaks jPCT textures now. some widgets render ok but when a try to add a menu bar it doesnt showup. furthermore if i add menubar before jPCT renders once, all textures are gone. the scene looks like all textures are dummy textures. no warning on console.

here is a shot:
(http://img81.imageshack.us/img81/5994/fengguitesttu3.jpg)

very odd, any ideas ?
Title: Re: FengGUI menu breaks jPCT textures
Post by: EgonOlsen on February 13, 2008, 05:00:53 pm
Not much ATM...maybe you can replace the dummy texture (via TextureManager.setDummyTexture(<Texture>)) before doing anything else to see, if this really IS jPCT's dummy texture or just some other texture with the same color.
Does this happen on Windows too?
Title: Re: FengGUI menu breaks jPCT textures
Post by: EgonOlsen on February 13, 2008, 05:02:31 pm
Are you doing anything like multi texturing, projective textures or shadows?
Title: Re: FengGUI menu breaks jPCT textures
Post by: raft on February 13, 2008, 05:09:53 pm
no, nothing like multi texturing, projective textures or shadows.. this is the old test case for FengGUI (posted somewhere in forum)  it properly works with old version of feng gui..

it's not dummy texture, i've replaced the dummy texture but it didnt show up. i havent tried this is windows but i dont think it's relevant.

Title: Re: FengGUI menu breaks jPCT textures
Post by: EgonOlsen on February 13, 2008, 05:22:00 pm
Which jPCT version is that? 1.15? 1.16beta? I don't think that i have changed something related to texture management and if it works with an older FenGUI, that's most likely not the problem anyway...but maybe i'm doing something wrong that has never hurt the old version of FenGUI but does hurt the new one. Then again, uploading textures is nothing special. There's not much room to do it wrong.
However, some wild suggestions to try:

Disable mipmapping and trilinear filtering if used via the appropriate settings in Config.
Try to set Config.glTextureDepth to -1
Try to set Config.useFBO to false
Try to set Config.glOverrideStageCount to 1
Try to set Config.glForceFinish to true

I don't think that any of these settings will change the outcome, but just to be sure...
Title: Re: FengGUI menu breaks jPCT textures
Post by: EgonOlsen on February 13, 2008, 05:41:08 pm
You can try this jar: http://www.jpct.net/download/hacks/jpct.jar (http://www.jpct.net/download/hacks/jpct.jar)
It prints out some info about uploading the textures, to see if this process actually works.
Title: Re: FengGUI menu breaks jPCT textures
Post by: raft on February 13, 2008, 05:50:44 pm
it was 1.15 beta.  now i've downloaded 1.15 but didnt help. settings below didnt help either (except useFBO, it's 1.16 beta thing i guess)

FengGUI's demo works fine with menu. it renders over a colored background. i'm not sure if that is a texture but at least menu shows up

below is the output of new hack version:

Code: [Select]
Software renderer (OpenGL mode) initialized
Software renderer disposed
Current mode:800 x 600 x 24 @75Hz
Driver is: null/null on Tungsten Graphics, Inc / Mesa DRI Intel(R) 915GM 20050225 x86/MMX/SSE2
FBO not supported or disabled!
OpenGL renderer initialized (using 1 texture stages)
13-Feb-08 18:50:10.476    INFO : game thread started with granularity 25 millis [FengGui.java, raft.karga.jpct.FengGui$TimerThread:run 403] [main]
added menu
Texture uploaded with ID:2
Texture created/no mipmaps!
Texture uploaded with ID:3
Texture created/no mipmaps!
Texture uploaded with ID:4
Texture created/no mipmaps!
Texture uploaded with ID:5
Texture created/no mipmaps!
Texture uploaded with ID:6
Texture created/no mipmaps!
Texture uploaded with ID:8
Texture created/no mipmaps!
Texture uploaded with ID:9
Texture created/no mipmaps!
Title: Re: FengGUI menu breaks jPCT textures
Post by: EgonOlsen on February 13, 2008, 05:54:35 pm
The output looks fine. Your log tells something about a game thread. Any chance that this is a thread/context issue? You are not initializing the GUI in another thread than you are doing the actual rendering in?
Title: Re: FengGUI menu breaks jPCT textures
Post by: raft on February 13, 2008, 06:00:47 pm
no threading issue, the code is quite dirty so is the log. indeed i invoke run method of thread instead of starting it  ;D

does first post give a clue ? this texture thing happens only if menu is added before first jPCT render cycle. it simply doesnt show up if added after then
Title: Re: FengGUI menu breaks jPCT textures
Post by: EgonOlsen on February 13, 2008, 06:02:50 pm
Makes me think that "menu" is somehow broken in FenGUI. Or maybe it's a driver issue which is why i was asking for Windows.
Title: Re: FengGUI menu breaks jPCT textures
Post by: raft on February 13, 2008, 06:07:32 pm
i think it's FengGUI's fault too. i will try it later in windows

is there a 'normal' way of doing this other than replacing all textures with that gray one ?
Title: Re: FengGUI menu breaks jPCT textures
Post by: EgonOlsen on February 13, 2008, 06:13:32 pm
A normal way of doing...what?

What really makes me wonder is, that the textures upload fine but never appear. The only situation where i've noticed this is when uploading the textures in one OpenGL context and trying to use it in another. But that shouldn't be the case here. One last thing to try: After rendering the first frame, call setGLFiltering(true) on all textures. That will make jPCT upload them again in the next frame. I would be interested in the render of the following frames...
Title: Re: FengGUI menu breaks jPCT textures
Post by: raft on February 13, 2008, 06:26:28 pm
normal way of making all textures seem gray without replacing them with a gray one

calling Texture.setGLFiltering didnt help either. i've seen it on the console, all textures are uploaded again
Title: Re: FengGUI menu breaks jPCT textures
Post by: raft on February 13, 2008, 06:32:46 pm
i've noticed a thing: number of uploaded textures are much less than number of textures in texture manager. is this normal ?
Title: Re: FengGUI menu breaks jPCT textures
Post by: EgonOlsen on February 13, 2008, 06:40:08 pm
Yes that's ok. They are uploaded on demand. Getting a white/gray surface is usually caused by using a nonexistent texture (referenced by the ID that the log prints out) in that context. Or maybe textures are completely disabled...but obviously not, because the FenGUI thingy appears in your screen shot. Maybe setting Config.glVertexArrays to false is worth a try.
Title: Re: FengGUI menu breaks jPCT textures
Post by: EgonOlsen on February 13, 2008, 06:53:48 pm
You may also try to add a

Code: [Select]
ARBMultitexture.glActiveTextureARB(ARBMultitexture.GL_TEXTURE0_ARB);
GL11.glEnable(GL11.GL_TEXTURE_2D);

before calling jPCT to arms (i.e. before calling draw()) to re-enable textures on stage 0.
Title: Re: FengGUI menu breaks jPCT textures
Post by: raft on February 13, 2008, 07:23:16 pm
yeap, that arm thing brought my textures back, it's like switching to color tv  ;D thank you. i placed it between World.renderscene and World.draw. but menu still does not show up

here it is:
(http://img129.imageshack.us/img129/4169/fengguitestrh4.jpg)

so, any guesses about what the problem is ?
Title: Re: FengGUI menu breaks jPCT textures
Post by: EgonOlsen on February 13, 2008, 07:34:22 pm
No clue about the menu itself, but obviously FengGUI disables texturing and doesn't re-enable it again afterwards. I think it should take care of this. However, i can add it to jPCT...maybe i should do this instead of simply assuming that my exit state is my new entry state, which is what i'm doing ATM.
Title: Re: FengGUI menu breaks jPCT textures
Post by: raft on February 13, 2008, 07:44:46 pm
ok. meanwhile i'll send a mail to owner of FengGUI
Title: Re: FengGUI menu breaks jPCT textures
Post by: EgonOlsen on February 13, 2008, 08:39:27 pm
I've updated the jar in that hacks-dir with a version that may be able to handle this problem. Could you please give it a try?
Title: Re: FengGUI menu breaks jPCT textures
Post by: raft on February 13, 2008, 08:46:40 pm
yes, textures render correctly without arm thing with that jar
Title: Re: FengGUI menu breaks jPCT textures
Post by: EgonOlsen on February 13, 2008, 09:26:40 pm
Ok, fine. I've updated the 1.16rc1 with that fix. However, i'm not really sure that this is the whole story, so i'll wait for the reply you'll get from the FengGUI guy.