agmcleod

Members
  • Content count

    94
  • Joined

  • Last visited

About agmcleod

  • Rank
    Advanced Member

Contact Methods

  • Twitter
    agmcleod

Recent Profile Visitors

920 profile views
  1. Graphics are hard! When I first saw this, I suspected some rogue transform rotate3d was on the loose or something. Just didn't suspect the rotation code would be off. I would think it would be the same across browsers... Matrix math isn't controversial.
  2. So I tried setting the rotationQuaternion directly, and that seems to do it: https://playground.babylonjs.com/indexstable#TZUQWM#2 I did try using the beta, but you might also see my thread where I'm not seeing shadows in any browser, and particle effects not rendering over the shadow only material in Safari & Chrome.
  3. It seems to be okay in 3.1.0, but that's been giving me other problems, so im wondering if i can find a fix in 3.0.7. https://playground.babylonjs.com/indexstable#TZUQWM#1 Is there some other way I need to set the rotation? If it renders correctly, it looks like: In the playground in FF 37/dev edition on windows I'm seeing:
  4. Yeah I'm not sure what's going on. Would it be helpful to share my code? It wouldn't be a runnable example, as it's using other pieces of state.
  5. Not quite there, but interestingly enough, the particles do get cut off: http://playground.babylonjs.com/#A8DRKJ#2 When i change the clear color on my local example to use (0, 0, 0, 0.1), a slightly opaque background, i can see the particles again. Shadows still no go.
  6. Ah good call, didn't realize that was a requirement with directional light. Done. I'll see if I can get a playground together to reproduce.
  7. @MackeyK24 @Deltakosh I may have been misunderstanding the core issue. I don't think FPS actually drops, but the scene itself takes longer. It's a physics based scene using cannon.js. The results seem to be the same, but it just runs longer for some reason.
  8. I have my own local copy of the shadow material, as I can't seem to pull it from the built version of babylon. I pull in BabylonJS via NPM and put it together using webpack. I import the local copy of the shadow only material, and it hoists itself onto BABYLON. I did a diff against the one here: https://github.com/BabylonJS/Babylon.js/blob/master/dist/materialsLibrary/babylon.shadowOnlyMaterial.js. There are no changes since originally pulling it. The reason I ask is because since updating from 3.0.7 to the 3.1.0-beta3, in order to fix another bug in firefox 56 on windows, I've noticed that the particles and shadows are not rendering over top of the shadow only material for me anymore in Chrome & Safari. Weirdly the particles work in firefox 38, but the shadows still do not render. I have babylon in my package.json. The webpack config is pretty standard on using the babel-loader, no special considerations for babylonjs.' The code I use to create the ground, using the shadow only material: const ground = BABYLON.Mesh.CreateGround('ground1', 10, 16, 2, scene) ground.position.x = 0 ground.position.y = 0 ground.position.z = 9 ground.physicsImpostor = new BABYLON.PhysicsImpostor(ground, BABYLON.PhysicsImpostor.BoxImpostor, { mass: 0, restitution: 0.6 }, scene) ground.receiveShadows = true let groundMat if (this.showTableMaterials) { groundMat = new BABYLON.StandardMaterial('groundMat', scene) groundMat.diffuseColor = new BABYLON.Color3(0.3294117647, 0.631372549, 0.3647058824) } else { groundMat = new BABYLON.ShadowOnlyMaterial('shadowOnly', scene) } ground.material = groundMat The shadow & light setup: // This creates a light, aiming down toward the table from the left this.light = new BABYLON.DirectionalLight('light1', new BABYLON.Vector3(0, -10, 1), scene) this.light.specular = BABYLON.Color3.White() // Adjust light source to make more distinctive shadows this.light.direction = new BABYLON.Vector3(0, -3, 2) this.shadowGenerator = new BABYLON.ShadowGenerator(1024, this.light) this.shadowGenerator.useBlurExponentialShadowMap = true this.shadowGenerator.useKernelBlur = true this.shadowGenerator.blurKernel = MAX_SHADOW_KERNEL_BLUR this.shadowGenerator.setDarkness(0.4) Then the mesh & material for the dice: const die = BABYLON.Mesh.CreateBox(`dice${dieNumber}`, DICE_SIZE, scene) this.setDiePosition(die, dieNumber) die.material = this.diceMultiMat die.subMeshes.push(new BABYLON.SubMesh(0, 0, 4, 0, 6, die)) die.subMeshes.push(new BABYLON.SubMesh(5, 0, 4, 6, 6, die)) die.subMeshes.push(new BABYLON.SubMesh(2, 0, 4, 12, 6, die)) die.subMeshes.push(new BABYLON.SubMesh(3, 0, 4, 18, 6, die)) die.subMeshes.push(new BABYLON.SubMesh(4, 0, 4, 24, 6, die)) die.subMeshes.push(new BABYLON.SubMesh(1, 0, 4, 30, 6, die)) this.shadowGenerator.getShadowMap().renderList.push(die) So if i set the ground to use teh shadow only material in this test sandbox i have, set the css body background to blue. This is how it looks: Youll see no shadows under the dice, and the fire only appears over the cubes. The same setup in firefox:
  9. I've noticed my scene running slower too, even on 3.1.0 beta.
  10. Hey there, i feel like this is probably a stupid question, given it's called alpha. But the 3.1.0-alpha version on npm does seem to fix a bug i'm having with ff developer edition on 3.0.7. Obviously it's best for me to do my own QA, but i'm wondering if you think it should be okay to use, or if it's recommended to wait for now.
  11. Unable to import babylon

    I'm not using typescript, but I added both babylon & canon as dependencies via npm. Then in my scene file, i have at the top: import BABYLON from 'babylonjs' import CANNON from 'cannon' window.CANNON = CANNON Cannon is hoisted on window, as babylon expects it to be global scope. If you have your code babylon code scattered among multiple files, import babylon in each separate file. Just import cannon the one time, at the earliest point in your tree that you can.
  12. That did the trick. The shadows dont look as good when the cubes are higher up as they did. But it works well enough for this purpose. I'll check out 3.1 changes once they come. Thanks again.
  13. i'll try it to keep simple, or maybe average it. I'm applying to two cubes moving independently.
  14. Ahh good to know. Adjusting the blur would apply to whole shadow map eh? Btw thanks for replying to all my questions. You're a champ on here.
  15. Lift your arm high over your table if you're inside, and bring it down towards the surface. As you do this, the shadow becomes more in focus, and more crisp. I'm wondering if it's possible to replicate this behaviour using the shadow maps or not. I have a setup fairly similar to the example here: https://www.babylonjs-playground.com/#IIZ9UU. But even when you toy with the Y position of the torus in that example, the shadow keeps the same level of blur, regardless of distance from light.