Created
March 6, 2023 22:52
-
-
Save deltakosh/01a6b8d548882f0bb1296edb1b79e7f6 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
// Create an heightmap | |
var heightmap = new BABYLON.DynamicTexture("heightmap", {width:1024, height:1024}, scene); | |
heightmap.update(); | |
var context = heightmap.getContext(); | |
// Plug the heightmap in the node material | |
var textureBlocks = matCap.getTextureBlocks().filter(b => b.name === "HeightMap"); | |
if (textureBlocks && textureBlocks.length) { | |
textureBlocks[0].texture = heightmap; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment