Jump to content

Changing ambient texture doesn't always work


haestflod
 Share

Recommended Posts

EDIT:  Issue solved by upgrading from 3.0.7 to 3.1.1

Hi, I'm using an ambientTexture as a lightmap and a user has the ability to toggle between 2 different lightmaps.
I'm currently on babylon 3.0.7 as I havn't been able to update to 3.1.1 yet.

What happens is that it works for the majority of the meshes & materials.
However for some meshes they don't always correctly apply the ambient texture greyscale multiplier.
I've tried the following 3 functions:
 

material.unfreeze();
material.markDirty();
material.markAsDirty( BABYLON.Material.TextureDirtyFlag );


If I use the code below some seconds afterwards manually it sometimes works properly and sometimes it doesn't.
 

scene.materials.forEach( (material) => { material.markAsDirty( BABYLON.Material.TextureDirtyFlag ) } );


Is there anything else I can do to trigger the material to update?

The babylon.js file is exported with the old unity exporter.
The StandardMaterial's diffuse texture has alpha enabled

 

Link to comment
Share on other sites

  • Wingnut unfeatured this topic

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...