Sign in to follow this  
MarianG

applyDisplacementMap on importedMesh?

Recommended Posts

To apply displacement map on a mesh the current code requires to have positions, normals and UVs. Or the skull is not having any UVs defined. 

As a workaround, you can add uvs manually, or take a mesh with uvs for your tests. I ll see if I can easily remove the UV restriction from the code.

Share this post


Link to post
Share on other sites

Yes, your uvs are wrong and not the good length as you can see here: http://playground.babylonjs.com/#K2ES59#2 (looking at the  dev tools)

So creating uvs by code for random shapes is almost sorcellery and I would advise you to use a 3d modeler for this task or only use models with uvs.

I added some here just as an example: http://playground.babylonjs.com/#K2ES59#3

You can after easily use your displacement map: https://www.babylonjs-playground.com/#LYXHTH#11

Once you have all the required channels, you should be able to add your displacement map but you have to force update as loaded mesh are usually none updatable: http://playground.babylonjs.com/#K2ES59#6

 

 

Share this post


Link to post
Share on other sites

Hi. I know I marked this as solved but I'm still missing something. :( 
I checked an object with 3ds max and it has uvs, 
image.png.398cdd658cc2b01e8f20594129c9abbe.png
but on babylonjs when looking for uv they are not there. I have to do something more for this getting this uv?
Thank you 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   1 member