Temechon Posted October 25, 2013 Share Posted October 25, 2013 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 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 25, 2013 Share Posted October 25, 2013 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 Quote Link to comment Share on other sites More sharing options...
Temechon Posted October 25, 2013 Author Share Posted October 25, 2013 Ok, maybe I will give it a try in my spare time Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 26, 2013 Share Posted October 26, 2013 It will be huge!! Quote Link to comment Share on other sites More sharing options...
Temechon Posted October 27, 2013 Author Share Posted October 27, 2013 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... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 27, 2013 Share Posted October 27, 2013 You have to update this function: BABYLON.Tools.LoadImage = function (url, onload, onerror, database) { We use a img tag to load textures Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.