pichou Posted October 5, 2017 Share Posted October 5, 2017 What is the correct image format to use your own decal texture? I tried a lot of different images in my project but none have worked so far except the babylon one. I guess the image must be png and black on white? Here is a playground with one image test : http://www.babylonjs-playground.com/#1BAPRM#159 Quote Link to comment Share on other sites More sharing options...
RaananW Posted October 5, 2017 Share Posted October 5, 2017 Hi @pichou, I believe the problem you have is somewhat different: Access to Image at 'https://orig00.deviantart.net/1396/f/2007/179/9/5/texture_impact_by_mini_tyson.png' from origin 'http://www.babylonjs-playground.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.babylonjs-playground.com' is therefore not allowed access. You get CORS error - the image cannot be loaded. Your server should support CORS in order for you to async load images to the playground. That's the reason only images from babylonjs.com work (for example - http://www.babylonjs-playground.com/#1BAPRM#160 ) Quote Link to comment Share on other sites More sharing options...
pichou Posted October 5, 2017 Author Share Posted October 5, 2017 OK sorry I should have seen that. Here is a better test : In this playground I can play with the color and the opacity of the decal with the baylon image : http://www.babylonjs-playground.com/#1BAPRM#161 But with my own image it doesn't work anymore : http://www.babylonjs-playground.com/#1BAPRM#162 Pichou Quote Link to comment Share on other sites More sharing options...
RaananW Posted October 5, 2017 Share Posted October 5, 2017 Howdy, notice that the babylon image has a transparency channel. You have only black and white. Make the while transparent and give it a try. Quote Link to comment Share on other sites More sharing options...
pichou Posted October 5, 2017 Author Share Posted October 5, 2017 Ok better, thanks : http://www.babylonjs-playground.com/#1BAPRM#163 If thought the downloaded image already had a transparency channel but there was an alteration when downloading it. 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.