Skip to content

Commit

Permalink
small webpack tweak and ensured consistency between skybox sun and he…
Browse files Browse the repository at this point in the history
…mispheric light
  • Loading branch information
99-Knots committed May 31, 2024
1 parent 392a44c commit 4d81b16
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,22 @@ const scene = new Scene(engine);
const camera = new ArcRotateCamera('camera1', 0.5, 0.9, 10, Vector3.Zero(), scene);
camera.attachControl(canvas, true);

const sunPosition = new Vector3(0, 100, -100);
const skyMaterial = new SkyMaterial("skyMaterial", scene);
skyMaterial.backFaceCulling = false;
skyMaterial.inclination = 0.3;
skyMaterial.useSunPosition = true;
skyMaterial.sunPosition = sunPosition;

const skybox = MeshBuilder.CreateBox("skyBox", { size: 1000.0 }, scene);
skybox.material = skyMaterial;

const light = new HemisphericLight('light1', new Vector3(0, 1, 1), scene);
const light = new HemisphericLight('hemisphereLight', sunPosition, scene);

const cube = MeshBuilder.CreateBox('box', {size: 1}, scene);
cube.translate(new Vector3(0, 1, 0), 0.5001);
cube.translate(new Vector3(0, 1, 0), 0.5001); // avoid clipping with ground

const ground = MeshBuilder.CreateGround('ground', {width:15, height:15}, scene);
const groundMat = new StandardMaterial('groundMaterial', scene);
const groundMat = new StandardMaterial('groundMat', scene);
const woodTex = new Texture(img, scene);
woodTex.uScale = ground._width;
woodTex.vScale = ground._height;
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"module": "commonjs",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"sourceMap": false,
"sourceMap": false,

/* Type Checking */
"strict": true,
Expand Down
6 changes: 4 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ module.exports = {
use: {
loader: WebpackObfuscator.loader,
options: {
rotateStringArray: true
rotateStringArray: true,
compact: true,
}
}
}
Expand All @@ -38,7 +39,8 @@ module.exports = {
},
plugins: [
new WebpackObfuscator ({
rotateStringArray: true
rotateStringArray: true,
compact: true,
}, ['bundle.js'])
],
devServer: {
Expand Down

0 comments on commit 4d81b16

Please sign in to comment.