sable Posted July 30, 2018 Share Posted July 30, 2018 It seems like texture.updateSamplingMode() doesn't actually work (though looking through the code, it looks like it should, as it's making the right gl calls). http://www.babylonjs-playground.com/#Q9RDM0 I noticed this as loading a .babylon file with sampling mode set wasn't working (though the samplingMode property on the texture would be correct, it was not rendering in that mode). (And assuming that it should work, https://doc.babylonjs.com/resources/file_format_map_(.babylon)#textures should probably be updated to include the samplingMode property) Quote Link to comment Share on other sites More sharing options...
Guest Posted July 30, 2018 Share Posted July 30, 2018 Yep this is definitely a bug..Let me check that (will be in next commit) Quote Link to comment Share on other sites More sharing options...
Sebavan Posted July 30, 2018 Share Posted July 30, 2018 Good Catch, it comes from the fact that the texture has not been loaded yet whilst you are trying to change the mode: http://www.babylonjs-playground.com/#Q9RDM0#2 I will modify the code to ensure it works even before waiting for the end of the loading. Thanks sable 1 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted July 30, 2018 Share Posted July 30, 2018 I looked deeper at the issue and it requires : https://github.com/BabylonJS/Babylon.js/issues/4746 this one to be addressed first. As you have 2 workarounds: - Pass the information through the constructor - Update once the texture has been loaded I ll fix it as part of the texture issue on Github (I updated the issue already). Please @sable let me know if that works for you. Quote Link to comment Share on other sites More sharing options...
sable Posted July 31, 2018 Author Share Posted July 31, 2018 Yeah my use case is loading a model (.babylon format), and then applying a customMaterial to it (so I can modify the shaders). I was trying to just attach the texture from the original material to this new material and just update the sampling mode when I ran across the issue (after discovering that setting the sampling mode in the .babylon file was also didn't work). My workaround was to just extract the url and make a new texture, which I'll continue to do for now, as even waiting for the texture to load doesn't seem to always work. Thanks for looking into this. 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.