brianzinn

Members
  • Content Count

    833
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by brianzinn

  1. brianzinn

    Path all points animation

    You can also add onAnimationEnd param: scene.beginAnimation(vehicle, 0, length, false, 10, () => { heartFlight(vehicle, move_trajectory, index + 1); }); https://www.babylonjs-playground.com/#X0MDYG#2 If you added any points during the animation, they would get added to the end. You would need code to restart a completed animation or perhaps a queue push/pop as @bghgary suggests. I added some smoothing, so the speed is consistent on different length path segments. If you don't want a steady speed then you can look at slerp on total length or rebuilding animation when points are added (start at current pos) and using the built-in easing functions. cheers.
  2. brianzinn

    bluetooth DS4 WebVRController

    I've played around with the GamePad API for GearVR and Daydream controllers and after figuring out how to debug them the coding part was easy. The gamepad API you can check yourself what is being returned. Looks like your controller is not supported by gamepad API, based on what you are saying though. Do you get any devices returned at all when connected? Check out this post for how to debug Android devices (over USB or WiFi). Very useful for figuring out what is happening with gamepad
  3. brianzinn

    mesh.getAbsolutePosition() always 0,0,0

    Look at the vertex position data to see why (ie: 852 is far from world center): console.log('pp:', mesh.getPivotPoint()) console.log(mesh.getVerticesData(BABYLON.VertexBuffer.PositionKind))
  4. brianzinn

    custom shader with dynamic textures

    The !X is a "communication administratively prohibited" (I think ipv4) that Digital Ocean uses. Try 'tcptraceroute or traceroute -T'.
  5. brianzinn

    Degrading sound

    It's not because the camera is further from the player when you have more players? When you attach a sound to the mesh (ie: sound.attachToMesh(mesh)) then the sound comes from the location/distance of the mesh. I load quite a few sounds in my game attached to many meshes and have not found any issues. Any way you can reproduce as a PG otherwise?
  6. brianzinn

    3D Text library

    I don't know how 3D text library looks in Unity, but you can use vectororize-text with PolygonMeshBuilder (note the webpage to demo is gone, but vectorize-text is still on github). edit: I didn't know about MeshWriter - would go with that for sure
  7. brianzinn

    BABYLON.Augmented Reality ...

    From @mkaouri "If the iOS 11 showing the front camera, you've to make sure that faceMode constraint in artoolkit.min.js is set to 'environment' to use the back camera of your mobile."
  8. brianzinn

    BABYLON.Augmented Reality ...

    hi @MarianG, I didn't really follow the AR.js - from my recollection it was relying on another engine renderer. If you are not specifically after AR.js, do the jsartookit examples no longer work https://github.com/mkaouri/jsartoolkit5? Also, BabylonJS 4.0 has AR via WebXR, if that meets your needs (it's very early market for browser support). I haven't been following close enough, but otherwise if you want a demo of that (like magic window) check here: https://github.com/BabylonJS/Babylon.js/issues/3899
  9. brianzinn

    Load gltf from data file error

    try like this https://www.babylonjs-playground.com/#1AbIIF#10
  10. brianzinn

    Question about isVisible

    The link from my first response was to the exact line that I thought does that (!mesh.isEnabled() ... continue;), from my understanding (https://github.com/BabylonJS/Babylon.js/blob/master/src/babylon.scene.ts#L4259) So, why does isVisible == false keep it in the rendering loop, while setEnabled(false) not? I would think the difference would be hardly noticeable. Is there somewhere else I should have referenced or a performance penalty I am not seeing? Thanks.
  11. Have you tried dialing back some settings, like disabling webgl2 in engine options or engine.getCaps().highPrecisionShaderSupported = false; It may be possible that the BabylonJS engine needs to account for a bug in the the browser/driver as @bghgary has suggested. When I look at your first screenshot it looks like z-fighting with 2 planes - those misplaced triangles look like a face that does not belong. I've tried mesh merging and was happier with more fine grained control using meshes generated manually (from data files). I was originally inspired by some code from this project (/scripts/PlanetChunckMeshBuilder), which is efficient and produces minimum vertices (ie: skipping occluded faces) : http://svenfrankson.github.io/PlanetBuilderWeb/index.html
  12. brianzinn

    Question about isVisible

    If you look in the inspector (ie: open PG click "inspector" button), then you can see the number of vertices/faces (ie: mesh.getTotalVertices()) - along with materials, these are in memory. To answer your question, though, I am not aware of a way to measure memory usage of a single mesh - I just go by poly count as a basic measurement. If you have materials with large textures would also have an impact. Clones vs instances will also reduce memory footprint, if you have multiple. If you need to "unhide" meshes quickly then disposing them is not a good option! You may find this useful, but they will remain in memory: https://doc.babylonjs.com/how_to/how_to_use_assetcontainer
  13. brianzinn

    Crane Game

    This is what you are after: mesh2.setParent(null); That will unparent the mesh, while maintaining rotation and position in world co-ordinates (instead of local to the parent). If it doesn't work just post a PG. I've got lots of similar versions of it in my game If you have physics on your crane cargo this is where you would call .wakeUp(), too (ie: get crane cargo to fall). Cheers.
  14. brianzinn

    Question about isVisible

    Yes. The "active" meshes are the ones that slow down your scene. Notice here where invisible (isVisible == false and visibility ==0) are not included: https://github.com/BabylonJS/Babylon.js/blob/master/src/babylon.scene.ts#L4259 If you dispose() a mesh instead of hiding it, then I would think it would give you a very marginal speed increase, but with the slow cost of re-importing. I would suggest to keep the meshes, if memory usage is not a concern. Best thing is to do a speed comparison, as empirical evidence (ie: FPS/engine.getDeltaTime()) does not always show what would seem intuitive.
  15. Are you calling enableInteractions() after setting the raySelectionPredicate? That will overwrite your own predicate - otherwise your predicate should take precedence. Otherwise are your distances large - like over 100?
  16. brianzinn

    Import lights from 3ds max

    I don't know if the 3DS export instead to glTF will help (yet - maybe it's too early). I have not looked into that exporter, but did read an interesting article Adobe posted 2 weeks ago that may be of interest to you. Check out the section on lighting (KHR_lights_punctual, EXT_lights_image_based ) : https://theblog.adobe.com/behind-the-scenes-with-adobe-dimension-engineers-how-we-built-the-3d-publish-feature/
  17. brianzinn

    GCanvas alibaba

    Has anybody written anything for GCanvas with BabylonJS on a mobile device? Looks promising... https://alibaba.github.io/GCanvas/ "At this moment, we have already supported 90% of 2D APIs and 99% of WebGL APIs." If nobody has tried it out - I'll post back here when I get a chance to, which will take a while... Cheers.
  18. brianzinn

    GCanvas alibaba

    @Sebavan looks like a custom C++ implementation of OpenGL ES 2.0. For Android they use a JSBridge (based on Cordova) - iOS bridge is based on WebViewJavascriptBridge. I looked into their project a bit - no commits since April and issues are not getting replies. Going to give it a miss for now, but will be checking in to see if they progress, since it's a great idea - maintaining their own engine I think is a lot of effort even to get to ES 3.0. It ties is so nicely with Weex - I hope they invest in this project further
  19. brianzinn

    Why Button3D Lacks Rotation?

    You may not be interested in the implementation details, but I'm going to show you why they don't have a rotation property and how to get around that. That's because the 3D controls only have position, which delegates to the 'node' member variable: https://github.com/BabylonJS/Babylon.js/blob/master/gui/src/3D/controls/control3D.ts#L32 You can use linkToTransformNode() as ssaket explains. Here is the code for linking, as you can see it just adds a parent (which is best for positioning multiple controls in 3D together): https://github.com/BabylonJS/Babylon.js/blob/master/gui/src/3D/controls/control3D.ts#L239 You can directly rotate 3D controls by accessing their 'node' property!! 'node' is only available after they are added to manager. Here I am rotating the button 45 degrees. https://www.babylonjs-playground.com/#2YZFA0#11
  20. Here is an open source game running on heroku and mlab (javascript server with mongoDB. websockets for 4 player peer communcations): https://github.com/HoneyBadgers2/ColoniesOfCotton/
  21. My initial goal was to go cheap and serverless and something I can run locally for development. I did not end up with a free solution - I am running Azure functions for my API and a relational DB (it was much cheaper than DocumentDb). I may switch my website (App Service) to be serverless at some point - Azure now allows websites to run from their CDN (like AWS S3 has for ages). Not currently doing proper analytics, but I do track things like levels attempted/completed/etc. In retrospect it may have been cheaper and easier to just host a website somewhere - hope that helps a bit I think the best would be an affordable usage based turnkey solution that can be configured to store and query different data structures with user management/authentication.
  22. I would guess something with pivots, if there are multiple meshes at position {0,0,0}. In which case the real location would be the opposite of the pivot? Those depend on how your OBJ file is generated: https://doc.babylonjs.com/how_to/pivots Easy way to test is to rotate one of the meshes and see how it rotates or have a look in the inspector.
  23. In addition to what Sebavan has said, have a look at assigning an AdvancedDynamicTexture to a mesh 4th parameter: https://github.com/BabylonJS/Babylon.js/blob/master/gui/src/2D/advancedDynamicTexture.ts#L867 You will see from the comment that on the variable 'onlyAlphaTesting' that alpha testing will be used, but not alpha blending. Also note how different textures are assigned to the material (ie: hasAlpha = true doesn't assign opacityTexture, but does assign diffuseTexture). HTH.
  24. brianzinn

    about using rebuild method

    There's a (public hidden) rebuild method on textures as well. I use it for HMR. Also, rebuild() on the pipeline processing among others
  25. brianzinn

    Retina Display Laptop & Mobile

    Hi F3/*X - Welcome to the forum!! There's an optional 4th parameter when you create the engine to do this automatically. It defaults to false. https://doc.babylonjs.com/api/classes/babylon.engine#constructor The code in the Engine constructor that handles this for you is here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Engine/babylon.engine.ts#L1165 const devicePixelRatio = Tools.IsWindowObjectExist() ? (window.devicePixelRatio || 1.0) : 1.0; var limitDeviceRatio = options.limitDeviceRatio || devicePixelRatio; this._hardwareScalingLevel = adaptToDeviceRatio ? 1.0 / Math.min(limitDeviceRatio, devicePixelRatio) : 1.0; If you don't set adaptToDeviceRatio to true in Engine constructor, then you may want to account for other devicePixelRatios. I am on a laptop right now with a devicePixelRatio of 2.5