mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 05:51:51 +00:00
fix a_distance
This commit is contained in:
parent
9e05f6dbb6
commit
44f7051a94
3 changed files with 7 additions and 5 deletions
|
|
@ -48,8 +48,9 @@ void main() {
|
|||
a_color.rgb = max(a_color.rgb, skyLightColor.rgb*v_light.a) * v_color;
|
||||
a_color.a = u_opacity;
|
||||
|
||||
a_distance = length(u_view * u_model * vec4(pos3d * FOG_POS_SCALE, 0.0));
|
||||
a_fog = calc_fog(a_distance / 256.0);
|
||||
mat4 viewmodel = u_view * u_model;
|
||||
a_distance = length(viewmodel * vec4(pos3d, 0.0));
|
||||
a_fog = calc_fog(length(viewmodel * vec4(pos3d * FOG_POS_SCALE, 0.0)) / 256.0);
|
||||
|
||||
vec4 viewmodelpos = u_view * a_modelpos;
|
||||
a_position = viewmodelpos.xyz;
|
||||
|
|
|
|||
|
|
@ -47,8 +47,9 @@ void main() {
|
|||
vec3 skyLightColor = pick_sky_color(u_skybox);
|
||||
a_skyLight = skyLightColor.rgb*v_light.a;
|
||||
|
||||
a_distance = length(u_view * u_model * vec4(pos3d * FOG_POS_SCALE, 0.0));
|
||||
a_fog = calc_fog(a_distance / 256.0);
|
||||
mat4 viewmodel = u_view * u_model;
|
||||
a_distance = length(viewmodel * vec4(pos3d, 0.0));
|
||||
a_fog = calc_fog(length(viewmodel * vec4(pos3d * FOG_POS_SCALE, 0.0)) / 256.0);
|
||||
|
||||
vec4 viewmodelpos = u_view * a_modelpos;
|
||||
a_position = viewmodelpos.xyz;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue