Fixed sky reflection rendering when transparent BG
This commit is contained in:
parent
a26e6c8215
commit
c34f18acce
|
@ -4234,17 +4234,14 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
|
|||
|
||||
clear_color = env->bg_color.to_linear();
|
||||
storage->frame.clear_request = false;
|
||||
} else if (env->bg_mode == VS::ENV_BG_SKY || env->bg_mode == VS::ENV_BG_COLOR_SKY) {
|
||||
} else if (env->bg_mode == VS::ENV_BG_SKY) {
|
||||
|
||||
sky = storage->sky_owner.getornull(env->sky);
|
||||
|
||||
if (sky) {
|
||||
env_radiance_tex = sky->radiance;
|
||||
}
|
||||
storage->frame.clear_request = false;
|
||||
if (env->bg_mode == VS::ENV_BG_COLOR_SKY) {
|
||||
|
||||
} else if (env->bg_mode == VS::ENV_BG_COLOR_SKY) {
|
||||
|
||||
clear_color = env->bg_color.to_linear();
|
||||
}
|
||||
storage->frame.clear_request = false;
|
||||
|
||||
} else {
|
||||
storage->frame.clear_request = false;
|
||||
|
@ -4254,7 +4251,19 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
|
|||
glClearBufferfv(GL_COLOR, 0, clear_color.components); // specular
|
||||
}
|
||||
|
||||
if (env && env->bg_mode == VS::ENV_BG_CANVAS) {
|
||||
if (env) {
|
||||
switch (env->bg_mode) {
|
||||
case VS::ENV_BG_COLOR_SKY:
|
||||
|
||||
case VS::ENV_BG_SKY:
|
||||
|
||||
sky = storage->sky_owner.getornull(env->sky);
|
||||
|
||||
if (sky) {
|
||||
env_radiance_tex = sky->radiance;
|
||||
}
|
||||
break;
|
||||
case VS::ENV_BG_CANVAS:
|
||||
//copy canvas to 3d buffer and convert it to linear
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
|
@ -4282,6 +4291,8 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
|
|||
glDepthMask(GL_TRUE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glEnable(GL_CULL_FACE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
state.texscreen_copied = false;
|
||||
|
|
Loading…
Reference in New Issue