diff --git a/protocols/schemas/shapes.prs b/protocols/schemas/shapes.prs index a6a8a2c..25eec13 100644 --- a/protocols/schemas/shapes.prs +++ b/protocols/schemas/shapes.prs @@ -2,7 +2,7 @@ version 1 . Sprite = . -Shape = Mesh / Light / Scale / Move / Rotate / @many [Shape ...] / Texture / Color / Name / Floor / Nonphysical / Touchable / CSG . +Shape = Mesh / Light / Scale / Move / Rotate / @many [Shape ...] / Texture / Color / Name / Floor / Nonphysical / Touchable / CSG / Skybox . Mesh = Sphere / Box / Ground / Plane . @@ -48,3 +48,5 @@ CSGExpr = / / . + +Skybox = . diff --git a/scene/lobby.pr b/scene/lobby.pr index 2d7cfc5..f871f4f 100644 --- a/scene/lobby.pr +++ b/scene/lobby.pr @@ -1,5 +1,6 @@ >> > +> + >>>>>> diff --git a/scene/other.pr b/scene/other.pr index 6fe33a0..d62339b 100644 --- a/scene/other.pr +++ b/scene/other.pr @@ -1,13 +1,14 @@ >> -> +;> +> - - ] - >>>> +; +; ] +; >>>> -> +> [ diff --git a/src/shapes.ts b/src/shapes.ts index bd22874..79430af 100644 --- a/src/shapes.ts +++ b/src/shapes.ts @@ -1,5 +1,6 @@ import { Color3, + CubeTexture, CSG, HemisphericLight, Material, @@ -309,6 +310,19 @@ export function build(name: string, scene: Scene, shape: Shapes.Shape, customize throw new Error("unimplemented"); } + case "Skybox": { + const t = new ShapeTree(scene, shape, MeshBuilder.CreateBox(name, { size: 2000 }, scene)); + const mat = new StandardMaterial(name, scene); + mat.backFaceCulling = false; + mat.reflectionTexture = new CubeTexture(shape.value.path, scene); + mat.reflectionTexture.coordinatesMode = Texture.SKYBOX_MODE; + mat.diffuseColor = new Color3(0, 0, 0); + mat.specularColor = new Color3(0, 0, 0); + t.node.material = mat; + applyCustomizer(t, customize); + return t; + } + default: ((_shape: never) => { console.error('Unsupported shape variant', shape); diff --git a/textures/Daylight Box UV_0.png b/textures/Daylight Box UV_0.png new file mode 100644 index 0000000..6a28559 Binary files /dev/null and b/textures/Daylight Box UV_0.png differ diff --git a/textures/Daylight Box UV_0_nx.jpg b/textures/Daylight Box UV_0_nx.jpg new file mode 100644 index 0000000..f02603b Binary files /dev/null and b/textures/Daylight Box UV_0_nx.jpg differ diff --git a/textures/Daylight Box UV_0_ny.jpg b/textures/Daylight Box UV_0_ny.jpg new file mode 100644 index 0000000..fb52b0d Binary files /dev/null and b/textures/Daylight Box UV_0_ny.jpg differ diff --git a/textures/Daylight Box UV_0_nz.jpg b/textures/Daylight Box UV_0_nz.jpg new file mode 100644 index 0000000..ad74b67 Binary files /dev/null and b/textures/Daylight Box UV_0_nz.jpg differ diff --git a/textures/Daylight Box UV_0_px.jpg b/textures/Daylight Box UV_0_px.jpg new file mode 100644 index 0000000..300501b Binary files /dev/null and b/textures/Daylight Box UV_0_px.jpg differ diff --git a/textures/Daylight Box UV_0_py.jpg b/textures/Daylight Box UV_0_py.jpg new file mode 100644 index 0000000..3fb2e5a Binary files /dev/null and b/textures/Daylight Box UV_0_py.jpg differ diff --git a/textures/Daylight Box UV_0_pz.jpg b/textures/Daylight Box UV_0_pz.jpg new file mode 100644 index 0000000..b128e5a Binary files /dev/null and b/textures/Daylight Box UV_0_pz.jpg differ diff --git a/textures/README.md b/textures/README.md index 684ec48..b6e864c 100644 --- a/textures/README.md +++ b/textures/README.md @@ -1 +1,3 @@ door1.jpg: based on https://commons.wikimedia.org/wiki/File:Simple_door_inside_the_BCR_Headquarters_Building,_in_Bucharest_%28Romania%29.jpg, CC-SA 4.0 +Daylight Box UV_0.png and extracted jpgs: from https://opengameart.org/content/sky-box-sunny-day, "Copyright/Attribution Notice: KIIRA" (?) +eso0932a.jpg: https://www.eso.org/public/images/eso0932a/ diff --git a/textures/cut_skybox.sh b/textures/cut_skybox.sh new file mode 100755 index 0000000..fa7bdce --- /dev/null +++ b/textures/cut_skybox.sh @@ -0,0 +1,15 @@ +#!/bin/sh +inputfile="$1" +if [ -z "$inputfile" ] +then + echo 'Usage: cut_skybox.sh INPUTFILENAME' >&2 + exit 1 +fi + +convert -extract 512x512+0+512 "$inputfile" "$(basename "$(basename "$inputfile" .png)" .jpg)_nx.jpg" +convert -extract 512x512+512+512 "$inputfile" "$(basename "$(basename "$inputfile" .png)" .jpg)_pz.jpg" +convert -extract 512x512+1024+512 "$inputfile" "$(basename "$(basename "$inputfile" .png)" .jpg)_px.jpg" +convert -extract 512x512+1536+512 "$inputfile" "$(basename "$(basename "$inputfile" .png)" .jpg)_nz.jpg" + +convert -extract 512x512+512+0 "$inputfile" "$(basename "$(basename "$inputfile" .png)" .jpg)_py.jpg" +convert -extract 512x512+512+1024 "$inputfile" "$(basename "$(basename "$inputfile" .png)" .jpg)_ny.jpg" diff --git a/textures/eso0932a.jpg b/textures/eso0932a.jpg new file mode 100644 index 0000000..6efa24c Binary files /dev/null and b/textures/eso0932a.jpg differ diff --git a/textures/eso0932a_nx.jpg b/textures/eso0932a_nx.jpg new file mode 100644 index 0000000..b0969e0 Binary files /dev/null and b/textures/eso0932a_nx.jpg differ diff --git a/textures/eso0932a_ny.jpg b/textures/eso0932a_ny.jpg new file mode 100644 index 0000000..e1ceba1 Binary files /dev/null and b/textures/eso0932a_ny.jpg differ diff --git a/textures/eso0932a_nz.jpg b/textures/eso0932a_nz.jpg new file mode 100644 index 0000000..7b9eaf0 Binary files /dev/null and b/textures/eso0932a_nz.jpg differ diff --git a/textures/eso0932a_px.jpg b/textures/eso0932a_px.jpg new file mode 100644 index 0000000..2d700fb Binary files /dev/null and b/textures/eso0932a_px.jpg differ diff --git a/textures/eso0932a_py.jpg b/textures/eso0932a_py.jpg new file mode 100644 index 0000000..5c9d48c Binary files /dev/null and b/textures/eso0932a_py.jpg differ diff --git a/textures/eso0932a_pz.jpg b/textures/eso0932a_pz.jpg new file mode 100644 index 0000000..fb44428 Binary files /dev/null and b/textures/eso0932a_pz.jpg differ