• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by royibernthal

  1. Longest TL;DR I've seen in my life Thanks for the explanation, I think I get the picture.
  2. Can you help me understand why this line doesn't take care of exactly that issue? It takes into account the difference in time between now and the previous time things were animated, doesn't it? How'd you best approach compensating for low FPS in animation while still using Babylon's animations? (without creating my own animations solution from scratch)
  3. Okay so I understand the animation fps is not dependent on scene rendering fps. But when there is lag in scene rendering, it means the device is having a hard time to calculate stuff, therefore doesn't it indirectly affect the animation fps as well? (due to device lag rather than being directly tied to scene fps) The most important question is - would I need to compensate in animation speed for lag on device? Or would it really be synced perfectly with time regardless of lag on device? i.e. would time become subjective to the device's lag or does it always remain objectively accurate? (in the case of animations of course)
  4. Do Animatables take into account the current frame rate? Specifically when used for animating skeletons via Scene/beginAnimation(). Let's assume: bjs renders at 60 fps The current fps on a weak machine is 30 fps I started an animation with a speedRatio of 1 Given that frame rate (executing at 50% of ideal fps), is the speedRatio compensated in any way under the hood to 2 instead of 1? Or do I need to compensate for it manually? If I need to compensate for it manually, is there a dynamic way to base the speedRatio on the current fps? For instance: Let's say I started an animation in an infinite loop while the fps was 60. After a while it became 30 - would I have to stop the animatable and create a new one at speedRatio * 2? In other words, would I have to recreate an animatable in order to have an updated speedRatio that takes into account the current fps?
  5. Yeah it has a skeleton. So the current hit area is of the mesh before transformations were done on GPU, is that correct?
  6. Mesh is not recognized when I try to "pick" it at some points. I created this PG where each click adds to the counter, so it's easy to notice when a click is not detected. Here's also a video demonstrating the issue - notice the counter as I click at different points on the mesh. On most points it works as expected, on some it doesn't. mesh clicks.webm
  7. DK I suppose I could send a PR myself if you agree with the solution I suggested
  8. Each click should toggle isVisible of image: I believe it's related to the new functionality at control level which makes sure controls can't be marked as dirty when invisible. I suggest to return at the beginning of _markAsDirty only if it wasn't called by the isVisible setter, that should fix the issue while keeping in mind the previous issue as well. public _markAsDirty(): void { if (!this._isVisible) { return; }
  9. In the actual project, textures on mobile are already optimized to 256 instead of 1024, it didn't seem to help.
  10. Of course Here's a repro in a PG: It should be laggy on mobile - if it's not, you can easily add more models in assetsManager.onFinish. Any ideas for how to improve performance?
  11. I have a shader which is really slow on mobile - is it possible to use SpectorJS or another tool (let's say even on desktop) to find the problematic part of the shader code that is heavy on performance?
  12. I agree with jerome, but I think that in your case PIXI might be an even better choice than Phaser. I suggest you do a thorough comparison between the two.
  13. I suppose it has similarities, but I'm not sure if it's the right direction given the bigger scope of the feature I'm talking about. If I recall correctly we need to use stencil buffer in order to achieve the mask. Here's how PIXI handles graphics & shapes: It would be a nice addition to GUI as well, but it is a big feature in itself. Otherwise I suppose we could have very basic and less flexible data structures for common shapes such as rectangle, circle and triangle, and use their data in the masking process. Maybe even just use the existing Rectangle and Ellipse containers for now if it'd make sense. Needless to say, nested scale, position and rotation will need to be taken into account - GUI already knows how to handle these, need to see how it can be integrated into the masking process.
  14. I don't think I have the necessary skill and understanding of that feature to do that, otherwise I would've created a PR instead of posting this. I was hoping DK might be able to do this
  15. I feel like I already brought it up somewhere but I can't find where. Would it be possible to add a mask feature to GUI? It'd be extremely useful for scrollable containers, bars, etc.
  16. I just upgraded to the latest version and encountered this issue as well. The problem is that the class is defined as GUIImage in the .d.ts now for some reason, while the actual js still defines the class as Image. I simply changed it manually in the .d.ts for now, but I suppose it should be fixed. release/gui/babylon.gui.d.ts
  17. Yes of course, the aspect ratio is maintained, it doesn't mean the same can't be achieved for width. The aspect ratio will simply depend on width instead of on height. The sphere will still remain a sphere. Anyway yeah, let's see what Deltakosh says.
  18. Just to make sure we're on the same page, I attached a video. Notice how the meshes are scaled when resizing the window height, and how they stay the same when resizing the window width. The idea is to keep the same aspect ratio, same as it is done now when resizing height, only to have an option to depend on width as well. Same idea as idealWidth and idealHeight in GUI, unless I'm missing something. resize.webm
  19. I'll try to clarify - the meshes in the scene are resized only according to height. Try to resize width (even in PG) - while the canvas and scene will adapt, the meshes won't be resized at all.
  20. Engine/resize() seems to be according to screen height. Is there a way to change it to be according to screen width?
  21. That's not the issue, read above - solved. Thanks for trying to help though.
  22. Not sure what you meant. Anyway, all I needed to do was play all the loaded skeletons simultaneously.