diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-11-16 11:45:50 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-11-16 11:46:21 -0300 |
commit | e77afb85072a7bea10075221b9a24abd442e1318 (patch) | |
tree | 8581c3a68be2b3145fa1b175cdbe7cc46d3b8f32 | |
parent | 5d00407388362b257e35fe9df96a5b790533165e (diff) |
Ensure environment radiance is not used on refprobe interiors, fixes #17868
-rw-r--r-- | drivers/gles2/rasterizer_scene_gles2.cpp | 7 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index 2c2dea3535..0c0bf56793 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -2497,6 +2497,7 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const Environment *env = NULL; int viewport_width, viewport_height; + bool probe_interior = false; if (p_reflection_probe.is_valid()) { 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_height = probe->probe_ptr->resolution; + probe_interior = probe->probe_ptr->interior; + } else { state.render_no_shadows = false; 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_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); diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 93a7b3e7a6..0951b8f798 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -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; glBlendEquation(GL_FUNC_ADD); |