Skip to content

Commit ddbe9b8

Browse files
committed
Sky horizon vapor modded
1 parent b039e31 commit ddbe9b8

File tree

6 files changed

+37
-34
lines changed

6 files changed

+37
-34
lines changed

Build/pxlNav.min.js

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

Public/index.htm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0">
1919
<meta name='theme-color' content='#000822'>
2020
</head>
21-
21+
2222
<!-- -- -- -- -->
2323

2424
<link type="text/css" rel="stylesheet" href="style/ProcStackStyle.css">

Source/js/pxlNav.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ import { VERBOSE_LEVEL } from './pxlNav/core/Types.js';
4949

5050

5151

52+
53+
5254
const pxlCore = "pxlNav-coreCanvas"; // Name of DIV in Index
5355
var cloud3dTexture = null;
5456

Source/js/pxlNav/cam/Camera.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as THREE from "../../libs/three/three.module.js";
22

3+
34
// TODO : Extend this damn monolith of a chunky boy
45
// Camera, Player Controller, Force Influence / Collision
56
// Keep Jumping when Space is held down upon landing

Source/js/pxlNav/shaders/scene/SkyObject.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ export function skyObjectVert(){
3030
// Sky Fragment Shader
3131
export function skyObjectFrag(){
3232
let ret=shaderHeader();
33-
ret+=`
34-
33+
ret+=`
3534
uniform sampler2D diffuse;
3635
uniform sampler2D envDiffuse;
3736
uniform sampler2D noiseTexture;
@@ -60,9 +59,10 @@ export function skyObjectFrag(){
6059
vec4 Cd=texture2D(diffuse,uv);
6160
float t = time.x*.6;
6261
63-
vec2 nUv = fract( vec2(vUv.x*2.0, vUv.y - t*.01) );
62+
vec2 nUv = ( vec2(vUv.x*0.40, vUv.y - t*.01) );
6463
vec3 noiseCd = texture2D( noiseTexture, nUv ).rgb;
65-
nUv = fract( nUv+noiseCd.rg*(noiseCd.b-.5));
64+
nUv = ( nUv+noiseCd.rg*(noiseCd.b));
65+
//nUv.y *= .5;
6666
noiseCd = texture2D( noiseTexture, nUv ).rgb;
6767
noiseCd.rg = noiseCd.rg*2.0-1.0;
6868
@@ -79,26 +79,26 @@ export function skyObjectFrag(){
7979
float blendStep = .4;
8080
float blend = 0.0;
8181
float uvShift=0.0;
82-
for(int s=0; s<7; ++s){
83-
uvShift = mix(noiseCd.r, noiseCd.g, noiseCd.b)*15.0;
82+
for(int s=0; s<5; ++s){
83+
uvShift = mix(noiseCd.r, noiseCd.g, fract(noiseCd.b+float(s)*193.5247))*15.0;
8484
curUV = baseUV+vec2(0.0,resUV.y*-(dist+uvShift) );
8585
curDepth = texture2D(envDiffuse,curUV).x ;
8686
curDepth = fitDepth( curDepth );
8787
curPerc = step( .3, (1.0-curDepth)*7.0 );
8888
reachDepth += min(1.0,curDepth)*curPerc;
89-
blend += blendStep*curPerc;
89+
blend += blendStep;
9090
dist+=dist*dot(noiseCd.rgb, vec3(0.0,0.0,1.0));
9191
}
92-
reachDepth *= blend*stencil;
92+
reachDepth *= blend*stencil*3.0;
9393
9494
vec3 normPos = normalize(vLocalPos);
9595
normPos.y = 1.0-min(1.0,(normPos.y)*2.0);
9696
normPos.y = normPos.y*normPos.y*normPos.y;
9797
depth = clamp(reachDepth+normPos.y, 0.0, 1.0);
9898
99-
vec3 baseColor = fogColor+(sin(noiseCd.r*PI+t+uv.x)*.008)*max(0.0,1.0-depth);
100-
baseColor = (baseColor);//+Cd.rgb*.2);
101-
Cd.rgb = mix(Cd.rgb, baseColor, depth);
99+
float blender = (sin(noiseCd.r*PI+t+uv.x)*.03)*max(0.0,1.0-depth);
100+
vec3 baseColor = (fogColor+blender);
101+
Cd.rgb = mix(Cd.rgb*1.5, baseColor, depth);
102102
103103
gl_FragColor=Cd;
104104
}`;

0 commit comments

Comments
 (0)