BabylonReactNative icon indicating copy to clipboard operation
BabylonReactNative copied to clipboard

CreateGroundFromHeightMap has no effect

Open carolhmj opened this issue 3 years ago • 5 comments

For questions, please use the forum.

Describe the bug No heightmap is created and no warnings/errors are shown

To Reproduce Steps to reproduce the behavior:

  1. Use CreateGroundFromHeightMap with any image https://doc.babylonjs.com/divingDeeper/mesh/creation/set/ground_hmap

Expected behavior A heightmap mesh should be created

Other

  • Platform: Galaxy S21

carolhmj avatar Mar 30 '22 14:03 carolhmj

I'm taking a quick look ...

CedricGuillemet avatar May 10 '22 15:05 CedricGuillemet

Got it working with this script (win32 and Android)

var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0.8, 90, BABYLON.Vector3.Zero(), scene);
camera.lowerBetaLimit = 0.1;
camera.upperBetaLimit = (Math.PI / 2) * 0.9;
camera.lowerRadiusLimit = 30;
camera.upperRadiusLimit = 150;
//camera.attachControl(canvas, true);

var light = new BABYLON.HemisphericLight("dir01", new BABYLON.Vector3(0, 0.3, -1), scene);
light.intensity = 0.9;

// Ground
var ground = BABYLON.Mesh.CreateGroundFromHeightMap("ground", "https://playground.babylonjs.com/textures/heightMap.png", 100, 100, 100, 0, 10, scene, false);
var groundMaterial = new BABYLON.StandardMaterial("ground", scene);
groundMaterial.diffuseTexture = new BABYLON.Texture("https://playground.babylonjs.com/textures/ground.jpg", scene);
groundMaterial.diffuseTexture.uScale = 6;
groundMaterial.diffuseTexture.vScale = 6;
groundMaterial.specularColor = new BABYLON.Color3(0, 0, 0);
ground.position.y = -2.05;
ground.material = groundMaterial;

It's copy pasted code from https://playground.babylonjs.com/#CQNGRK#0 That is being used for validation test.

IIRC @carolhmj you were using a different image. Can you please upload it somewhere?

CedricGuillemet avatar May 10 '22 15:05 CedricGuillemet

@CedricGuillemet , are you testing on BabylonNative? I was able to get it working on Babylon Native as well but the problem happens when using it on Babylon React Native.

SergioRZMasson avatar May 10 '22 15:05 SergioRZMasson

Got the exception : "LoadFileError: Creating blobs from 'ArrayBuffer' and 'ArrayBufferView' are not supported"

CedricGuillemet avatar May 11 '22 13:05 CedricGuillemet

Issue supposedly only happens with Babylon React Native

bghgary avatar Dec 08 '22 21:12 bghgary