Jump to content

Texture updateSamplingMode issue


sable
 Share

Recommended Posts

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...