• Content Count

  • Joined

  • Last visited

About Rolento

  • Rank
    Advanced Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi @NasimiAsl Awesome, your guidance has been A++++. I need a few days to go over the content you provided and get my head into the domain of shader code, but this looks pretty amazing. A question I was going to ask was how do I make the texture transition regions (joins) appear non straight (i.e. random / more natural). However, looking at some of the posts above I can see similar effects to what I am wanting have been illustrated. So once again I just need some time to digest what has been said. Thank you for your help on this topic, you have been a great help!
  2. Hi @NasimiAsl Wow! The solution you provided is exactly what I am trying to acheive. Looking at the code, its is pretty amazing to see that you have been able to implement the solution in just a few lines! Would you be so kind to answer a few more questions? 1) Looking at your code I have "tried" to understand what it is doing but I have to admit I am lost. Could you possibly add some comments to your code that explain what each line is doing? Also, if there is a website that you could recommend to enable me to learn more about how to use the ShaderBuilder library that would be great. I am a newbie in the realm of shaders therefore I need some hand holding... 2) With respect to the solution you provided can you possibly explain how I could apply it to my playground example? If you look at lines 86~94 you can see the code for making the transtions (i.e. between grass and rock texture). However, what I am wanting is to specify an exact location along the face of a shape where I want the texture transition(s) to occur (e.g. see the attachment). 3) How do I blend 3+ textures? 4) How do I specify the length of the texture / blend transition region? Thanks in adavnce...
  3. Hi @dbawel Sorry for the delayed reply, work keeps jumping in the way of me getting my teeth into BabylonJS at the moment *sigh*. Thanks for your guidance, from my perspective I need a little hand holding because some of these concepts you proposed are unknown to me. My biggest challenge at the moment is finding examples that illustrate the basics - then I can proceed to start building out my solution. If you are aware of any tutorials/samples that explain the concepts you are proposing I should adopt then I would really appreciate if you could share. At the moment I am trying to get my head around this workflow: > The simplest solution I can think of doing quickly and easily is to "generate" a seperate mesh duplicating the faces of your existing mesh which you wish to blend materials, and apply a texture to this duplicate mesh which by masking blends the multi-materials on your current PG mesh Im not 100% sure I follow the above process, but im guessing you are saying something like the following illustration I created: << see attachement >> * I dont suppose you could create a diagram to illustrate what you exactly mean assuming the above process illustration is incorrect? If on the off chance the above is correct can you point me the in right direction to explain how: 1) how do I "clone" / "copy" a region of a mesh as per the above? 2) how do I apply a transparency mask as per the above? 3) how do I blend the new mesh (i.e. mesh 2) to an existing as per the above? I hate asking so many questions but im really lost on this one... Thanks in advance for any help you can provide.
  4. Hi All I have been exploring multimaterial texturing today and its great. However... I have encountered an issue that I can see no obvious solution to. What I am wanting to do is have "smooth" blended transitions between each of the multi-textures that are applied to the shape. Provided below is the 3D scene I have created which has the multimaterial textures applied: As you can see there are two textures that are being alternated across the face of the 3D model - each transition is a "hard" transition whereby there is no blending. Question: What I am wanting is for each texture transition to be blended - is there an easy way to do that? One solution "hack" is to create a 3rd texture that is a blended rendition of the two textures, then I could insert this blended texture between each of the transitions. Hopefully there is a simple solution that prevents me from having to go down this route! Thanks in advance...
  5. Hi @gryff Sorry for the delayed reply, I have been off the scene recently (too much work - grr). Thanks for your pointers/advice, the approaches you have provided will help my get what I need done. Much appreciated!
  6. Hi @gryff Thanks for the reference sites and advice. I will have a play and see what works best for me. By the sounds of it the Blender decimator is not too hot, and it seems I would be better off using another solution like MeshLab. Anyway, I will give both options a try. Thanks.
  7. Hi @8Observer8 The example you provided is useful, it neatly shows how a simple scene can be put together using an imported model and texture file. I guess one of the challenges I have is that the models I am importing will be complex (i.e. have many subset meshes which require different materials to be assigned). So, I need to experiment with code/processes that help me achieve that. I think with the help I have received thus far I should be in good shape. Fingers crossed...
  8. Hi @gryff Thanks for the clarification regarding how materials are assigned to a shape - the process is now a lot clearer in my mind. Regarding decimation of models, I will take a look at MeshLab because my challenge is that I am being provided with high fidelity models that frequently exceed the 64k limit. So I need to decimate them so I can use them as desired. So thanks again for pointing me in the right direction (btw - I did not even know Blender had a decimation tool so I will play with that too).
  9. DOH! Yep that fixed it! Deltakosh you are.... a super star! Thanks for this enhancement (im sure others will love this too).
  10. Hi Deltakosh Awesome!!!!! But... I have a problem (I think) - when I click on the PG link for some reason the rendered scene does not seem to have the displacement map applied correctly (i.e. it looks stretched as per the original PG I posted). Would I be correct in assuming that the PG is not referencing the latest source code as contained within the GIT repo?
  11. Hi David Thank you for the information, I will check out the references and try and knock something together. This is exactly the kind of guidance I was looking for, so thanks again!
  12. Hi All I am trying to import a 3D model (created in Blender or 3D Studio Max) and I am also wanting to have all materials imported and applied to the 3D model too. So in essence I want to do the following: 1) design model in 3D Studio Max (create mesh and apply all textures to subset meshes at design time) 2) export 3D Studio Max model and convert to Babylon model (both mesh and textures materials included in exported file) 3) create a simple playground script that loads the exported model (and meshes) from step 2, then render them in a 3D scene I have searched the forums and I cant find anything obvious that talks to the above design/development process. If someone can point me in the direction of documentation that enables me to achieve 1, 2, 3 above I would very much appreciate it. FYI - my main questions are: 1) when creating the 3D model in 3DS or Blender is there anything specific I have to do to ensure the "materials" are correctly exported such that BabylonJS can read the model and materials and render them? 2) if the exported file (from 1) has to be converted into a specific BabylonJS format is there a tutorial? 3) what BabylonJS code do I need to use to; import the 3D model, import the materials, apply the materials to the model? 4) as I understand a 3D model imported cannot be more than 64k vertices due to WebGL constraints, in this situation is there a decimation tool that is recommended to simplify the complexity (vertex count) of the model? Ideally if someone has a PG script that explains how to import a 3D model and have the materials applied that would be great. * I suspect the above has been documented somewhere, unfortunately I cant find it (so I apologise if thats the case) Thanks in advance
  13. Hi All I am experimenting with displacement mapping and have had a degree of success, but have encountered some issues that the community might be able to help with. Looking at the <shape>.applyDisplacementMap() function it can be seen that it does not support the ability to control how a displacement map texture is applied to the shape. Therefore, if you create a complex 3D model that requires greater control over how the displacement map is applied (i.e. tiled) to it then unfortunately you will encounter problems. I started out by creating a 3D model and then applying texture, bump and displacement map to it. I used the standard applyDisplacementMap() function which produced the following result: The above example illustrates how the displacement map is being stretched across the entire geometry of the shape – which is not what I want. I want the ability to control how the displacement map is tiled across the geometry of the shape – similar to that of uScale & vScale for bumpTexture: e.g. mat2.bumpTexture.uScale = 5; mat2.bumpTexture.vScale = 9; I looked at the underlying functionality of applyDisplacementMapFromBuffer() in an attempt to try and extend it to have greater control over the tiling – but TBH I am not understanding how some of the key lines of code are working. So, I decided to take another approach. Before I explain my solution “I KNOW” this is not a scalable solution and not efficient on many levels. However, it enabled me to apply a tiled displacement map to small geometry shapes – this allowed me to envisage what shapes will look like when displacement maps are applied correctly. NOTE: the main issue with the approach I took is memory allocation – i.e. you will hit out of memory if you try and apply my method to a large 3D model mesh. The interim solution I created is to create a displacement map texture (image) that is sized and tiled appropriately such that I can apply it to the 3D model geometry using the applyDisplacementMapFromBuffer() function. The solution I created is below: Explanation: line 94: obtains the displacement map image (not tiled) line 97: creates a tiled displacement map image (mirroring that of the bumpTexture uScale/vScale) line 99: apply tiled displacement map to 3D mesh line 101~102: free resources (because line 97 is very resource intensive!) The above solution generates nice results as per the PG example – but this is not something that is scalable (the right approach is ofcourse to tile a smaller texture across the geometry of the 3D mesh). I am hoping (praying) that one of the Babylon JS arch master developers can tweak the applyDisplacementMap() function such that the uScale/vScale tiling can be controlled. Perhaps someone can point me in the right direction so I can do this myself? Anyway, I hope this example is of some use to the community.
  14. Hi @jerome Thanks for the research and summary of the problem. The workaround you suggest is quick and easy to implement, perfect.
  15. @aWeirdo The alternative solution you provided works perfectly for me (Internet Explorer & Firefox). However, a friend of mine using a MAC (Safari) discovered that the system crashes (well the 3D objects vanish from the scene) when he moves the mouse on to the canvas region. Unfortunately I dont have a MAC so I cant debug this - does anyone else see this problem?