Convergence

Members
  • Content Count

    124
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Convergence

  1. Hmm, that is quite the commitment , to export every mesh out of hundreds individually
  2. Say you have a project that loads has a large number of meshes, for example furniture, each with their own (multi)material. Now the actual scene only displays a select few of the loaded meshes according to what the user wants to see (eg. house blueprint). However all the vertices of all meshes and all textures of all materials are loaded into memory, which of course increases the memory consumption quite a bit. I've tried using the meshName filter of the ImportMesh call, but that increases the scene loading time by quite a bit since it will reload and reparse the .babylon file for every asset used in the scene to load the specific mesh. Additionally if the user wants to add another asset to the scene after the initial load, the .babylon file will have to be called yet again. Then I tried to at least dispose() all materials of all unused assets to free up the texture memory after loading them, and only recreate the required material if a mesh is actually enabled in the scene (by storing the texture url in an array), but mass disposing of materials/textures that are not yet done loading causes quite some quirks in the babylon scene where the textures are sometimes applied to random other meshes and even random renderTargetTextures like my shadowgenerator. Any ideas on how to reduce the memory footprint? Thanks in advance
  3. Since the security patch where SharedArrayBuffer was disabled, this doesn't work anymore
  4. Hmm, looks like I won't be registering a domain for this, so you might as well use the current url
  5. I agree with Deltakosh, I think these kinds of details are much better done using bump or parralax mapping, since the overall shape looks fairly simple. Many of the details would be lost on mobile anyway.
  6. Thanks for the effort My own edit work as such that if one shape has UV2, then it is assumed that all shapes have UV2. I believe this is also the behavior of the color channel?
  7. For my new project I ideally need to be able to create simple hipped, gabled, and pointed from any arbitrary shape given (by JSON). Pointed and dome roofs are easy enough since the shape just converges to one point upwards, but I can't figure out gabled and hipped roofs just yet.. See attachment for a visual. Does anyone have any idea how to do this? The input would be an array of (clockwise) Vector2's describing the outline of the building. Here's a PG to play with, obviously I didn't find any solution yet myself https://www.babylonjs-playground.com/#AT8MET
  8. Sorry, I didn't receive a notification, so apologies for the late reply. Thank you No problem, but I might get a better url if I'll get more serious about this project lol. I'm not sure how to repro the minimap issue in the playground since I'd need more than once <canvas>. I basically want to have two instances of the babylon engine, two separate scenes and then copy meshes from scene one to scene two. I tried to just push() the meshes to the scene2.meshes[] array but that didn't work.. Thank you for the suggestion I tried it, unfortunately I think maybe my babylon.js is outdated (3.0), the updatable flag didn't seem to do anything. When doing a performance check in Chrome during the building of SPS, the top function are javascript internals: GC, typedArrayConstructionByArrayLike, bufferData, push. the top non-internal function is SPS.setParticles(). PS. any chance SPS could support a second UV channel? I always need to manually edit babylon.js to add UV2 to the SPS, which makes it quite bothersome for me to upgrade
  9. I worked before on a city simulator before but unfortunately my motivation fizzled out and I never really continued with it, because there were some issues such as intersections for which I never got a good solution. After a while I stumbled accross Mapzen, which mainly uses openstreetmaps data and decided, why not combine it with babylon. I'm not the first one to try it , but still doing it for fun It uses SPS, but the SPS.buildMesh() function is kinda slow which causes the initial load to be rather slow. Here's my rendition (still alpha/beta) of 3D openstreetmaps with babylon.js with some examples (only tested in chrome desktop and android): newark liberty airport french alphs naarden vesting hong kong (elevation data is not very accurate for asia unfortunately) Need good gfx card: lower manhattan manila The search currently uses openstreetmaps search which is kind of wonky. If you want to search a city, it's better to search a landmark within that city. Current issues: Is there any way to speed up the initial buildMesh() call for SPS? I remember reading something about offloading SPS tasks to the worker? I can't get the minimap thing to work.. how to copy a mesh to another scene?
  10. Thanks https://www.babylonjs-playground.com/#FZEH1H#2 I changed your playground to parent the lookAt mesh, and it shows what I want to achieve more clearly (and currently not working), if the 'looker' has a parent which is rotated the lookAt function is not working as expected. Thank you yes it seems to be doing that for the target position, but what about if the 'looker' mesh also has a parent, which is rotated? (which may also have another parent which is also rotated), like in the playground above?
  11. Each material per mesh(or instance thereof) is basically one draw call. Seconding @aWeirdo, having all cards of the same suit in one large texture would likely reduce draw calls by a lot. If you do this, you'll probably want to use SPS to get the draw call reduction benefit. I assume many cards will only be visible from the back, so they can all be collapsed onto one draw call.
  12. It looks like mesh.lookAt() doesn 't work correctly if either the mesh and/or it's target are parented; is this intended or not? https://www.babylonjs-playground.com/#FZEH1H comment line 27 out for correct behavior.
  13. Sorry for the late reply hehe. I'll table my desire for curved walls for now :D, easier to just ExtrudePath a curved path to create a curved mesh without holes
  14. Maybe you can duplicate the grondMesh before flatshading() it, and perform the getHeightAtCoordinates() on the smoothshaded mesh, while its hidden?
  15. Very cool, any chance there could be a tutorial for the PolygonMeshBuilder in conjunction with the angled corners? Would it work for curved walls?
  16. you can try var c = BABYLON.Vector3.Center(a, b).add(new BABYLON.Vector3(0, BABYLON.Vector3.Distance(a, b) / 5, 0)); change axis in the add portion as deeded.
  17. For now I've settled on a Epsilon of .02, seems to stop the jitter but allows my slowest-moving-mesh to still move at their normal speed As an additional benefit it seems to stop the sliding down minimal inclines. Thanks for the help! If there are additional drawbacks I guess we'll find out
  18. Ah, I found the drawback, when a mesh moves too slow it won't move at all anymore..
  19. Yeah, changing BABYLON.Engine.CollisionsEpsilon to .1 seems to stop the jitter.. but I wonder what's the drawback because nothing comes free
  20. yeah I'm referring to #2, personally I'd call #1 a callback. Yeah the BABYLON source can be a bit abstract at times with many nested function calls having very similar names.
  21. Oh, great, my bad for not looking more thoroughly Sorry, another question (last I hope), does DynamicTerrain support something like .dataFromHeightMap (possibly with an offset option so a different portion of the image could be used when the player walks around)?
  22. I might give it a try.. would you mind to point me to the function name that does the 'pushback'? cool, I'll have to check it out
  23. Thanks Wingnut for the suggestions I don't actually have this problem with a groundmesh, I have a similar solution to yours, however there are also other various meshes the playermesh can walk on, which is where the jitter (that was the word I should have used) occurs. And to check for intersections on every frame for every possible intersecting mesh will probably kill performance.. Optimally I would just like to disable the pushback' from the collision worker. The .showEllipsoid is a very useful function you wrote there; are you sure its still accurate when it comes to mesh scaling and a non-standard position of the pivot point?
  24. @jerome Would it be possible to add .getHeightAtCoordinates() and .getNormalAtCoordinates() to DynamicTerrain?
  25. Thanks for the reply Is there no way for get the angle of collision (and pray, the mesh id of collision) back from the worker?