pardo

Members
  • Content Count

    4
  • Joined

  • Last visited

  1. Hi All , I got a fix //FIX texture.uScale = 10 / texture._canvas.width; texture.vScale = 10 / texture._canvas.height; // when drawing with the canvas context the top left corner should be (0,0) texture.vOffset = 1 - texture.vScale; texture.uScale -= 0.001; // fix some texture bleeding texture.vScale -= 0.001; // fix some texture bleeding http://www.babylonjs-playground.com/#1MCWZJ#1
  2. amarneethi you could use the bezier curve to ease in / out the movement http://cubic-bezier.com/#0,0,.58,1 here you can find some code examples https://github.com/d3/d3-ease
  3. Hi Everyone, I'm looking into this mesh = BABYLON.MeshBuilder.CreatePlane("mesh", { width: 10, height: 10, sideOrientation: BABYLON.Mesh.DOUBLESIDE }, scene); mesh.material = new BABYLON.StandardMaterial(null, scene); texture = new BABYLON.DynamicTexture("texture", { width: 10, height: 10 }, scene, false, BABYLON.Texture.NEAREST_SAMPLINGMODE); mesh.material.diffuseTexture = texture; context = texture.getContext(); context.fillStyle = '#F00'; context.fillRect(0, 0, 100, 100); context.fillStyle = '#00F'; context.fillRect(0, 0, 15, 5); texture.update(); // Trying to fix it like ( WIP ) mesh.material.diffuseTexture.uScale = 10 / mesh.material.diffuseTexture._canvas.width; mesh.material.diffuseTexture.vScale = 10 / mesh.material.diffuseTexture._canvas.height; On the internal the framework is forcing the texture to be power of 2 which is ok, but my problem is that the new canvas size is 16x16 instead of 10x10 but the way UV are mapped makes that the 10x10 size will only cover a portion of the plane instead of the full width/height. Some references on the code. DynamicTexture constructor https://github.com/BabylonJS/Babylon.js/blob/8220f1520a9faf4779ba7c0280514fb8f724b524/src/Materials/Textures/babylon.dynamicTexture.ts#L19 Engine.createDynamicTexture https://github.com/BabylonJS/Babylon.js/blob/eefc1faaf1261143658c3c07e7f86b8f22f65b6e/src/babylon.engine.ts#L1815 Example: http://www.babylonjs-playground.com/#1MCWZJ#0
  4. Hi Everyone , I'm just starting to work with BJS. I'm trying the ShadowGenerator but I have an issue with the shadow that appears to be a bug but I'm not sure. I've looked up for the "shadow" and "shadows" tag on the forum but I couldn't find anything. http://www.babylonjs-playground.com/#E3ZTS#0