Jump to content

Textures Resources in .babylon JSON


jacquesr
 Share

Recommended Posts

Hello guys,

I'm addressing this directly to the babylon devs:

From what I can read from examples using models with textures, the textures are always in separate image files. Are there any plans to include the textures as e. g. byte array directly inside the .babylon json? Or is there already a way to do so?

The background is that I would like to define a theme for a 3D scene I'm working on to contain models and also textures and the themes should be exchangable at runtime

So the best would be that the theme object contains everything. It would be great to have the babylon JSONs that I store in it also already contain the textures binaries.

 

Kind Regards

Jacques

Link to comment
Share on other sites

One solution could be for you to embed your textures as base64 images in a JSON. In your app you load and parse the JSON file (http://doc.babylonjs.com/tutorials/How_to_use_AssetsManager), and then create your babylon textures from that base64 images (same method as for pics).

If you prefer to store your textures in the .babylon file, you'll need to write your own data file, and a specific loader, based on the one already existing for the .babylon extension. BJS has already prepared such a process for you : http://doc.babylonjs.com/tutorials/How_to_Create_Your_Own_File_Importer

Have a nice day.

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