Fog update
This commit is contained in:
parent
35b13adf03
commit
5d4e67fdb1
@ -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;
|
||||
}
|
||||
|
||||
@ -128,7 +128,7 @@ void WorldRenderer::drawChunks(Chunks* chunks,
|
||||
void WorldRenderer::draw(const GfxContext& pctx, Camera* camera){
|
||||
EngineSettings& settings = engine->getSettings();
|
||||
skybox->refresh(level->world->daytime,
|
||||
fmax(1.0f, 10.0f/(settings.chunks.loadDistance-2))+fog*2.0f, 4);
|
||||
1.0f+fog*2.0f, 4);
|
||||
|
||||
const Content* content = level->content;
|
||||
const ContentIndices* contentIds = content->indices;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user