Skip to content

Commit 773a91f

Browse files
committed
Adjusted Mountain shader & Dirt UVs
OutletEnvironment- _Cracked dirt's uv's were x==y, updated to world space reads _Fixed stretching rock pattern _DoubleSide the plants _Reduce poly count of grassClusters
1 parent 319f4dd commit 773a91f

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed
Binary file not shown.
Loading
Binary file not shown.

docs/js/pxlRooms/OutletEnvironment/OutletEnvironment.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ builBugs(){
397397
grassClusterUniforms.noiseTexture.value = this.pxlUtils.loadTexture( this.assetPath+"Noise_UniformWebbing.jpg" );
398398

399399
let grassMat=this.pxlFile.pxlShaderBuilder( grassClusterUniforms, instPlantsVert(), instPlantsFrag() );
400-
grassMat.side = FrontSide;
400+
grassMat.side = DoubleSide;
401401
grassMat.lights = true;
402402
grassMat.transparent = false;
403403

@@ -520,6 +520,7 @@ builBugs(){
520520

521521
this.materialList[ "grassClusterA_lod0_geo" ] = grassMat;
522522
this.materialList[ "grassClusterA_lod1_geo" ] = grassMat;
523+
this.materialList[ "grassClusterA_lod2_geo" ] = grassCardsMat;
523524

524525
this.materialList[ "swampGrassA_lod0_geo" ] = grassMat;
525526
this.materialList[ "swampGrassA_lod1_geo" ] = grassMat;

docs/js/pxlRooms/OutletEnvironment/Shaders/envGroundShaders.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ export function envGroundFrag( pointLightCount ){
149149
uv.x = ( pos.x + pos.y*.05 + baseCd.r + baseCd.r*0.50);
150150
uv.y = ( pos.z + pos.y*.05 + baseCd.g + baseCd.g*0.65);
151151
152+
// -- -- -- -- -- -- -- -- -- -- -- -- --
153+
// -- Texture Offset by Position atan -- --
154+
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
155+
156+
vec2 atanVec = normalize( vec2( vModelPos.x + vModelPos.y*.5, vModelPos.z + vModelPos.y*.1 ) );
157+
float deg = atan( atanVec.y, atanVec.x );
158+
152159
// -- -- -- -- -- -- -- --
153160
// -- UV & Color Noise -- --
154161
// -- -- -- -- -- -- -- -- -- --
@@ -169,14 +176,6 @@ export function envGroundFrag( pointLightCount ){
169176
float baseDirtNoise = dirtNoise;
170177
171178
172-
// -- -- -- -- -- -- -- -- -- -- -- -- --
173-
// -- Texture Offset by Position atan -- --
174-
// -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
175-
176-
vec2 atanVec = normalize( vec2( vModelPos.x + vModelPos.y*.5, vModelPos.z + vModelPos.y*.1 ) );
177-
float deg = atan( atanVec.y, atanVec.x );
178-
deg = cos(deg*PI*2.0 - pos.x*.02 + pos.z*.02 )*0.050;
179-
180179
// -- -- -- -- -- -- -- -- -- --
181180
// -- World Space Texturing - -- --
182181
// -- -- -- -- -- -- -- -- -- -- -- --
@@ -196,7 +195,7 @@ export function envGroundFrag( pointLightCount ){
196195
vec3 grassCd = texture2D( grassDiffuse, pos.xz*2.0 + uvNoiseOffset ).rgb ;
197196
198197
// Shift the rocky hill texture so it reads it more horizontally
199-
vec2 hillLayerUv = vec2( subUv.x-uv.y*0.15, vModelPos.y*.007 ) ;
198+
vec2 hillLayerUv = vec2( pos.x*0.1885 + pos.z*0.836 + deg*9.17, vModelPos.y*.007 ) ;
200199
vec3 rockyHillCd = texture2D(hillDiffuse,hillLayerUv).rgb ;
201200
202201
// -- -- --

0 commit comments

Comments
 (0)