Jump to content

Can we talk about TGA textures ?


Temechon
 Share

Recommended Posts

Hi Delta, 

 

I have a problem when loading a model having one (or several) TGA image texture : it seems the model is never loaded. 

I use the function BABYLON.SceneLoader.Load to load my babylon scene exported from Blender, but the callback function given in parameter of executeWhenReady() is never called.

I can post my model and my textures if needed.

 

I know that this format is not supported for the moment (cannot be used by a browser), but it's a widely used format in 3D video games.

 

Do you plan to support these kind of image in the future ? If no, could you explain why ?

 

Thanks.

 

Temechon

Link to comment
Share on other sites

The scene will never get ready because some textures cannot be loaded.

 

Babylon.js does not support .TGA files because browsers cannot load them. If we want to support them, we have to create our own decoder (using a XHR request). This is not impossible but right now we are not planning to do so.

 

But with the magic of the community, if someone wants to contribute, we will be happy to incorporate him :)

Link to comment
Share on other sites

So, from a theoritical point of view, it would be to get the TGA blob by XHR request, and convert it to base 64 ?

 

I think the image texture loading is in babylon.database.js, here : 

transaction.oncomplete = function (event) {                var blobTextureURL;                if (texture) {                    var URL = window.URL || window.webkitURL;                    blobTextureURL = URL.createObjectURL(texture.data, { oneTimeOnly: true });                    image.src = blobTextureURL;                }                else {                    notInDBCallback();                }            };

Would a TGA base64 string be displayed in an Image.src ? I can't find anything on the subject...

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