Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mavonengine/create-bootstrap",
"type": "module",
"version": "0.0.3",
"version": "0.0.4",
"description": "Bootstrap a MavonEngine multiplayer project",
"license": "MIT",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion packages/bootstrap/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const TAG_URL
= 'https://github.com/MavonEngine/Core/archive/refs/tags/0.0.8-alpha.zip'
= 'https://github.com/MavonEngine/Core/archive/refs/tags/0.0.9-alpha.zip'

export const TEMPLATE_SUBPATH = 'packages/multiplayer-template'
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@mavonengine/core",
"type": "module",
"version": "0.0.7",
"version": "0.0.8",
"description": "",
"author": "",
"license": "MIT",
Expand Down
11 changes: 8 additions & 3 deletions packages/multiplayer-template/client/src/Scenes/GameWorld.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import type {
Material,
} from 'three'
import Game from '@mavonengine/core/Game'
import GameObject from '@mavonengine/core/World/GameObject'
import {
Expand Down Expand Up @@ -49,7 +52,6 @@ export default class GameWorld extends GameObject {

const sun = new DirectionalLight(0xFFF4E0, 1.2)
sun.position.set(20, 40, 20)
sun.castShadow = true
sun.shadow.mapSize.set(2048, 2048)
sun.shadow.camera.near = 0.5
sun.shadow.camera.far = 200
Expand All @@ -71,8 +73,11 @@ export default class GameWorld extends GameObject {

// Grid overlay for spatial reference
const grid = new GridHelper(200, 40, 0x000000, 0x000000)
;(grid.material as { opacity: number, transparent: boolean }).opacity = 0.08
;(grid.material as { opacity: number, transparent: boolean }).transparent = true
const gridMat = grid.material as Material
gridMat.opacity = 0.5
gridMat.transparent = true
gridMat.depthWrite = false
grid.renderOrder = -1
Game.instance().scene.add(grid)
}

Expand Down
10 changes: 9 additions & 1 deletion packages/multiplayer-template/client/src/World/Trees.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Material, Mesh } from 'three'
import type { Material, Mesh, MeshStandardMaterial } from 'three'
import type { GLTF } from 'three/examples/jsm/Addons.js'
import Game from '@mavonengine/core/Game'
import GameObject from '@mavonengine/core/World/GameObject'
Expand Down Expand Up @@ -40,6 +40,14 @@ export default class Trees extends GameObject {
for (const sourceMesh of meshes) {
sourceMesh.geometry.rotateX((90 * Math.PI) / 180)

const mat = sourceMesh.material as MeshStandardMaterial
mat.depthTest = true
mat.depthWrite = true
if (mat.transparent) {
mat.transparent = false
mat.alphaTest = 0.5
}

const instancedMesh = new InstancedMesh(
sourceMesh.geometry,
sourceMesh.material as Material,
Expand Down
2 changes: 1 addition & 1 deletion packages/multiplayer-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@mavonengine/core": "0.0.7"
"@mavonengine/core": "0.0.8"
},
"devDependencies": {
"@antfu/eslint-config": "^8.0.0",
Expand Down
Loading