Up-in-the-Air – commitdiff

You can use Git to clone the repository via the web URL. Download snapshot (zip)
Enable support for unlockable feather unique materials
authorJulian Fietkau <git@fietkau.software>
Sat, 28 Sep 2024 03:54:38 +0000 (05:54 +0200)
committerJulian Fietkau <git@fietkau.software>
Sat, 28 Sep 2024 03:54:38 +0000 (05:54 +0200)
main.js

diff --git a/main.js b/main.js
index 055cf5b0093fbd04e7583b903b2a327c7000bfe1..5c5aefcfec7d8ac7b5b1d1a59fdb8ebf5843d08a 100644 (file)
--- a/main.js
+++ b/main.js
@@ -1196,12 +1196,22 @@ function createFeather(game) {
   }
 
   const featherGeometry = new THREE.PlaneGeometry(1.6, 0.5);
-  game.view.materials.feather = new THREE.MeshPhongMaterial({
+  let options = {
     map: game.assets.textures['feather-' + game.settings['feather']],
     transparent: true,
-    alphaTest: 0.5,
+    alphaTest: 0.01,
     side: THREE.DoubleSide,
-  });
+  }
+  if(game.settings['feather'] == 'golden') {
+    options.color = 0xffffff;
+    options.emissive = 0x644a1e;
+    options.roughness = 0.5;
+    options.metalness = 0.4;
+  }
+  if(game.settings['feather'] == 'ghost') {
+    options.opacity = 0.7;
+  }
+  game.view.materials.feather = new THREE.MeshStandardMaterial(options);
   game.objects.feather = new THREE.Mesh(featherGeometry, game.view.materials.feather);
   game.objects.feather.rotation.order = 'ZXY';
   if(position) {