diff --git a/assets/floortiles.png b/assets/floortiles.png new file mode 100644 index 0000000..4345d73 Binary files /dev/null and b/assets/floortiles.png differ diff --git a/assets/floortiles_normal.png b/assets/floortiles_normal.png new file mode 100644 index 0000000..89a84eb Binary files /dev/null and b/assets/floortiles_normal.png differ diff --git a/assets/index.d.ts b/assets/index.d.ts index 29fd204..b8cb61b 100644 --- a/assets/index.d.ts +++ b/assets/index.d.ts @@ -1,4 +1,4 @@ -declare module '*.jpg' { +declare module '*.png' { const value: any export = value; } \ No newline at end of file diff --git a/assets/wood_floor_diff_4k.jpg b/assets/wood_floor_diff_4k.jpg deleted file mode 100644 index dfeeefd..0000000 Binary files a/assets/wood_floor_diff_4k.jpg and /dev/null differ diff --git a/src/index.ts b/src/index.ts index 923c609..93b92d1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,7 @@ import * as BABYLON from '@babylonjs/core'; import { SkyMaterial } from '@babylonjs/materials'; -import img from '../assets/wood_floor_diff_4k.jpg'; +import img from '../assets/floortiles.png'; +import norm from '../assets/floortiles_normal.png'; const canvas = document.createElement('canvas'); canvas.id = "render-canvas"; @@ -29,9 +30,14 @@ cube.translate(new BABYLON.Vector3(0, 1, 0), 0.5001); const ground = BABYLON.MeshBuilder.CreateGround('ground', {width:15, height:15}, scene); const groundMat = new BABYLON.StandardMaterial('groundMaterial', scene); const woodTex = new BABYLON.Texture(img, scene); -woodTex.uScale = ground._width/2; -woodTex.vScale = ground._height/2; +woodTex.uScale = ground._width; +woodTex.vScale = ground._height; +const normal = new BABYLON.Texture(norm, scene); +normal.uScale = ground._width; +normal.vScale = ground._height; groundMat.diffuseTexture = woodTex; +groundMat.bumpTexture = normal; +groundMat.specularColor = new BABYLON.Color3(0.4, 0.4, 0.4); groundMat.backFaceCulling = false; ground.material = groundMat;