Jump to content


  • Content Count

  • Joined

  • Last visited

About BeanstalkBlue

  • Rank
    Advanced Member

Contact Methods

  • Twitter

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Actually a coincidence of two things happened, making me think there was a problem that wasn't really there: 1) I had a bug in my original code, where keyboard presses really did interfere with mouse movement. 2) I fixed that bug, but I was travelling with my laptop and stopped using a mouse (was using a trackpad instead). When I did this, I didn't realize that my trackpad driver disables the trackpad temporarily when you press a non-modifier key on the keyboard . It's a feature to prevent resting your palm on the trackpad causing unwanted cursor movement while typing. So
  2. That is the problem. I need to control camera with the mouse, and handle input events from the keyboard at the same time. This seems like a really basic requirement for many games, so Babylon must have this, I think? Here is a simple playground displaying the problem: http://www.babylonjs-playground.com/#1MK1Y4#1 Pressing "w" key moves the mesh. You can't move the camera with the mouse at the same time as moving the mesh. Edit: Actually is this maybe just my laptop? I don't have a mouse with me at the moment. Can you guys move the mesh while controll
  3. I have read all of the camera inputs articles in the docs and I have tried to find a demo, but I can't seem to figure out how to add inputs to control objects other than the camera in Babylon. I have tried to manually add a keyboard event listener following Temechon's Infection code, but that doesn't work, as it interferes with camera input (either camera input will work or my inputs will work, but not both at the same time). Here is part of Temechon's code from https://github.com/Temechon/infection/blob/master/ts/Player.ts // Keyboard events this._handleKeyDownC
  4. I have point shadows on SPS particles (which I guess are instanced meshes), and it works fine. Maybe there is something going on with the meshes you are adding to the shadowGenerator renderList? Did your instanced mesh error occur after using my code? If so then just to check, set minZ and maxZ in setShadowProjectionMatrix() to something sensible manually (like 0.1 and 100.0) and see if that changes anything.
  5. What I am trying to say is that the Babylon.js function here: public setShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array<AbstractMesh>): PointLight { var activeCamera = this.getScene().activeCamera; Matrix.PerspectiveFovLHToRef(Math.PI / 2, 1.0, activeCamera.minZ, activeCamera.maxZ, matrix); return this; } Should be this: public setShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array<AbstractMesh>): PointLight { Matrix.PerspectiveFovLHToRef(
  6. I noticed that the shadow generator for point lights sets the shadow generator camera matrix using the activeCamera.maxZ (in .setShadowProjectionMatrix()). It should really use the point light's range, to have better depth z accuracy since there are no shadows further than the light's range anyway. It is also using the activeCamera.minZ, which is too far (at least in my case) for the shadows, and causes light bleeding. Can I set this or do I need to override the setShadowProjectionMatrix function like this: BABYLON.PointLight.prototype.setShadowProjectionMatrix = fun
  7. Oh, haha. Embarassing. I was setting height on the canvas but not on the parent div. Thanks as usual @Deltakosh
  8. The CSS and the problem I describe can be seen in the app here: https://scarlet6.com/pre-alpha/
  9. Hmm, I have that. When calling fullscreen I press F11 in my browser. But as you can see from screenshot #2 above, the canvas also resizes when I open the inspector, and it doesn't fill the screen, it stays at exactly 2.0 aspect ratio. (You can also see I have width:100% and height:100% in my #renderCanvas CSS. I copied the Babylon Demo CSS. No matter what size I make the window, the canvas is 2:1 aspect ratio (height = 2*width). Is there maybe code that I wrote that controls this?
  10. When I am fullscreen the canvas is not 100% height even though my CSS makes it that. When I resize the window the canvas height:width is always 2:1. Did I set code that makes this happen somewhere that I forgot? I searched everywhere but can't figure this one out. It seems like my code is the same as the babylon website Demo code, so I dont understand See attached images:
  11. I tried offsetting the heights randomly by a little bit. Attached image of exaggerated version of what happens (big offsets). It is much worse I could try to not render side walls I guess, that's a good idea. But actually I dont know if the problem is with side walls or just the edges touching. For that I guess I need to duplicate every particle so there are two different models available for each position (so I can have some particles in the mesh still have walls), and then only draw half the particles.
  12. This is scene is arranged into separate blocks, each block is a SolidParticleSystem. (Like this, and like this.) Each particle is touching right on the edge (see attached image), or click here. There are some black pixels that flicker in and out on these edges. These are z-fighting artifacts on the edges (I think ). I tried just increasing the scale of the particles slightly so they overlap with each other but this doesn't fix it. What can I do to remove these artifacts? Is there a simple way without adding more geometry to every particle? I'm not afraid to modify shad
  13. let mat1 : BABYLON.StandardMaterial = new BABYLON.StandardMaterial("mat1", scene); let mesh1 = new BABYLON.Mesh("mesh1", scene); mesh1.material = mat1; mesh1.material.opacityTexture = null; // '<-- This is not allowed.' In this situation TypeScript complains that we can't set opacityTexture because mesh1.material is of type BABYLON.Material (not BABYLON.StandardMaterial). I could of course just do "mat1.opacityTexture = null", but what is the typical way to handle this type of situation in TypeScript if I really want to access the material via "mesh1.material"?
  • Create New...