Created
January 20, 2021 14:03
-
-
Save CedricGuillemet/599b9556aa50339876a8fe08e04dcda0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trail.data.shift(); trail.data.shift(); trail.data.shift(); trail.data.shift(); | |
trail.data.push(newPos.x, newPos.y, newPos.z, 0.); | |
if (!trail.texture) { | |
trail.texture = BABYLON.RawTexture.CreateRGBATexture(new Float32Array(trail.data), 1, trail.data.length / 4, scene, false, false, BABYLON.Texture.LINEAR_LINEAR, BABYLON.Engine.TEXTURETYPE_FLOAT); | |
trail.trackSampler0Block.texture = trail.texture; | |
trail.trackSampler1Block.texture = trail.texture; | |
} else { | |
trail.texture.update(new Float32Array(trail.data)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment