Ericky14

Members
  • Content Count

    42
  • Joined

  • Last visited

Everything posted by Ericky14

  1. By the way, I forgot to mention, the scene is draggable on the x-z plane of course. Do you guys think its feasible at all to delete meshes outside viewport and make them appear when they come in the viewport? Or is that something already implemented in BABYLON?
  2. Hello Wingnut, thanks for replying. First of all, nice speculation haha. They are drillable, I've already got that going. What did you mean by using JS to "generate" the labels? I just instantiate them using the GUI and then create instances of that mesh. Also, if I didn't use this label system and only used BABYLON's GUI to generate each word/text, initialization time for this scene would take over 20 seconds... So, not sure imageButtons will do much for me as they will be individual textures and take longer to generate. I was able to get ~30 fps by removing all labels. That still seems low to me, is there no other way to improve the scene? Vertice count still high. I will try to improve the label system.
  3. Hello, I have a pretty complex scene built and I am having very heavy lag issues. Even though I have a lot of meshes, they are all instances of default ones... so I don't think there's any reason I should be getting only ~10 FPS. Could anyone provide me with any sort of clue as to why my performance is so low? By the way, each of those cylinders are composed of many layers of cylinders. There's usually 3 cylinders (the middle one, the border, and the outline) and under them could be at least 3 others stacked (the ones that look like shadows). Aside from that, each little "group" that you see in the screenshot has a "mapMesh" object which the cylinders are parented to. All those mapMeshes are parented to a worldMesh. For the GUI text and images, each letter/image is an instance of a previously generated text/image. Each letter is parented to a wordMesh, which is then parented to a labelMesh, which is then parented to the mapMesh or the cylinder in the case of the ones on top of it. The background with a gridMaterial has size 300 x 300 and gridRatio of 4. There's also a linear fog which starts at the end of the camera (usually 50 units apart from cylinders in the y axis) and ends at 50 units after that and has a density of 0.01. After this scene is fully generated, there isn't much coding running at all... no animations or anything, it's pretty static. However, I cannot freeze world matrices because I might need to move the cylinders. I appreciate any help, really stuck on how to improve performance here and not degrade the quality of my scene.
  4. I solved this problem by looking at the "window.devicePixelRatio" variable which is either 2 or 1. And I have "adaptToDeviceRatio" turned on. So, for an orthographic camera, I just change the radius(orthoTop, orthoBottom...) which should be doubled at devicePixelRatio 1. And for perspective camera, I also change the radius, but I set custom values for both 2 and 1 so they would match nicely since doubling didn't work too well. Thanks for the help.
  5. I am. But that is not the behavior I want. You can test it with the default playground environment. I am expecting the camera radius to increase rather than the whole scene to scale up just like in game engines such as Unity. (I tested it with my laptop and my tv, the whole scene scales up and the html stuff looks really tiny next to the scene)
  6. Hello, I have my canvas stretching 100% width and height of the page. When running it in a small resolution screen and in a big resolution screen, the whole thing is scaled up. Is there any simple way to simple increase the radius of the camera based on the device resolution instead of having everything scale up? (Everything stays the same size just like regular html elements)
  7. Here, this is the kind of solution I proposed. Maybe we could have something similar on the babylonjs side... just a suggestion. This is just a simple example of the system I built. http://www.babylonjs-playground.com/#9U086#197
  8. Managed to fix it setting the background image's alphaIndex to 0.
  9. I was not able to reproduce this in the playground. Does anyone have any idea what could be causing this darkening effect on the GUI text? The GUI text is drawn on planes and the GUI image below it is about 5 units away. Also, the image is a svg, but I also tried with png and the same thing happens. The scene also has fog... and a clear color of that blue on the background. If I rotate the camera, the text will randomly lightup/darken on certain parts of the GUI image below it even though they are far apart on the Y plane. Could this be a bug?
  10. Sorry, I posted the wrong one... I guess the one I did didn't save. Here's the right one. http://www.babylonjs-playground.com/#9U086#187
  11. Here, http://www.babylonjs-playground.com/#9U086#181 This is a basic example, you can see how it takes a few seconds to instantiate everything.. in my use case, I have 3 different types of fonts and about the same amount of texts.
  12. It's pretty simple to repro. What I mean is that I am trying to generate 100+ dynamic texts with a few different fonts and depending on the amount, it can take up to 30+ seconds. Even if I offset the generation of each by a few milliseconds, it still drops the fps quite a bit. The dynamic resolution is 256x256 btw.
  13. Is your canvas full screen or does it have an offset? pointerX and pointerY might not be having the right coordinates.
  14. Hello, I am making this post to discuss possible improvements to the GUI text system. Right now, when generating new text, it can be very slow if you have a lot of it in the screen. One clear improvement would be to pre-generate (or cache) each letter as an object and just generate instances of that object, which turns out to be very very very fast. However, that is not very easy to do as letter spacing can be a hard thing to manage when positioning each letter next to each other. Is there any easy way this could be improved in the babylonjs side to increase GUI text creation speed? Or is there any other solutions for this problem?
  15. Sorry, that value worked for me in my local project. For the playground one, you need another value.. I believe shadowBlur value is related to the font size. Here is the fixed version. http://www.babylonjs-playground.com/#9U086#183
  16. Btw, I found a work around Set the shadowBlur to 1 and shadowColor to #FFF. These are properties of a Control, you can just set them on the TextBlock.
  17. This seems to be related to only white texts, so there's no way around this issue?
  18. http://www.babylonjs-playground.com/#9U086#182
  19. Hello, I believe I asked about this before on this forum, but I can't find the post anymore and I remember I remember people told me it wasn't a bug. But, I just want to make sure because this behavior is weird. When using the font color white for the TextBlock, I get a greyish color on small texts, is there a grey border around the text or something like that? Is there a way to remove it?
  20. That makes sense @brianzinn @Deltakosh That would be very helpful
  21. Sorry, that's not what I meant. I meant I want to do something like this: var panel = new StackPanel var myTextBlock = new TextBlock myTextBlock.fontSize = '20px' myTextBlock.text = 'Testing text' myTextBlock.textWrapping = true var height = myTextBlock._lines.length * 20 panel.height = `${height}px` panel.addControl(myTextBlock) But this is not currently possible because the _lines property is not even set as soon as you create the TextBlock. You have to wait for the next few frames. So, I was wondering if there is an internal function I can call to take the measurements as soon as I set all the TextBlock properties.
  22. Hello, I am trying to create a TextBlock with textwrapping and wait until the _lines property has been calculated. Is there any sure way of doing that? Maybe some function I can call to have it calculated instead of having to use an observable. (Also, the TextBlock is child to a StackPanel) Right now I am creating the TextBlock and using TextBlock.onDirtyObservable and inside that I check TextBlock._lines. However, this value can sometimes be wrong as I have seen. This seems to be due to _context.measureText returning different values at times. I observed this behavior when I force reload the page, if I just reload it normally the _lines property is properly computed. Maybe there is some kind of caching on the canvas context or something that makes it return different text widths? Any help on this would be appreciated.
  23. @NasimiAsl I want a simple scaling animation and a few position animations. What do you mean by ultimate animation?
  24. Hello, Is there any way to optimize animations? If I want to animate a lot of meshes at the same time, over 200 or 300 instances... they all are having their scaling animated, but at different times.