Hello everyone, I have just started with BabylonJS, and till now its been a great framework for me. I have gltf model which has glossy material applied to it so I am looking for a way to get that material from it and apply it as a PBR material lets say on a basic 3D object in BJS “box”.I am unable to have an approach for this problem so if anyone can help.
@Deltakosh can u have a look?
Hello and welcome!
Imported models have their own materials, but you can use these materials on any other mesh. Optics might be weird sometimes, but this is a simple assignment to the .material
of the object. You can get any material by its name using scene.getMaterialByName
. If you don’t know the name - open the inspector, you will see all materials there.
If you want to start a playground (https://babylonjs-playground.com) and show us what you did so far, we will be more than happy to help you with code.