Jump to content

Problem displaying GUI textures (bGUI used on interface)


Recommended Posts

Hello to all the rouges out there,


I have a scene with a GUI (interface) that uses 28 textures on babylon plane objects.  I'm using bGUI for the interface, however, this appears to have nothing to do with bGUI as I've observed this behavior in previous scenes without any interface or GUI.  The problem is that once I reached approximately 10+ textures (in this case), I began to notice that about 10 percent of the time any one of the textures (chosen at random) weren't loading, and the scene was displaying black on the plane mesh - appearing as though the texture didn't load into memory.  I had to refresh (sometimes more than once) to load all textures.  This only occurs for a single texture everytime it occurs, and my largest texture resolution is 300px X 300px.  I am using a dynamic texture and painting on an object through the canvas - if this provides any additional useful information.


However, in increasing the number of textures, this problem increased slightly - until I reached 28 textures, when the problem wouldn't resolve even with repeated refresh.  It is always one texture, and no more.  I also removed a texture and it's associated code, and the problem persists every time.


I've tried adding texture.update(); and textureComplete = true; but perhaps I'm not using these correctly or in the best location in my script.


I welcome any suggestions, and thank everyone in advance for reading this post.





Link to comment
Share on other sites

OK, I don't have any REAL answer, however, I did find that the problem is with the very last texture I load in my script.  This is not always the texture which doesn't load and of couse displays black - but it is the very last texture I load in sequence in my script which doesn't load 99% of the time when this problem arrises.  My current solution?  I added a small texture which I don't require at all for my scene to load as the last texture in my script and into memory.  Now all my textures load 100% of the time - except for the last one in my script which I don't need and am using as a dummy fix until I or someone else finds the problem.


Crazy, huh?


EDIT: actually, it still doesn't load 100% of the time, but perhaps 98% of the time now.

Link to comment
Share on other sites

Hi DB!  I built a playground to try to see the issue that you see.  I was successful at building the playground, but I failed to reproduce the symptom.



I am using a dynamic texture and painting on an object through the canvas - if this provides any additional useful information.

Well, yes it does. That might be where the problem is.  Can you adjust my playground to "simulate" that?  All in all, do anything to that playground scene (and re-save many times if wanted)... that you can think-up... to try to "repro".  Maybe we load the textures into dynamicTexture 2d buffer and THEN use each dynamic texture as the mat.diffuseTexture?  How can we make this playground... simulate YOUR situation?   Can we?

I'll give it more thought, but, according to current trends, when I think about things, they get worse.  :D

Out of curiosity, what version of BJS are you using?  Any other pertinent info that you might have... do tell.  thx.

DB...  did you mean rogue?   I'm no rouge.  :)  (last I tested). 

I think the French invented "rouge", so there's lots of experts nearby.  And one can only wonder what the slang of that word... means in France.  Milktoast?  hah!   

I like it, though.  I will accuse my chat buddy in Kentucky... of being "a rouge", and see how he reacts.  I hope he understands which cheeks get the red coloring.  :x

[A wink to DK for the underscored 'r'.  'repo' is for git, 'repro' is for playgrounds, ya silly rouge.]  hehe

Link to comment
Share on other sites

:D  Hope we didn't ruin the thread, DB.  Any progress?


I'm a huge fan of French toast... but it's still a bit of a hassle to make it, quickly.  I bought a used French toaster on Ebay... but I didn't get the machine that I had hoped-for.  ;)  Is French toast called French toast... in France?  Same situation with French fries.  I suppose there is French French toast and French French fries, eh?  weird.


"I'll have some French American fries, and some American French fries, please."

Link to comment
Share on other sites

I meant to type rogue, but rouge works as well - specifically baton rouge, which means "red stick."  Actually, I'm not sure what I meant to say with this at all.  I just thought I'd avoid saying the standard "Hey Guys", or "Hi", or "Hello Babylonians", etc.  I'll have to come up with something better for future posts.


Anyway, I haven't been able to reproduce this in the playground either, so perhaps it's due to the extensions I'm using, the dynamic textures, or any of the various functions I've built for my app.  I'll continue to try and find scenes where this happens, and as soon as I find a second one, then I should have more info as to why the last texture in my script won't load.  But for now, with the "dummy" texture listed as the last to load in the script, all other textures load correctly.


Hell, it could even be a timing issue with our server.  Hopefully, it isn't a bug, but we'll only know as time passes and more apps are built.  And I'm going to continue to add fetures to this app, so perhaps this might become more of an issue as I add more functions.  I'll certainly let the forum know if I see anything further.  But for now, I'm happy to have a solution - even if it isn't the most elegant, or even really a solution, but more of a "trick."


And Wingnut, humor is always welcome. :lol:





Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...