summaryrefslogtreecommitdiff
path: root/drivers/gles2
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles2')
-rw-r--r--drivers/gles2/rasterizer_scene_gles2.cpp11
-rw-r--r--drivers/gles2/shaders/scene.glsl5
2 files changed, 9 insertions, 7 deletions
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp
index 64fe385889..6eafdb0e1c 100644
--- a/drivers/gles2/rasterizer_scene_gles2.cpp
+++ b/drivers/gles2/rasterizer_scene_gles2.cpp
@@ -605,7 +605,6 @@ bool RasterizerSceneGLES2::reflection_probe_instance_postprocess_step(RID p_inst
size >>= 1;
int mipmaps = 6;
- int mm_level = mipmaps - 1;
storage->shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES2::USE_SOURCE_PANORAMA, false);
storage->shaders.cubemap_filter.bind();
@@ -628,8 +627,6 @@ bool RasterizerSceneGLES2::reflection_probe_instance_postprocess_step(RID p_inst
size >>= 1;
- mm_level--;
-
lod++;
}
@@ -2339,7 +2336,6 @@ void RasterizerSceneGLES2::_render_render_list(RenderList::Element **p_elements,
state.scene_shader.set_uniform(SceneShaderGLES2::TIME, storage->frame.time[0]);
state.scene_shader.set_uniform(SceneShaderGLES2::SCREEN_PIXEL_SIZE, screen_pixel_size);
- state.scene_shader.set_uniform(SceneShaderGLES2::NORMAL_MULT, 1.0); // TODO mirror?
}
if (rebind_light && light) {
@@ -2498,6 +2494,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);
@@ -2515,6 +2512,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;
@@ -2625,6 +2624,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/gles2/shaders/scene.glsl b/drivers/gles2/shaders/scene.glsl
index 4c652cd9e9..bc83b69b49 100644
--- a/drivers/gles2/shaders/scene.glsl
+++ b/drivers/gles2/shaders/scene.glsl
@@ -84,7 +84,7 @@ uniform highp mat4 world_transform;
uniform highp float time;
-uniform float normal_mult;
+
#ifdef RENDER_DEPTH
uniform float light_bias;
@@ -330,11 +330,10 @@ void main() {
#endif
- vec3 normal = normal_attrib * normal_mult;
+ vec3 normal = normal_attrib;
#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP)
vec3 tangent = tangent_attrib.xyz;
- tangent *= normal_mult;
float binormalf = tangent_attrib.a;
vec3 binormal = normalize(cross(normal, tangent) * binormalf);
#endif