@@ -40,7 +40,7 @@ const vec3 RANDOM_VECTORS[6] = vec3[6]
40
40
41
41
vec3 getSunDirection() {
42
42
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)));
44
44
45
45
}
46
46
@@ -190,8 +190,8 @@ vec4 march(vec3 pos, vec3 dir, int depth) {
190
190
vec3 L = vec3 (0.0 );// getSkyColor();
191
191
int count= 0 ;
192
192
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 )));
195
195
for (int i= 0 ;i< depth;i++ ) {
196
196
p += dir;
197
197
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) {
217
217
}
218
218
float powshug = 1.0 - exp (- ldt* t* ss* 2.0 );
219
219
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;
222
222
}
223
223
L/= L+ 1.0 ;
224
224
// L = sqrt(L);
0 commit comments