|
| 1 | +// pxlNav Example :: `Campfire` Environment |
| 2 | +// Created by Kevin Edzenga; 2024,2025 |
| 3 | +// -- -- -- -- -- -- -- -- -- -- -- -- -- -- |
| 4 | +// |
| 5 | +// This room is a more complex example of a pxlNav room. |
| 6 | +// It uses many custom shaders, particle systems, and animations. |
| 7 | +// |
| 8 | +// If you are looking for a simple example to look at first, |
| 9 | +// See the `Void Environment` in the `pxlRooms` folder. |
| 10 | +// It has a single custom shader, a simple pxlNav particle system, and no animations. |
| 11 | +// |
| 12 | +// What's in this room? |
| 13 | +// - A custom shader for the Rabbit Druid character |
| 14 | +// Mostly for simple ORM map & campefire flicker |
| 15 | +// - A custom shader for the Campfire Flame |
| 16 | +// Using vertex-colors to move UVs, and a noise texture to flicker |
| 17 | +// - A custom shader for the Campfire Logs |
| 18 | +// Mixing different emeber glow textures with a noise texture |
| 19 | +// - A custom shader for the ground, grass, shrubs, and plants |
| 20 | +// |
| 21 | + |
| 22 | + |
1 | 23 | import {
|
2 | 24 | Color, FogExp2, Vector2, Vector3,
|
3 | 25 | RepeatWrapping, ClampToEdgeWrapping,
|
@@ -130,6 +152,10 @@ export class CampfireEnvironment extends RoomEnvironment{
|
130 | 152 | }
|
131 | 153 |
|
132 | 154 | checkEyeBlink(){
|
| 155 | + if( !this.materialList.hasOwnProperty( "RabbitDruidA" ) ){ |
| 156 | + return; |
| 157 | + } |
| 158 | + |
133 | 159 | if( this.eyeBlinkAnim > 0 ){
|
134 | 160 | // Decrease the eye blink animation 1 to 0
|
135 | 161 | this.eyeBlinkAnim -= this.eyeBlinkRate;
|
@@ -463,6 +489,7 @@ export class CampfireEnvironment extends RoomEnvironment{
|
463 | 489 | skinnedMaterial.side = DoubleSide;
|
464 | 490 | skinnedMaterial.lights = true;
|
465 | 491 |
|
| 492 | + |
466 | 493 | bindObj.material = skinnedMaterial;
|
467 | 494 | return skinnedMaterial;
|
468 | 495 | }
|
|
0 commit comments