Ensure environment radiance is not used on refprobe interiors, fixes #17868

This commit is contained in:
Juan Linietsky 2018-11-16 11:45:50 -03:00
parent 5d00407388
commit e77afb8507
2 changed files with 11 additions and 0 deletions

View file

@ -2497,6 +2497,7 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
Environment *env = NULL; Environment *env = NULL;
int viewport_width, viewport_height; int viewport_width, viewport_height;
bool probe_interior = false;
if (p_reflection_probe.is_valid()) { if (p_reflection_probe.is_valid()) {
ReflectionProbeInstance *probe = reflection_probe_instance_owner.getornull(p_reflection_probe); ReflectionProbeInstance *probe = reflection_probe_instance_owner.getornull(p_reflection_probe);
@ -2514,6 +2515,8 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
viewport_width = probe->probe_ptr->resolution; viewport_width = probe->probe_ptr->resolution;
viewport_height = probe->probe_ptr->resolution; viewport_height = probe->probe_ptr->resolution;
probe_interior = probe->probe_ptr->interior;
} else { } else {
state.render_no_shadows = false; state.render_no_shadows = false;
current_fb = storage->frame.current_rt->fbo; current_fb = storage->frame.current_rt->fbo;
@ -2624,6 +2627,10 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
} }
} }
if (probe_interior) {
env_radiance_tex = 0; //do not use radiance texture on interiors
}
// render opaque things first // render opaque things first
render_list.sort_by_key(false); render_list.sort_by_key(false);
_render_render_list(render_list.elements, render_list.element_count, p_cam_transform, p_cam_projection, p_shadow_atlas, env, env_radiance_tex, 0.0, 0.0, false, false, false); _render_render_list(render_list.elements, render_list.element_count, p_cam_transform, p_cam_projection, p_shadow_atlas, env, env_radiance_tex, 0.0, 0.0, false, false, false);

View file

@ -4341,6 +4341,10 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
} }
} }
if (probe && probe->probe_ptr->interior) {
env_radiance_tex = 0; //for rendering probe interiors, radiance must not be used.
}
state.texscreen_copied = false; state.texscreen_copied = false;
glBlendEquation(GL_FUNC_ADD); glBlendEquation(GL_FUNC_ADD);