Author Topic: FengGUI menu breaks jPCT textures  (Read 8416 times)

Offline raft

  • quad
  • ******
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
FengGUI menu breaks jPCT textures
« 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:


very odd, any ideas ?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: FengGUI menu breaks jPCT textures
« Reply #1 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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: FengGUI menu breaks jPCT textures
« Reply #2 on: February 13, 2008, 05:02:31 pm »
Are you doing anything like multi texturing, projective textures or shadows?

Offline raft

  • quad
  • ******
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: FengGUI menu breaks jPCT textures
« Reply #3 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.


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: FengGUI menu breaks jPCT textures
« Reply #4 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...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: FengGUI menu breaks jPCT textures
« Reply #5 on: February 13, 2008, 05:41:08 pm »
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.

Offline raft

  • quad
  • ******
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: FengGUI menu breaks jPCT textures
« Reply #6 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!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: FengGUI menu breaks jPCT textures
« Reply #7 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?

Offline raft

  • quad
  • ******
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: FengGUI menu breaks jPCT textures
« Reply #8 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: FengGUI menu breaks jPCT textures
« Reply #9 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.

Offline raft

  • quad
  • ******
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: FengGUI menu breaks jPCT textures
« Reply #10 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 ?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: FengGUI menu breaks jPCT textures
« Reply #11 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...

Offline raft

  • quad
  • ******
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: FengGUI menu breaks jPCT textures
« Reply #12 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

Offline raft

  • quad
  • ******
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: FengGUI menu breaks jPCT textures
« Reply #13 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 ?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: FengGUI menu breaks jPCT textures
« Reply #14 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.