I need to display textures with white backgrounds as transparent backgrounds.
I know I can edit the image and replace the white with transparent. But I need to use a lot of online sources like this and it would give me a lot of extra manual work without automation.
Here is an example with cube:
(Please note, I don’t need a cube, it is just an example. Example of any kind of shape would be helpful.)
Is there a chance to make the white bg color transparent?
Thanks a lot,
You could use a custom shader?
that sounds nice.
But do you know about nice example for beginning?
I found 2 here: Putting Shader Code Into Babylon.js | Babylon.js Documentation but both are not usable.
In first one, there’s no effect after code changes. The second one is almost empty, so no chance at all to train by changing something.
The node material editor is a easier method of creating custom shaders: The Node Material Editor | Babylon.js Documentation (babylonjs.com), in fact, it’s a pretty simple shader to do: Babylon.js Node Material Editor (babylonjs.com)
this helped a lot!
So, the final solution is here: https://nme.babylonjs.com/#DT58R5#5