We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

update scene worldMaterial

Home Forums Programming update scene worldMaterial

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #86476
    gnanasai
    Participant

    I am trying to setup a verge 3d scene using only the js code. I am not using the App Class.
    Is it possible to get the worldmaterial from the glb and add it as scene worldMaterial?

    const loadedModel = await gltfLoad(url);
    scene.worldMaterial = loadedModel.world.material;
    #86479

    Hi,
    It’s quite possible, however you should recreate App.updateEnvironment() method in your code after you assign scene.worldMaterial. This method renders background and PMREM (environment lighting aka IBL) buffers that are required to properly display your scene.

    Soft8Soft Tech Chief
    Want more Verge3D updates? Follow me on X, Facebook, or LinkedIn

    #86481
    gnanasai
    Participant

    Thank you, I will try that.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.