FengGUI menu breaks jPCT textures

Started by raft, February 13, 2008, 04:28:45 PM

Previous topic - Next topic

raft

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:


very odd, any ideas ?

EgonOlsen

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?

EgonOlsen

Are you doing anything like multi texturing, projective textures or shadows?

raft

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.


EgonOlsen

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

EgonOlsen

You can try this 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.

raft

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:

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!

EgonOlsen

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?

raft

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

EgonOlsen

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.

raft

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 ?

EgonOlsen

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

raft

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

raft

i've noticed a thing: number of uploaded textures are much less than number of textures in texture manager. is this normal ?

EgonOlsen

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.