Tomm Huth

  • Content count

  • Joined

  • Last visited

  1. Shadows on a large area

    If I do light.setShadowProjectionMatrix(camera._projectionMatrix.clone()) I get: app.js:12432 Uncaught TypeError: Cannot read property 'length' of undefined at i../node_modules/babylonjs/babylon.js.i._setDefaultAutoExtendShadowProjectionMatrix (app.js:12432) at i../node_modules/babylonjs/babylon.js.i._setDefaultShadowProjectionMatrix (app.js:12432) at i../node_modules/babylonjs/babylon.js.i.setShadowProjectionMatrix (app.js:12432) But I have absolutely no idea what I'm doing. Haha.
  2. Shadows on a large area

    @Deltakosh I'm having the same problem, and also though solution #2 would be good. But I have no idea how to calculate that. Any ideas on specifically how to do that?
  3. scene.gravity is ignored

    thanks man! didnt know it had to come as a parameter!
  4. scene.gravity is ignored

    Also notice how the sphere seems to jump up, before falling down, even though its placed above the plane
  5. scene.gravity is ignored

    It seems that the scene sticks to a "normal" earth like gravity, no matter what scene.gravity is set as. see I thought you were free to set this to whatever you wanted, like Vector3.Zero()? Or am I missing something?
  6. Fading in particles and transparent clearColor

    Turns out x * 10 solved it! Man I suck at math lol
  7. Fading in particles and transparent clearColor

    I'm trying to, but its not obvious to me what to do. I'm trying this if (particle.age < particle.lifeTime * .35) { particle.color.a = particle.age / (particle.lifeTime * .35) } if (particle.age > particle.lifeTime * .7) { let x = (particle.age - particle.lifeTime * .7) / particle.lifeTime * .3 particle.color.a = 1 - x console.log(x) } but it does not work, but i cannot find how the math is wrong. Fade in works, but fade out does not. Is this a case of to many decimals?
  8. Fading in particles and transparent clearColor

    thats static particles, and not really what my playground does tho. Copying the updateFunction does not seem to make a difference either, in fact it messes up the fading out of the particles (they fade out, then in, and then just disappear).
  9. Fading in particles and transparent clearColor

    Ha! I think there was something with my colors that messed things up, but particleSystem.color1 = new Color4(1, 1, 1, .1) particleSystem.color2 = new Color4(1, 1, 1, .85) particleSystem.colorDead = new Color4(1, 1, 1, 0.0) particleSystem.blendMode = ParticleSystem.BLENDMODE_STANDARD works like a charm. I don't know why tho, so if anyone has any background info on this that would be great. How does particles get blended with the environment? My texture is an alpha channel png. Now if only i could get the particles to fade in. I tried the suggestion from but that did not work.
  10. I'm playing around with the particle system, trying to create subtle background particles wafting randomly around. I think i have something (, but I'd like to fade in particles - not just out. Particles suddenly appearing is a little jarring. Is that even possible? I know a "soft birth" of particles has been mention here before, but I couldn't really make much sense of it as is also tried to do alot more. Also: how can i use particles with a transparent scene clearColor? With that, particles are simply not visible until they appear over some geometry in the scene. Any tips?
  11. Orthographic camera and SSAO

    @Luaacro If you're asking me, it's a semi random number. If i reduce it to 500 (works with my scene) ssao effect does kick in. New question tho: Because SSAO introduces alot of aliasing, how would you combine this with a FXAA? Is that even possible? I've tried camera.attachPostProcess(new FxaaPostProcess("d", undefined, camera)) const ssao = new SSAORenderingPipeline('ssaopipeline', scene, 1, [camera]); I get You're trying to reuse a post process not defined as reusable.
  12. Orthographic camera and SSAO

    @Luaacro sorry about that! Uncomment the camera.mode line to see the difference
  13. How to create good friction ?

    @RaananW where has these two settings gone now? I can't find it reference anywhere?
  14. What's next?

    @brianzinn you're totally right. Also I don't understand how plugins could possibly work in a npm workflow, if they all require a global export. Building your own version is really only a viable solution as long as you don't use NPM. I did manage to get my own build working, but ended up having to strip out the extra Oimo plugin (500kb extra for no reason if using Cannonjs), and also fixing a problem with the export at the bottom: (function universalModuleDefinition(root, factory) { var f = factory(); if (root && root["BABYLON"]) { return; } var globalObject = (typeof global !== 'undefined') ? global : ((typeof window !== 'undefined') ? window : this); globalObject["BABYLON"] = f; if (typeof exports === 'object' && typeof module === 'object') module.exports = f; else if (typeof define === 'function' && define.amd) define(["BABYLON"], factory); else if (typeof exports === 'object') exports["BABYLON"] = f; else { root["BABYLON"] = f; } })(this, function () { return BABYLON; }); For some reason Heroku chokes on this, complaining it can't find BABYLON export ERROR in ./node_modules/babylonjs/dist/preview release/babylon.max.js Module not found: Error: Can't resolve 'BABYLON' in '/tmp/build_2f05ec3c0854af6ba703385c4238bd5e/tommhuth-stacky-4c50f39/node_modules/babylonjs/dist/preview release' This is not a problem for me locally, and Heroku could not find a reason why this should happen. The solution to get this to work was to simply: module.exports = BABYLON For a pretty simple game ( i saved around 3mb unminified by building my own version -- on the web EVERY KB counts. The downside is that I have to manually edit the generated file and commit generated code to my repo :/ There's lots of great stuff in Babylonjs, so there is no reason why it can't also be more in line with a modern JS workflow.
  15. Orthographic camera and SSAO

    @Luaacro i'll see if i can't cock something up