mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Fog update
This commit is contained in:
parent
35b13adf03
commit
5d4e67fdb1
2 changed files with 3 additions and 3 deletions
|
|
@ -24,7 +24,7 @@ uniform float u_torchlightDistance;
|
|||
|
||||
|
||||
void main(){
|
||||
vec2 pos2d = (u_model * vec4(v_position, 1.0)).xz-u_cameraPos.xz;
|
||||
vec3 pos3d = (u_model * vec4(v_position, 1.0)).xyz-u_cameraPos.xyz;
|
||||
vec4 modelpos = u_model * vec4(v_position, 1.0);
|
||||
vec4 viewmodelpos = u_view * modelpos;
|
||||
vec4 decomp_light = decompress_light(v_light);
|
||||
|
|
@ -41,6 +41,6 @@ void main(){
|
|||
skyLightColor = min(vec3(1.0), skyLightColor*SKY_LIGHT_MUL);
|
||||
|
||||
a_color.rgb = max(a_color.rgb, skyLightColor.rgb*decomp_light.a);
|
||||
a_distance = length(viewmodelpos);
|
||||
a_distance = length(u_view * u_model * vec4(pos3d.x, pos3d.y*0.2, pos3d.z, 0.0));
|
||||
gl_Position = u_proj * viewmodelpos;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue