FunFetched

Members
  • Content count

    47
  • Joined

  • Last visited

  • Days Won

    2

FunFetched last won the day on September 2 2017

FunFetched had the most liked content!

About FunFetched

  • Rank
    Advanced Member

Contact Methods

  • Website URL
    www.funfetched.com
  • Twitter
    FunFetched

Profile Information

  • Gender
    Male
  • Location
    Seattle, WA
  1. What happened to SceneOptimizer.Stop()?

    Well that explains it!
  2. What happened to SceneOptimizer.Stop()?

    This function disappeared in 3.1. Was this intentional? Edit: You know... I may have actually added that myself in 3.0., and forgotten all about it. However, there's a SceneOptimizer.stop() (lowercase 's') that's referenced in the documentation, but I don't see it anywhere in the code.
  3. Blender to babylon.js issue

    Oh, great; I'll do that! Edit: Works perfectly!
  4. Blender to babylon.js issue

    Holy moly. I had been having problems with this as well. I un-parented everything, cleared all transformations, confirmed that everything was indeed 0 and W was 1. Re-parented, re-weighted, tried the abs() solution and STILL got this error. Finally, I logged the actual rotation data stored in the mesh in question. Simply logging self.rotation showed nothing of note: 0, 0, 0. THEN I decided to get specific and log each component (x, y, z) by themselves. Here's what I got when I hit Y: 3.552713678800501e-15 That's right; 0.0000000000000035527blahblahblah. Ridiculous! So, Blender has a rounding problem when it comes to clearing transformations, and clearing them is no guarantee of anything, apparently. SO, in addition to the abs() solution that JCPalmer proposed, I added round(n, 3) to each one of them, and it finally worked. I'll issue a pull request when I get a chance. Edit: Actually, I don't think abs() is entirely necessary. Every Python version I have access to throws True when I compare -0 to 0. Maybe it's best to be on the safe side?
  5. [Solved] animation "glitch"

    No problem! You'll notice that every time you trigger the spin animation, it always ends facing inward, so it is actually following the direction of travel, in a manner of speaking. It just needs to be turned 90 degrees.
  6. [Solved] animation "glitch"

    Check out https://www.babylonjs-playground.com/#RVA3F4#4. This mostly implements what I'm talking about in regard to the AbstractMesh. It's mostly working at this point. The spin animation is off by 90 degrees, but you'll see that it now behaves in a consistent manner when you click on it. Note that I reset the position of the helicopter mesh itself to 0, so that it would be positioned in the middle of the container.
  7. [Solved] animation "glitch"

    Ah! The Playground does help. Check out https://www.babylonjs-playground.com/#RVA3F4#3 . The issue with the glitch in the middle is that you were using Euler rotation instead of Quaternion. Euler sometimes doesn't handle full rotations very gracefully, flipping around madly when the sign of the angle flips; that is, jumping from PI/2 to -PI/2 from one frame to the next as it passes the half way point. Quaternion, on the other hand.... well.... it just does handle that situation, but I couldn't possibly explain why. As for the spin, you're blending two animations together that share the same mesh. So, say we're at the halfway point again, and you're facing 180 degrees the opposite direction. You want the spin to end at 180 degrees, but the spin animation wants to start and end at 0. These are two separate animations, and the spin animation doesn't inherit anything from the orbit animation. What you'll want to do here is actually create an empty AbstractMesh to contain the helicopter. Apply the orbit animation to this AbstractMesh, and apply the spin animation to the helicopter mesh directly. That way, your spin animation will affect the local coordinates and orientation of the helicopter mesh only, while the global position and orientation will be controlled by the orbiting animation that controls its parent.
  8. [Solved] animation "glitch"

    Just a guess after a quick look at the code, but I'm guessing that the very last point on your path is missing proper tangent information, since it would have no additional points from which to calculate a tangent. Have you tried playing only 29 frames of the animation instead of 30?
  9. Watch out for gl.clear()!

    Absolutely! I also discovered scene.setRenderingAutoClearDepthStencil() to control clearing for each RenderingGroup. However, I also found this: // Multi-cameras? if (this.activeCameras.length > 0) { for (var cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) { if (cameraIndex > 0) { //this._engine.clear(null, false, true, true); } this._processSubCameras(this.activeCameras[cameraIndex]); } } ... this is tricky, as there are some edge cases where you might not want this. In my case, I have some UI rendering with an Ortho camera with a different layerMask. Since it's all rendered at Z=0, I don't need (or even want) the depth or stencil buffers cleared before it's rendered. As you can see, I've commented it out temporarily for the app I'm working on. It might be a good idea to add an autoClear option to BABYLON.Camera as well. In any case, I'm now down to one gl.clear() in my game (width shadows disabled), and have gained a good 20FPS on my cheap little test Chromebook.
  10. Watch out for gl.clear()!

    Hello, everyone! I just wanted to pass along some very important information that I just discovered regarding optimization that has been completely overlooked in optimization articles that I've read, and can have a huge impact on your apps! I have a game that pushes a pretty similar number of triangles and commands as the Sponza demo, but I wasn't enjoying anywhere near the same frame rate on slower systems. I fired up SpectorJS, cleaned up as much as I could in terms of draw calls and such, and wound up with a game that had fewer calls, fewer commands, and yet STILL ran a good deal slower than Sponza. However, there was one more metric that I had yet to take a close look at, and that was "clear()". I had 6 of them, while Sponza was using only 1. My game is a first-person-shooter that uses an additional camera to draw UI components, and on a different layer, so game geometry doesn't interfere with it. The player's hands and weapons are also drawn in a different rendering group for the same reason. It turns out, however, that for every new layer and group, Babylon kicks off a gl.clear() (which makes sense), and on systems with poor fill rates, this can absolutely wipe you out. In my case, the engine was clearing various buffers 6 times per frame, including multiple times per group/layer. Disabling Babylon's engine.prototype.clear() entirely made a world of difference in terms of FPS, though I do need at least 1 or 2 gl.clear() calls to accommodate my layering requirements. 6 is excessive and unnecessary, however, and I'm currently investigating ways to minimize that. Hopefully, I can do it all by simply modifying my code, but I suspect I might have to make some small engine modifications as well so I have greater control over when gl.clear() gets called, and just how many times. Edit: Just discovered scene.autoClear and scene.autoClearDepthAndStencil. Setting both to false takes care of... well... one of them!
  11. The artifacts when rotating

    A quick Google search revealed that someone else had the same problem in Chrome, and it turned out that his "Use hardware acceleration" option was turned off. Maybe you're in software rendering mode? Does Babylon even work in that environment? I don't know, but it's worth a check. Open up your Chrome settings, go to the bottom and select "Advanced", and you should see an option for that in there. You'll need to restart Chrome after you change it.
  12. The artifacts when rotating

    I think what we have here is an "action shot" of the screen, so the ghosting of the edges is actually the result of a slow "exposure" as he rotates the object (notice the "two" mouse cursors in the second image). So, what we're dealing with here is an apparent "break" in the edge of the object as it's being rotated. My money is on a v-sync issue, but a quick search of the Babylon docs doesn't reveal any options for that. Am I missing something? I think there's a larger issue here, though, since ThreeJS is exhibiting the same problem. Andrey, it might be something specific to your system configuration or graphics driver; perhaps something to do with your browser settings, for that matter.
  13. Shadow quality automatically decreasing

    This is normal behavior. Shadow maps have a limited resolution, and as you add objects to your ShadowGenerator at greater distances, the amount of ground the shadow map has to cover expands, therefore becoming more pixelated as it scales up. So, it's really not about the number of objects you add to the ShadowGenerator, but how far apart they are. You'd see the same effect with 2 boxes; one at x:0, z:0 and another at x:100, z:100 There are a couple of ways you can deal with this. In my game, I use as small a shadow map as possible and keep the light that is casting it near the camera (so the shadow map stays centered on the player), but I have the shadow fade toward the edges of the shadow map, so that the shadows don't just disappear suddenly. You can have multiple, small shadow maps; one for each object that requires a high-quality shadow.
  14. Pointer lock bug on Chrome with windows 10

    The Windows 10 Fall Creators Update is rife with problems; this being one of them, although it could be argued that it really just exposed a problem with Chromium, since it's the only browser that is exhibiting this issue. I've implemented a "solution" in my game which simply ignores the first mousemove event that moves in the opposite direction, thereby eliminating that big jump backwards in most circumstances. Such events are high enough in frequency that ignoring a few here and there is not noticeable. It's not 100% effective, but it's a huge improvement when the alternative is that your app is basically rendered unusable. I know this doesn't help much when you're relying on Babylon's built-in input functionality, but one could use FreeCameraInputsManager, for instance, to register a new mouse input function to replace the old one.