• Content count

  • Joined

  • Last visited

  1. At least in the case of an ArcRotateCamera, the scene objects are not visible if the initial position of the camera is Vector3(0, 10, 0), or directly above. If its Z position is set even a fraction off of zero, there is no problem. http://www.babylonjs-playground.com/#JLPAE#138
  2. OK. That works! I suppose that gives us a clue why the other doesn't? What is the difference between the two?
  3. I'm using 3.0 custom assembled with no additional options selected. Here is a very short and simple file for you to peruse that demonstrates the issue. Thank you in advance! babylonIssue.zip
  4. I am sorry - I was very unclear about the lines at the end of the script (86, 87). They were meant to be run one or the other as a comparison between createScene() vs. loadFile(). Both contain entire scenes which include cameras. When I load a .babylon scene file, can I not successfully attach the controls of the camera which is contained in the file to the canvas? In the setup as I intended it to run, there should not be a camera to replace. The one loaded in the .babylon file should be the only existing camera. So if I replace the camera which is in the scene already with a new BABYLON.ArcRotateCamera(...), I may get the results I want, but I still don't understand what is going wrong. Thank you, by the way!
  5. I build a scene and run the following: BABYLON.Tools.CreateScreenshot(engine, scene.activeCamera, 400); The resulting, beautiful 400x400 png is entirely transparent. What could cause this?
  6. It's taken me ages to really get back to this, but my problem has not gone away. Unfortunately, I can't reproduce this without loading a .babylon file exported from Blender. Please open the given test file. If I build the scene manually using a createScene(), the panning works just fine, whereas if I use loadFile(), it is broken. In both cases, the controls are attached by the same code, so I surmise that the problem is in the my loader or the .babylon file. panningProblemDemo.zip
  7. OK. Sorry about that. The looking at the code did clear that up, mostly. For readers: 1. The noPreventDefault option in ArcRotateCamera.attachControl() does not stop a right click menu if the ctrl-LMB panning is enabled. 2. (I should have seen this) The panningMouseButton option is a NUMBER - the number of the button that you want to pan with. 0 - LMB, 1 - MMB, 2 - RMB. That being said, I have a strange bug in my implementation of BABYLON where everything loads, unless I attach the camera controls. When I do, it throws an error: TypeError: element.addEventListener is not a function babylon.custom.js:33275:13 In another implementation of mine, the page loads, and the controls attach, but the panning will not work. In both cases the camera is an arcRotateCamera and line that causes or has issues is simply scene.activeCamera.attachControl(canvas, false, false); If you have any ideas, I'd be most grateful. Here is a file where, for me, the panning will not work. Drop the two files in a folder with a copy of babylon.custom.js and it should demonstrate the issue. tmmWeb3D.js.htm a.babylon
  8. The arguments in the attachControl() method for ArcRotateCamera do not seem to behave as described in the documentation. I am unable to achieve what I could before 3.0. Prevent default seems to be affected by whether "useCtrlForPanning" is true. I can't get the RMB to pan at all, as I could the previous version. please toy with the booleans and see what I mean. http://www.babylonjs-playground.com/index.html#6QH6SN Ideally, I would have the RMB and ctrl+LMB both panning, with no menu showing up on RMB click. At the very least, I would like to be able to disable the right click menu while having panning enabled. Thanks!
  9. loadingUI positioning

    Sorry I never got back to you. It works. Thanks a lot!
  10. loadingUI positioning

    Hello! This is no insurmountable problem on my end, but I am implementing Babylon as a lightbox with no iframe. In other words, my canvas has its CSS position property set to "fixed". This breaks the placement of the loading screen. Obviously I will patch it up on my end for now, but to make it work out of box, you could replace line 137 in https://github.com/BabylonJS/Babylon.js/blob/preview/src/Loading/babylon.loadingScreen.ts with something like: var canvasPositioning = window.getComputedStyle(this._renderingCanvas).position; this._loadingDiv.style.position = (canvasPositioning == "fixed") ? "fixed" : "absolute"; I'm pretty sure that would have it working out of box in my case.
  11. How does the "Shadow Matrix" work?

    Thanks! I will look at Spector.js. What I was wondering about the orthographically projected shadows was what defines their X and Y limits, where there is obviously a limited X and Y resolution. In the case of a spot light it is obviously the projection angle, but looking at the source filled me in on where the "_orthoLeft", "orthoTop" etc. values come from. For anyone reading this, it looks to me like the directional light adds finds the min and max boundaries of the meshes in the shadow render list, and then sets the width, height and offset for the shadow map according to that. Also, The the Close Exponential Shadow map feature solved all my problems, just so you know!
  12. I am having trouble with my shadows. Everything that receives shadows but is not occluded is covered with what I think is elsewhere referred to as "shadow acne". 1 blender exported ESM shadows do not work at all. Why? Are they for a later version of Babylon? 2 I am not clear on how the shadows are being mapped. My first approach was to try to minimize field of illumination to increase the apparent resolution by pointing spot lights at my model and setting the camera clipping plane (which apparently is mapped in the blender exporter to the shadowMinZ/MaxZ) to conservative levels. I have had inconsistent results with this, so I really would like to understand clearly what it does. Is there in fact a Z axis resolution of the shadow map? 3 Of course I toyed with the shadow bias settings as well. However, when I set the map resolution to 512, by the time I get rid of the problems, the shadows begin well, well below the overhangs that create them. Much further than the apparent resolution of the shadow map would suggest is necessary. Then I decided to turn up the shadow map resolution to 4096, but then, even adding .00001 to the default bias setting offsets the shadow map by a huge amount, rendering the setting essentially useless. This makes no sense to me. Also, what does the shadow map "resolution" mean for the directional lights, which have an infinite projection field? Is it somehow using the camera's FOV? In my use case, I don't actually need the shadows to be dynamic, so I can set their resolution high and their refresh rate to 0. Clearly I do not understand the shadows system, and am sorry to load so many questions at once. Any help is welcome! I can't give you the actual file I am working on due to non-disclosure issues, but I tried to recreate it with a simple model that has similar scale, thickness, light position, etc. Thanks! experiments.babylon