I am trying to apply displacement map on a face of a box.
It works on a sphere, but no on a box
Can anybody explain how to apply displacement map on one face of a box?
Thanks!!
I am trying to apply displacement map on a face of a box.
It works on a sphere, but no on a box
Can anybody explain how to apply displacement map on one face of a box?
Thanks!!
You must set the vertices updatable:
https://www.babylonjs-playground.com/#WUYDVT#25
You can subdivide the cube to increase the vertex count to get better result, but itโs still not very nice:
https://www.babylonjs-playground.com/#WUYDVT#26
The cube is not really suited for this displacement map.
Note that thereโs a bug with Mesh.increaseVertices
, the PG above will only work once this PR is merged:
Thanks for the explanation!!
How about I create a ground using CreateGroundFromHeightMap and merge it with the face of the cube that I want?
Do you think it would be too inefficient?
Is sphere the only shape that can be used with displacement map??
Any shape can be used with displacement map, but the result will depend on this shape and the map.
You can also create a ground and apply the displacement map on it.
Sorry for the late reply! Yes, applying a displacement map on a ground sounds like a smart idea