Raggar

Members
  • Content count

    242
  • Joined

  • Last visited

About Raggar

  • Rank
    Advanced Member

Recent Profile Visitors

1,373 profile views
  1. Physics Movement

    Try applying a bigger force. Make a (1000,1000,1000) vector and see if that does something.
  2. SPS experiments

    I honestly have no idea. I'm still trying to wrap my head around shared arrays and atomics, to see whether, and how much, these are usable for running physics in workers. Why not give it a try. At least you'll gain some knowledge. It's just a matter of time before it's as compatible as WebGL. I'll be interesting in your findings and experiments..
  3. SPS experiments

    Just as I'm reading about this tech, this thread pops up The GPU version runs at 40FPS on my rig, and both the 2 latest worker versions run at 60FPS, although you can spot some slight stutter.
  4. [SOLVED]Optimizing this Scene?

    Lol. I tried with 80 clones, and it stuck close to the 60FPS. Was I rendering twice or something, then, since it affected the performance that way?
  5. Dynamically Changing a Sprite?

    I'm not quite sure how I should approach this. The fastCheck boolean needs to be set to false, otherwise only 4 angles will be used, instead of all 8. The way sprites work, I think rays are the only way to go, but it seems the rays are pretty expensive when running 1x ray / monster object. I don't dispose the rays, but they still turn up in the GC. I'm not sure how the internals work, and whether or not this is expected behavior.
  6. [SOLVED]Optimizing this Scene?

    We're hitting a month since I started this thread. For god knows what reason, I suddenly wanted to make a fish tank with a neural network and genetic algorithms, so I was kind of stuck in a weird loop doing that @Deltakosh In my particular project, the individual models do not need to have different animations at different times, so I tried comparing clones to instances. Using clones, I hit around 50FPS when having 40 models, but hit the same FPS using ~250 instances. This is certainly an improvement. Clones: https://www.babylonjs-playground.com/#2I6IG4#1 Instances: https://www.babylonjs-playground.com/#2I6IG4
  7. https://twitter.com/vormplus/status/898536305986088960 http://playground.vormplus.be/webgl-music-video/ Found randomly on Twitter.
  8. Dynamically Changing a Sprite?

    Using fastCheck and invisible meshes seems to boost performance a bit: http://www.babylonjs-playground.com/#G8JR7V#11
  9. Where to apply Delta Time multiplier

    Care to explain why you would do it like this?
  10. Where to apply Delta Time multiplier

    this.state.position.x += this.state.movement.x * deltaTime this.state.position.z += this.state.movement.z * deltaTime I would use it like that, instead of applying to to all the calculations. I'm not sure whether or not applying it to the calculations would change the end-result of the position, compared to applying it directly to the position. You know.... math
  11. Dynamically Changing a Sprite?

    I'm already using a sprite-sheet. I just thought it would be stupid to include some animation that might or might not be used. However, I realize now that loading them dynamically might result in added overhead(I think). I saw an old review I made of the Doom movie some 12 years ago, and started thinking about the old games. I thought it would be fun to create some 2.5D-ish mechanics. I read that some of the old games use rays to determine which angle the model is viewed from, and then apply the appropriate sprite based on that. 4 red planes make up the front, back and sides. 4 green planes make up the angles in between. A ray is cast between the sphere in the middle and the main camera of the player. When a plane is hit, you'll know from which angle the player is viewing the model. Take a look at this example: http://www.babylonjs-playground.com/#G8JR7V#7 Try moving the camera around the monster. The sprite-sheet consists of an animation of 8 angles, while 5 is enough as those can be inversed(they already are, just haven't made a new sheet). This decrease the size, but also decrease the realism a bit. Here's an example of multiple monsters: http://www.babylonjs-playground.com/#G8JR7V#9 I'll have to limit the rays to their only monsters, otherwise, as you can see, rays will catch the clipping planes from nearby monsters, and falsely use this data. @Deltakosh Any idea why Mr. GC is acting crazy in scene #9? I'm reusing the rays, but I have no knowledge of the internal workings of sprites. When I play a new animation from the sprite-sheet, is the old ones somehow dereferenced and cleared from memory? If I comment out the manageAnimations function, the load on the GC is drastically reduced, and the draw function takes the load instead. I'm not entirely sure whether or not disabling the rays have any major performance improvements.
  12. I'm in search for a way to dynamically change a sprite. Let's say I have a spriteManager with spriteA.png. and a sprite called sprite linked to said manager. I want to change the sprite/spriteManager to spriteB.png. This might happen once every frame, so simply creating a new sprite won't quite cut it. I see the manager has a sprites array as well as a _spriteTexture, but I don't see any function that allows me to change these. Am I missing something that would allow me to do this, or are there issues I should be aware of?
  13. [SOLVED]Optimizing this Scene?

    The second playground I linked to(24), is a stripped down version. I'll give it a try this weekend, adding functionality one by one, while trying to reduce the number of verts by simplifying the monsters as well as the trees. Maybe try the SPS Tree Generator, as well as the Quick Tree Generator + instances or merging.
  14. [SOLVED]Optimizing this Scene?

    I'm really bad at debugging performance. I'm trying something different to get a performance boost from the animated models, as these seem to drop FPS rapidly when animations are playing. Same with trees. I'll try making simpler models, small or compressed textures and maybe merge them instead of clones. Will merging have any gains over instances? Edit: Here's a full capture:
  15. I'm looking for ways to optimize a scene I created in the Playground. This scene is based on previous work from another thread, I just added some objects and logic to mimic a small game. It uses native CannonJS for the PFS-camera and movement of the monster models. I used the code and model from the instances demo. From line 16, you can turn on and off physics for the monsters, skeletal animations, the skybox, trees, shadows, procedural textures(grass), and whether or not the monsters should lookAt and follow the player. As well as specify the amount of trees + the range and amount of monsters. https://www.babylonjs-playground.com/#FZZV7K#23 I'm only hitting around ~30 FPS with this example. Is a scene such as this too heavy for WebGL and browsers? The trees are instances, so unless I clone and merge them, I don't see what could be changed there. Maybe a smaller, compressed texture. The monster models all have skeletons and animations, so no instances or merging can be used here. Disabling physics seems to give some FPS boost, so maybe using a worker would do some good in this example. I'll give this a try, and see what effect it has on overall performance. Here's a minimized version, with most things stripped, and 50 monsters without animations. https://www.babylonjs-playground.com/#FZZV7K#24