hwihwalab commited on
Commit
6097fba
ยท
verified ยท
1 Parent(s): 898ed52

feat(wasm): deploy real 60FPS MuJoCo WebAssembly physics engine (Zero Docker, Zero GIFs)

Browse files
app.js CHANGED
@@ -977,7 +977,7 @@ async function initWasmEngine() {
977
  try {
978
  if (!MujocoWasmPlayer) {
979
  engineLoadingMgr.setProgress(50, "๐Ÿ“ฆ MuJoCo WebAssembly ๋ชจ๋“ˆ ๋กœ๋”ฉ ์ค‘...", "๐Ÿ“ฆ Loading MuJoCo WASM Module...");
980
- const mod = await import(withSign("./mujoco_wasm_player.js?v=20261107_v19"));
981
  MujocoWasmPlayer = mod.MujocoWasmPlayer;
982
  }
983
  wasmPlayer = new MujocoWasmPlayer(container);
 
977
  try {
978
  if (!MujocoWasmPlayer) {
979
  engineLoadingMgr.setProgress(50, "๐Ÿ“ฆ MuJoCo WebAssembly ๋ชจ๋“ˆ ๋กœ๋”ฉ ์ค‘...", "๐Ÿ“ฆ Loading MuJoCo WASM Module...");
980
+ const mod = await import(withSign("./mujoco_wasm_player.js?v=20261107_v20"));
981
  MujocoWasmPlayer = mod.MujocoWasmPlayer;
982
  }
983
  wasmPlayer = new MujocoWasmPlayer(container);
assets/anim_01.gif ADDED

Git LFS Details

  • SHA256: 78f9d0531dc68e7237cd094211e33a7189ebb28b7420e1eb9a20f5cc92c4953e
  • Pointer size: 132 Bytes
  • Size of remote file: 1.56 MB
assets/anim_02.gif ADDED

Git LFS Details

  • SHA256: ae228a9f60d90efd2702f12210d2e3280deb7de889df9289dadf7c4058affde9
  • Pointer size: 132 Bytes
  • Size of remote file: 1.27 MB
assets/anim_03.gif ADDED

Git LFS Details

  • SHA256: 51ce89892a69bbfd5526d2df197be3b57ed1d4734269db61046f40379ad42031
  • Pointer size: 131 Bytes
  • Size of remote file: 858 kB
assets/anim_04.gif ADDED

Git LFS Details

  • SHA256: cee0b6c042a8445414a301e75fd391d29cb4fc362ed664f290e8e255e9b9435e
  • Pointer size: 131 Bytes
  • Size of remote file: 958 kB
assets/anim_05.gif ADDED

Git LFS Details

  • SHA256: bfda3c9869621623f63b822aac039765b5f7c77e240136864b054c6e63011732
  • Pointer size: 132 Bytes
  • Size of remote file: 1.19 MB
assets/anim_06.gif ADDED

Git LFS Details

  • SHA256: 760deddbeae619d194f7935572a4ab1ed42483350dffca6512ec3493a8656ab6
  • Pointer size: 131 Bytes
  • Size of remote file: 951 kB
assets/anim_07.gif ADDED

Git LFS Details

  • SHA256: 9b2db9772cd7296adcabcd044b918635dbb67bd75ce80932137e9a696bd5f183
  • Pointer size: 131 Bytes
  • Size of remote file: 223 kB
assets/anim_08.gif ADDED

Git LFS Details

  • SHA256: f7b4deef955f8a821e0c3d51aa84da25efc2883de5bd71ee76f7109579d19cd1
  • Pointer size: 132 Bytes
  • Size of remote file: 1.65 MB
assets/anim_09.gif ADDED

Git LFS Details

  • SHA256: 7f9975916ae50d7d715fbf4a63a8b19314121914b3c058b55ffc492eb57ef9a4
  • Pointer size: 131 Bytes
  • Size of remote file: 845 kB
assets/anim_10.gif ADDED

Git LFS Details

  • SHA256: 757a42f9747c5688dc90f1368a8e53ecd983a899b1b712024ddd72729d9f290d
  • Pointer size: 131 Bytes
  • Size of remote file: 987 kB
assets/cleared_03.png ADDED
assets/cleared_06.png ADDED
assets/cleared_10.png ADDED
assets/game01.png ADDED
assets/game02.png ADDED
assets/game03.png ADDED
assets/game04.png ADDED
assets/game05.png ADDED
assets/game06.png ADDED
assets/game07.png ADDED
assets/game08.png ADDED
assets/game09.png ADDED
assets/game10.png ADDED
index.html CHANGED
@@ -360,7 +360,7 @@
360
  ================================================================ -->
361
  <script>
362
  (function () {
363
- var VER = "20261107_v19";
364
  var GAMES = [
365
  [1, "BEAN PARTY", "Jelly Bean Skydiving Party", "01 ยท ์ ค๋ฆฌ๋นˆ ์Šค์นด์ด๋‹ค์ด๋น™ ํŒŒํ‹ฐ"],
366
  [2, "BALL POOL", "Jelly Bean Ball Pool Pinball", "02 ยท ์ ค๋ฆฌ๋นˆ ๋ณผํ’€์žฅ & ํ•€๋ณผ ํ”Œ๋ฆฌํผ"],
 
360
  ================================================================ -->
361
  <script>
362
  (function () {
363
+ var VER = "20261107_v20";
364
  var GAMES = [
365
  [1, "BEAN PARTY", "Jelly Bean Skydiving Party", "01 ยท ์ ค๋ฆฌ๋นˆ ์Šค์นด์ด๋‹ค์ด๋น™ ํŒŒํ‹ฐ"],
366
  [2, "BALL POOL", "Jelly Bean Ball Pool Pinball", "02 ยท ์ ค๋ฆฌ๋นˆ ๋ณผํ’€์žฅ & ํ•€๋ณผ ํ”Œ๋ฆฌํผ"],
mujoco_wasm_player.js CHANGED
@@ -135,19 +135,19 @@ export class MujocoWasmPlayer {
135
  this.camera = new THREE.PerspectiveCamera(45, (this.canvas.width || 640) / (this.canvas.height || 480), 0.05, 100);
136
  this.camera.up.set(0, 0, 1);
137
 
138
- // โ˜… 5-Way High-Key Carnival Studio Lighting (์—์…‹ ์›๋ณธ anim_07.gif 1:1 ์™„๋ฒฝ ์ผ์น˜)
139
- // 1. ํ—ค๋“œ๋ผ์ดํŠธ ์•ฐ๋น„์–ธํŠธ: ์ „์ฒด์ ์ธ ์ตœ์ € ์กฐ๋„๋ฅผ ๊ท ์ผํ•˜๊ฒŒ ํ™•๋ณดํ•˜์—ฌ ์•”์ „์„ ์ฐจ๋‹จ (0.55, MuJoCo XML ambient .55 ์ผ์น˜)
140
- const ambientLight = new THREE.AmbientLight(0xfff7fc, 0.55);
141
  this.scene.add(ambientLight);
142
 
143
- // 2. ํ—ค๋ฏธ์Šคํ”ผ์–ด ๋ผ์ดํŠธ: ํ•˜๋Š˜๋น› ๋ผ์ผ๋ฝ & ๋ฐ”๋‹ฅ ๋ฐ˜์‚ฌ๊ด‘ (0.30)
144
- const hemiLight = new THREE.HemisphereLight(0xfff0fe, 0xf0f6ff, 0.30);
145
  hemiLight.position.set(0, 0, 10);
146
  this.scene.add(hemiLight);
147
 
148
- // 3. ์ฃผ๊ด‘ (Key Light): ๋ถ€๋“œ๋Ÿฝ๊ณ  ๋„“์€ ์ŠคํŠœ๋””์˜ค ๋ถ„์‚ฐ๊ด‘์œผ๋กœ ํ•ซ์ŠคํŒŸ๊ณผ ๋ˆˆ๋ถ€์‹ฌ์„ ์›์ฒœ ๋ฐฉ์ง€
149
- const keyLight = new THREE.DirectionalLight(0xffffff, 0.90);
150
- keyLight.position.set(1.5, -2.5, 4.5);
151
  keyLight.castShadow = true;
152
  keyLight.shadow.mapSize.width = 2048;
153
  keyLight.shadow.mapSize.height = 2048;
@@ -161,14 +161,14 @@ export class MujocoWasmPlayer {
161
  keyLight.shadow.normalBias = 0.02;
162
  this.scene.add(keyLight);
163
 
164
- // 4. ํ›„๋ฐฉ ๋ณด์กฐ๊ด‘ (Fill Light): ์บ๋ฆญํ„ฐ ์™ธ๊ณฝ ์œค๊ณฝ์„ ์‚ด๋ ค์ฃผ๋Š” ๋ถ€๋“œ๋Ÿฌ์šด ๋ฆผ๋ผ์ดํŠธ (0.40)
165
- const fillLight = new THREE.DirectionalLight(0xffeefa, 0.40);
166
  fillLight.position.set(-2.0, 2.5, 4.0);
167
  this.scene.add(fillLight);
168
 
169
  // 5. ์นด๋ฉ”๋ผ ํ—ค๋“œ๋ผ์ดํŠธ (MuJoCo Headlight 1:1 ์™„๋ฒฝ ๊ณ ์ •):
170
- // ์นด๋ฉ”๋ผ ์‹œ์„  ๋ฒกํ„ฐ์— ์ง์ ‘ ๋ฌถ์—ฌ ์ •๋ฉด ๊ทธ๋ฆผ์ž๋ฅผ ๊ฑท์–ด๋‚ด๊ณ  ์บ”๋”” ์ปฌ๋Ÿฌ์˜ ์„ ๋ช…ํ•จ์„ ์œ ์ง€
171
- const headLight = new THREE.DirectionalLight(0xffffff, 0.60);
172
  headLight.position.set(0, 0, 0);
173
  const headLightTarget = new THREE.Object3D();
174
  headLightTarget.position.set(0, 0, -1);
@@ -310,11 +310,14 @@ export class MujocoWasmPlayer {
310
  // โ˜… ์—์…‹ ์›๋ณธ์˜ ์‚ฐ๋œปํ•˜๊ณ  ์‚ด์ง ๋งคํŠธํ•œ ์ƒˆํ‹ด ์ ค๋ฆฌ๋นˆ ์งˆ๊ฐ (MuJoCo OpenGL Blinn-Phong 1:1 ์ผ์น˜)
311
  const color = new THREE.Color(r, gc, b).convertSRGBToLinear();
312
 
 
 
 
313
  // ์‚ด์ง ๋งคํŠธํ•˜๋ฉด์„œ ์ปฌ๋Ÿฌ๊ฐ€ ํ’๋ถ€ํ•˜๊ฒŒ ์‚ด์•„์žˆ๋Š” ์—์…‹ ์›๋ณธ์˜ ์†Œํ”„ํŠธ ์ƒˆํ‹ด(Semi-Matte Satin) ์งˆ๊ฐ!
314
  // ๊ณผ๋„ํ•œ ์œ ๋ฆฌ์•Œ ๋ฒˆ์ฉ์ž„์„ ์›์ฒœ ์ฐจ๋‹จํ•˜๊ธฐ ์œ„ํ•ด specular๋ฅผ ์€์€ํ•œ 0.12, shininess๋ฅผ 20์œผ๋กœ ์„ค์ •
315
  const mat = new THREE.MeshPhongMaterial({
316
  color: color,
317
- emissive: new THREE.Color(0, 0, 0),
318
  specular: new THREE.Color(0.12, 0.12, 0.12),
319
  shininess: 20,
320
  transparent: a < 0.99,
 
135
  this.camera = new THREE.PerspectiveCamera(45, (this.canvas.width || 640) / (this.canvas.height || 480), 0.05, 100);
136
  this.camera.up.set(0, 0, 1);
137
 
138
+ // โ˜… 5-Way High-Key Pastel Carnival Studio Lighting (์—์…‹ ์›๋ณธ anim_07.gif 1:1 ์™„๋ฒฝ ์ผ์น˜)
139
+ // 1. ํ—ค๋“œ๋ผ์ดํŠธ ์•ฐ๋น„์–ธํŠธ: ์ „์ฒด ์ตœ์ € ์กฐ๋„๋ฅผ 0.85๋กœ ๋Œ€ํญ ๋Œ์–ด์˜ฌ๋ ค ์›ํ†ต ์•„๋žซ๋ฉด ์•”์ „ ๋ฐ ์ฑ„๋„ ์ €ํ•˜ ์™„๋ฒฝ ์ฐจ๋‹จ
140
+ const ambientLight = new THREE.AmbientLight(0xfff8fd, 0.85);
141
  this.scene.add(ambientLight);
142
 
143
+ // 2. ํ—ค๋ฏธ์Šคํ”ผ์–ด ๋ผ์ดํŠธ: ํ•˜๋Š˜๋น› ๋ผ์ผ๋ฝ & ๋ฐ”๋‹ฅ ๋ฐ˜์‚ฌ๊ด‘ (0.40)
144
+ const hemiLight = new THREE.HemisphereLight(0xfff0fe, 0xf0f6ff, 0.40);
145
  hemiLight.position.set(0, 0, 10);
146
  this.scene.add(hemiLight);
147
 
148
+ // 3. ์ฃผ๊ด‘ (Key Light): ๋ถ€๋“œ๋Ÿฝ๊ณ  ๋„“์€ ์ŠคํŠœ๋””์˜ค ๋ถ„์‚ฐ๊ด‘์œผ๋กœ ํ•ซ์ŠคํŒŸ ์—†์ด ํ™”์‚ฌํ•œ ํ•˜์ดํ‚ค ๊ด‘๋Ÿ‰ ํ™•๋ณด (1.15)
149
+ const keyLight = new THREE.DirectionalLight(0xffffff, 1.15);
150
+ keyLight.position.set(1.5, -2.8, 4.5);
151
  keyLight.castShadow = true;
152
  keyLight.shadow.mapSize.width = 2048;
153
  keyLight.shadow.mapSize.height = 2048;
 
161
  keyLight.shadow.normalBias = 0.02;
162
  this.scene.add(keyLight);
163
 
164
+ // 4. ํ›„๋ฐฉ ๋ณด์กฐ๊ด‘ (Fill Light): ์บ๋ฆญํ„ฐ ์™ธ๊ณฝ ์œค๊ณฝ์„ ์‚ด๋ ค์ฃผ๋Š” ๋ถ€๋“œ๋Ÿฌ์šด ๋ฆผ๋ผ์ดํŠธ (0.45)
165
+ const fillLight = new THREE.DirectionalLight(0xffeefa, 0.45);
166
  fillLight.position.set(-2.0, 2.5, 4.0);
167
  this.scene.add(fillLight);
168
 
169
  // 5. ์นด๋ฉ”๋ผ ํ—ค๋“œ๋ผ์ดํŠธ (MuJoCo Headlight 1:1 ์™„๋ฒฝ ๊ณ ์ •):
170
+ // ์นด๋ฉ”๋ผ ์‹œ์„  ๋ฒกํ„ฐ์— ์ง์ ‘ ๋ฌถ์—ฌ ์ •๋ฉด ํ‘œ๋ฉด์„ 255 ์ฒœ์žฅ๊นŒ์ง€ ํ™”์‚ฌํ•˜๊ฒŒ ๋น„์ถ”๋Š” ํ•ต์‹ฌ ์บ”๋”” ํ—ค๋“œ๋ผ์ดํŠธ (0.90)
171
+ const headLight = new THREE.DirectionalLight(0xffffff, 0.90);
172
  headLight.position.set(0, 0, 0);
173
  const headLightTarget = new THREE.Object3D();
174
  headLightTarget.position.set(0, 0, -1);
 
310
  // โ˜… ์—์…‹ ์›๋ณธ์˜ ์‚ฐ๋œปํ•˜๊ณ  ์‚ด์ง ๋งคํŠธํ•œ ์ƒˆํ‹ด ์ ค๋ฆฌ๋นˆ ์งˆ๊ฐ (MuJoCo OpenGL Blinn-Phong 1:1 ์ผ์น˜)
311
  const color = new THREE.Color(r, gc, b).convertSRGBToLinear();
312
 
313
+ // ๊ทธ๋Š˜์ง„ ๋ฉด์ด ์–ด๋‘ก๊ฒŒ ํ‘น ๊บผ์ง€๋ฉฐ ์‘ฅ์ƒ‰/ํŒฅ์ฃฝ์ƒ‰์œผ๋กœ ํƒํ•ด์ง€๋Š” ํ˜„์ƒ์„ ๋ง‰๊ธฐ ์œ„ํ•œ ๋ฏธ์„ธํ•œ ์ž์ฒด ๋ฐœ๊ด‘(0.04)
314
+ const emissive = color.clone().multiplyScalar(0.04);
315
+
316
  // ์‚ด์ง ๋งคํŠธํ•˜๋ฉด์„œ ์ปฌ๋Ÿฌ๊ฐ€ ํ’๋ถ€ํ•˜๊ฒŒ ์‚ด์•„์žˆ๋Š” ์—์…‹ ์›๋ณธ์˜ ์†Œํ”„ํŠธ ์ƒˆํ‹ด(Semi-Matte Satin) ์งˆ๊ฐ!
317
  // ๊ณผ๋„ํ•œ ์œ ๋ฆฌ์•Œ ๋ฒˆ์ฉ์ž„์„ ์›์ฒœ ์ฐจ๋‹จํ•˜๊ธฐ ์œ„ํ•ด specular๋ฅผ ์€์€ํ•œ 0.12, shininess๋ฅผ 20์œผ๋กœ ์„ค์ •
318
  const mat = new THREE.MeshPhongMaterial({
319
  color: color,
320
+ emissive: emissive,
321
  specular: new THREE.Color(0.12, 0.12, 0.12),
322
  shininess: 20,
323
  transparent: a < 0.99,