Does anyone know the solution to these artifacts happening when meshes intersect?
Sorry i am new to BABYLON so i paste the code here.
Any help would be greatly appreciated.
var createScene = function () {
var scene = new BABYLON.Scene(engine);
var baseLight = new BABYLON.HemisphericLight("baseLight", new BABYLON.Vector3(0, 10, 0), scene);
var box2 = BABYLON.MeshBuilder.CreateBox("b2", {width:10,height:3,depth:.2}, scene);
box2.rotation.y = Math.PI/4;
var box3 = BABYLON.MeshBuilder.CreateBox("b3", {width:.2,height:3,depth:10}, scene);
box3.rotation.y = Math.PI/4;
var mat1 = new BABYLON.StandardMaterial("textureGrass", scene);
mat1.diffuseTexture = new BABYLON.Texture("textures/grass.jpg", scene);
//mat1.diffuseColor = new BABYLON.Color3(0.89, 0.08, 0.08);
var mat2 = new BABYLON.StandardMaterial("textureWood", scene);
mat2.diffuseTexture = new BABYLON.Texture("textures/wood.jpg", scene);
mat2.diffuseColor = new BABYLON.Color3(0.89, 0.08, 0.08);
box2.material = mat1;
box3.material = mat2;
// FreeCamera >> You can move around the world with mouse and keyboard (LEFT/RIGHT/UP/DOWN)
var freeCamera = new BABYLON.UniversalCamera("UniversalCamera", new BABYLON.Vector3(0, 1, -15), scene);
freeCamera.attachControl(canvas, true);
freeCamera.minZ = 0.0001;
freeCamera.speed = 0.1;
freeCamera.angularSpeed = 0.025;
freeCamera.angle = Math.PI/2;
freeCamera.direction = new BABYLON.Vector3(Math.cos(freeCamera.angle), 0, Math.sin(freeCamera.angle));
freeCamera.attachControl(canvas, true);
return scene;
}