Skip to content

Commit 2da5aff

Browse files
committed
Campfire env Grass Cluster texture & shader update
Add some flicker from the campfire, a little darker texture, some swaying from the wind. A bluster/gust noise is mixed in so it creates patches of swaying grass. I'll need to move this shader to pxlNav Shader Core, the grass sway can allow for a wind texture and how much wind over all.
1 parent c9e2a74 commit 2da5aff

File tree

17 files changed

+972
-592
lines changed

17 files changed

+972
-592
lines changed

Build/pxlNav.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Build/pxlRooms/CampfireEnvironment/CampfireEnvironment.js

Lines changed: 360 additions & 247 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/js/pxlNav.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
22
// Core pxlNav Engine
3-
export const pxlNavVersion = "0.0.14";
3+
export const pxlNavVersion = "0.0.15";
44
// Written by Kevin Edzenga 2020;2024
55

66
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Source/js/pxlNav/gui/ShaderEditor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,9 @@ export class ShaderEditor {
323323

324324

325325
let fontSizeSmallerObj=document.getElementById("gui_shaderEditorFontSmaller");
326-
fontSizeSmallerObj.onclick=(e)=>{ tmpThis.shiftFontSize(-.25); };
326+
fontSizeSmallerObj.onclick=(e)=>{ tmpThis.shiftFontSize(-.15); };
327327
let fontSizeLargerObj=document.getElementById("gui_shaderEditorFontLarger");
328-
fontSizeLargerObj.onclick=(e)=>{ tmpThis.shiftFontSize(.25); };
328+
fontSizeLargerObj.onclick=(e)=>{ tmpThis.shiftFontSize(.15); };
329329

330330
/*
331331
let shaderLinkList=this.pxlEnv.pxlGuiDraws.guiWindows[type].shaderList.children;
Binary file not shown.
24.2 KB
Loading
-293 KB
Loading

Source/pxlRooms/CampfireEnvironment/CampfireEnvironment.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as THREE from "../../js/libs/three/three.module.js";
22
import { rabbitDruidVert, rabbitDruidFrag,
33
campfireLogVert, campfireLogFrag,
44
campfireVert, campfireFrag,
5+
grassClusterVert, grassClusterFrag,
56
envGroundVert, envGroundFrag } from "./Shaders.js";
67
import RoomEnvironment from "../../js/pxlNav/RoomClass.js";
78

@@ -436,6 +437,28 @@ export class CampfireEnvironment extends RoomEnvironment{
436437

437438

438439

440+
// -- -- --
441+
442+
443+
let grassClusterUniforms = THREE.UniformsUtils.merge(
444+
[
445+
THREE.UniformsLib[ "lights" ],
446+
{
447+
'noiseTexture' : { type:'t', value: null },
448+
'fogColor' : { type: "c", value: this.fogColor },
449+
}]
450+
)
451+
grassClusterUniforms.noiseTexture.value = this.pxlUtils.loadTexture( this.assetPath+"Noise_UniformWebbing.jpg" );
452+
453+
let grassMat=this.pxlFile.pxlShaderBuilder( grassClusterUniforms, grassClusterVert(), grassClusterFrag() );
454+
grassMat.side = THREE.FrontSide;
455+
grassMat.lights = true;
456+
grassMat.transparent = false;
457+
458+
459+
this.textureList[ "grassClusterA_geo" ]=grassMat;
460+
461+
439462
// -- -- --
440463

441464
this.textureList[ "EnvironmentGround_geo" ]=environmentGroundMat;

0 commit comments

Comments
 (0)