Skip to content

Commit 7b0a716

Browse files
committed
temporary storage
1 parent 7c3ee40 commit 7b0a716

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

assets/shaders/sky.frag

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const vec3 RANDOM_VECTORS[6] = vec3[6]
4040

4141
vec3 getSunDirection() {
4242
return vec3(0.0, 1.0, 0.0);
43-
return normalize(vec3(0.0, cos(time*0.01+1.2), -sin(time*0.01+1.2)));
43+
//return normalize(vec3(0.0, cos(time*0.01+1.2), -sin(time*0.01+1.2)));
4444

4545
}
4646

@@ -190,8 +190,8 @@ vec4 march(vec3 pos, vec3 dir, int depth) {
190190
vec3 L = vec3(0.0);//getSkyColor();
191191
int count=0;
192192
p+=dir*hash(p);
193-
float phase = numericalMieFit(dot(normalize(-ldir), normalize(dir)));
194-
//phase = max(HG(normalize(ldir), normalize(dir), (0.8)),HG(normalize(ldir), normalize(dir), (-0.3)));
193+
//float phase = numericalMieFit(dot(normalize(-ldir), normalize(dir)));
194+
float phase = max(HG(normalize(ldir), normalize(dir), (0.8)),HG(normalize(ldir), normalize(dir), (-0.3)));
195195
for (int i=0;i<depth;i++) {
196196
p += dir;
197197
float height_fraction = GetHeightFractionForPoint(p, vec2(float(sky_b_radius), float(sky_t_radius)));
@@ -217,8 +217,8 @@ vec4 march(vec3 pos, vec3 dir, int depth) {
217217
}
218218
float powshug = 1.0-exp(-ldt*t*ss*2.0);
219219
powshug = mix(1.0f, powshug, clamp((-dot(normalize(ldir), normalize(dir)) * 0.5f) + 0.5f, 0.0, 1.0));
220-
vec3 ambient = getSkyColor()*mix(0.5, 1.0, height_fraction);
221-
L += (getSunColor()*lT*powshug*2.0*phase)*(1.0-dt)*T*ss;
220+
vec3 ambient = 0.5*getSkyColor()*mix(0.5, 1.0, height_fraction);
221+
L += (ambient+getSunColor()*lT*powshug*2.0*phase)*(1.0-dt)*T*ss;
222222
}
223223
L/=L+1.0;
224224
//L = sqrt(L);

0 commit comments

Comments
 (0)