world-wide commit to ruin everything
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 257 KiB After Width: | Height: | Size: 12 KiB |
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 342 B After Width: | Height: | Size: 793 B |
+4
-3
@@ -11,10 +11,11 @@ uniform float u_fogFactor;
|
||||
|
||||
void main(){
|
||||
vec4 tex_color = texture(u_texture0, a_texCoord);
|
||||
//if (tex_color.a < 0.5)
|
||||
// discard;
|
||||
float depth = (a_distance/256.0)*(a_distance/256.0)*256.0/6;
|
||||
float depth = (a_distance/256.0);
|
||||
float alpha = a_color.a * tex_color.a;
|
||||
// anyway it's any alpha-test alternative required
|
||||
if (alpha < 0.1f)
|
||||
discard;
|
||||
f_color = mix(a_color * tex_color, vec4(u_fogColor,1.0), min(1.0, depth*u_fogFactor));
|
||||
f_color.a = alpha;
|
||||
}
|
||||
|
||||
+11
-4
@@ -15,12 +15,19 @@ uniform vec3 u_skyLightColor;
|
||||
uniform vec3 u_cameraPos;
|
||||
uniform float u_gamma;
|
||||
|
||||
uniform vec3 u_torchlightColor;
|
||||
uniform float u_torchlightDistance;
|
||||
|
||||
void main(){
|
||||
vec2 pos2d = (u_model * vec4(v_position, 1.0)).xz-u_cameraPos.xz;
|
||||
vec4 viewmodelpos = u_view * u_model * vec4(v_position+vec3(0,pow(length(pos2d)*0.0, 3.0),0), 1.0);
|
||||
a_color = vec4(pow(v_light.rgb, vec3(u_gamma)),1.0f);
|
||||
vec4 modelpos = u_model * vec4(v_position+vec3(0,pow(length(pos2d)*0.0, 3.0),0), 1.0);
|
||||
vec4 viewmodelpos = u_view * modelpos;
|
||||
vec3 light = v_light.rgb;
|
||||
float torchlight = max(0.0, 1.0-distance(u_cameraPos, modelpos.xyz)/u_torchlightDistance);
|
||||
light += torchlight * u_torchlightColor;
|
||||
a_color = vec4(pow(light, vec3(u_gamma)),1.0f);
|
||||
a_texCoord = v_texCoord;
|
||||
a_color.rgb += u_skyLightColor * v_light.a*0.5;
|
||||
a_distance = length(viewmodelpos);
|
||||
a_color.rgb += u_skyLightColor * v_light.a;
|
||||
a_distance = pow(length(viewmodelpos), 1.5);
|
||||
gl_Position = u_proj * viewmodelpos;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 257 KiB After Width: | Height: | Size: 257 KiB |
+1
-1
@@ -12,5 +12,5 @@ uniform mat4 u_projview;
|
||||
void main(){
|
||||
a_textureCoord = v_textureCoord;
|
||||
a_color = v_color;
|
||||
gl_Position = u_projview * vec4(v_position, 0.0, 1.0);
|
||||
gl_Position = u_projview * vec4(v_position, 0.5, 1.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user