Pryme8 Posted October 31, 2017 Share Posted October 31, 2017 I cant find much documentation on how to use the Dynamic Texture. What I am trying to do is per pixel manipulation of the DataBuffer. Is there a way to make a Dynamic texture that is not square, does it have the same call backs as a texture being created? I am trying to effectively do this but with a dynamic texture of set width and height: var self = this; this._tiles = new BABYLON.Texture(url, this.parent.scene, true, false, 1, ()=>{ self.inverseTextureSize = new BABYLON.Vector2(1/self._tiles._texture._width, 1/self._tiles._texture._height); console.log("inverseTextureSize", self.inverseTextureSize); self._setShader(); self.parent._tasks--; }); and then be able to get the context of the texture and manipulate it per pixel as necessary then make sure its pushed to the shader. This might be best done with a dynamic texture, but Im not sure where to start. *EDIT** well that was easier then I thought: var dTex = new BABYLON.DynamicTexture('dtest', {width:32, height:8}, scene, false, 1); var context = dTex._context; var size = dTex.getSize(); context.fillStyle = 'black'; context.fillRect(0, 0, size.width, size.height); dTex.update(); Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 31, 2017 Share Posted October 31, 2017 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.