Use viewer for textures and materials

Hi everyone,

I don’t know if it would be possible to user the Babylon viewer only to figure a sphere with a pbr material.

I want to use it to preview my textures library.

Thanks in advance,

Boris

Anyone ?

I thought it was easy… :slight_smile:

This is the weekend :slight_smile: be patient, and the viewer is currently not meant for this like the sandbox can be.

If you wish to add it, you could look at the Sandbox code who is quite able to support it.

cc @RaananW as it might be a interesting use

Oh, that’s more than possible. but requires a bit of coding, so it’s not exactly a “viewer” feature, but a babylon ferature.

You can load a predefined model (i.e. the sphere), and then get the viewer’s scene (and model), and change the texture programmatically. For that you can use the viewer’s events - Babylon.js Viewer - Advanced usage | Babylon.js Documentation. keep a reference of the model, and change its materials’diffuse texture when needed

1 Like

Hi @bvaisman just checking in, was your question answered? :slight_smile:

Yes i will try what @RaananW told me.

2 Likes