Skip to content

Commit dedac49

Browse files
committed
Cleaned up shader & room files
_Broke shaders into individual files to make it easier to edit and look through for the pxlRooms _Added comments to the room example js files _Some shader cleanup
1 parent c717f66 commit dedac49

File tree

13 files changed

+1292
-1147
lines changed

13 files changed

+1292
-1147
lines changed

docs/js/pxlPages/ProcPageManager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ export class ProcPageManager {
181181
this.verifiedPages[ pageId.toLocaleLowerCase() ] = pageId;
182182
});
183183

184-
184+
185185
// -- Error check; user put in a bad URL --
186-
if( !pageListingKeys.hasOwnProperty( pageURL ) ){
186+
if( !pageListingKeys.includes( pageURL ) ){
187187
pageURL = this.defaultPage;
188188
this.shiftHistoryState( pageURL );
189189
this.updateDocumentMetaData( pageURL );

docs/js/pxlRooms/CampfireEnvironment/CampfireEnvironment.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
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+
123
import {
224
Color, FogExp2, Vector2, Vector3,
325
RepeatWrapping, ClampToEdgeWrapping,
@@ -130,6 +152,10 @@ export class CampfireEnvironment extends RoomEnvironment{
130152
}
131153

132154
checkEyeBlink(){
155+
if( !this.materialList.hasOwnProperty( "RabbitDruidA" ) ){
156+
return;
157+
}
158+
133159
if( this.eyeBlinkAnim > 0 ){
134160
// Decrease the eye blink animation 1 to 0
135161
this.eyeBlinkAnim -= this.eyeBlinkRate;
@@ -463,6 +489,7 @@ export class CampfireEnvironment extends RoomEnvironment{
463489
skinnedMaterial.side = DoubleSide;
464490
skinnedMaterial.lights = true;
465491

492+
466493
bindObj.material = skinnedMaterial;
467494
return skinnedMaterial;
468495
}

0 commit comments

Comments
 (0)