• Content Count

  • Joined

  • Last visited

  1. maybe you can take a look at the files generated by blender?
  2. yea, sorry i'm taking so long. I'm trying to figure out how to work the playground. I don't see where to upload my babylon file
  3. @Sebavan I was actually alerted to this thread by another user, because I was having the same issue. I am trying to apply a displacement map on an imported mesh, but have had no success. I don't understand what I am doing wrong with regards to the applyDisplacementMap function. I have tried the code snippet below. I have also tried the same snippet and replacing the undefined with null, and I have omitted the last 4 paramters all together. None of those solutions worked. As another user wanted to make sure of on another thread, I confirmed that the mesh I am working with is indeed the correct mesh I am trying to apply the displacement map. I have also checked the network tab and the correct displacement map image is being loaded. It's just not reflected on the display. I have also confirmed that my mesh has position, UVs, and normals, but I only know how to confirm them in blender. In the console I can see my mesh has position, but I am unsure about UVs or normals. BABYLON.SceneLoader.ImportMesh('', 'assets/models/island/', 'island.babylon', scene, function (newMeshes) { var mesh = scene.getMeshByName('Island'); setTimeout(function(){ mesh.applyDisplacementMap('/assets/models/island/Sand_003_DISP.png', 0, 5, undefined, undefined, undefined, true); }, 2000) });
  4. @JCPalmer Thanks for all your help so far. I have tried what you suggested and it seems I was targeting the correct mesh. When I check my console tab, the applyDisplacementMap function was loading my displacement map image, but the displacement is still not being applied. I will move this question to Q&A after scouring that section for more info. ^__^
  5. @Sebavan I am having the same issue with my imported mesh. My mesh definitely has normals and UVs, but I don't understand what you mean by, "...the code requires to have, position..." This may be what I am missing.
  6. @Sebava sorry for the weird message. I messed up and accidentally hit enter
  7. @JCPalmer It tried adding true at the end, but nothing seems to happen. Going through the playground reveals a lot of examples with imported meshes that just doesn't work. I've also tried replacing the nulls with undefined without success. Are there other boilerplate code that must be present? BABYLON.SceneLoader.ImportMesh('', 'assets/models/island/', 'island.babylon', scene, function (newMeshes) { newMeshes[0].applyDisplacementMap('/assets/models/island/displace.png', 0, 5, null, null, null, true); });
  8. @JCPalmer ah... You must've miss typed because your original reply said the exporter does support exporting displacement maps. I got really excited lol! It would've made things so much easier as I know much more about Blender than BabylonJs. Oh well. Your tip seems simple enough. I'll do the force update when get home tonight. Thank you for the pointer! 😀
  9. @MarianG Thanks. I do have UVs and normals set on my meshes. I'm not sure what I am doing wrong because I'm most likely doing something wrong. @JCPalmer Cool! Do you know how can I export the displacement maps? I have set the displacements on my blender texture, but they don't export with the babylon file. Here's what my blender looks like
  10. Hi Everyone! I am new to babylonJs and for the life of me can't figure out how to export a mesh that contains a displacement map. Does the blender exporter support displacement maps? If no then how can I apply a displacement map after the mesh has been exported to babylonJs? I have tried the following code after importing the mesh. Again I would prefer it if I can just export the mesh with the displacement mapping, but if that's not possible then I would like to apply it after it has been imported to babylonJs. BABYLON.SceneLoader.ImportMesh('', 'assets/models/island/', 'island.babylon', scene, function (newMeshes) { newMeshes[0].applyDisplacementMap('/assets/models/island/Sand_003_DISP.png', 0, 5); });