haestflod Posted December 19, 2017 Share Posted December 19, 2017 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 Quote Link to comment Share on other sites More sharing options...
haestflod Posted December 20, 2017 Author Share Posted December 20, 2017 I noticed if I wasn''t looking at the meshes they would be correctly updated, so if I do a 360 camera spin and then markAsDirty() the ambient texture value is properly applied Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 20, 2017 Share Posted December 20, 2017 Hello as I see you are playing with freezing materials which could be tricky (and no more required in 3.1 :)) Would you mind trying to repro the issue on the playground? It's gonna be far easier for me to help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.