Jump to content

Preloading Help


DylanD
 Share

Recommended Posts

Hey everyone,

    I am trying to use assetManager to preload as much as I can.  I already have it preloading all of my sounds.  However when trying to preload gui elements (specifically gui images) i get stuck.  I can use addImageTask to get a HTMLImageElement, however i dont know how to make that into a gui element.

 

Any ideas? :D 

Link to comment
Share on other sites

45 minutes ago, Sebavan said:

You could probably rely on TextFileAssetTask and once the task is done fill the ShaderStore with your custom shaders ?

hmm, im not sure i understand what you mean.  To clarify(as i am a novice and want to make sure we are on the same page), i have shaders saved as shaderName.vertex.fx and shaderName.fragment.fx, i want to load them with other preloaded assets, just to make the game a bit smoother on initial load in.  I plan on saving them to a global object/global variable in my project.  

How i have the shaders implemented already is (with having the shaders save like above) i use

 

new BABYLON.ShaderMaterial("",scene, shaderPath, {attributes:[], uniforms:[]});

 

That works great, however i dont use shader store.

 

So what you are saying is i could use textFileAsset task then use that as the fragment and vertex files or use that text to write to shaderstore?

 

Im not sure i would do that as it seems somewhat complicated for little gain (i have 4 shaders so loaded files)

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.

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

Loading...
 Share

  • Recently Browsing   0 members

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