diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-06-13 00:07:05 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-06-13 00:07:05 -0300 |
commit | 95c248e24fb6094160f9c71140402305b57469ab (patch) | |
tree | 3dd08c02d5a46011ceb0bd9b36a41ff370fe1530 /drivers | |
parent | b21d45e4e1d49863a58aa0da42161fbaa6cc3d74 (diff) |
Remove default shadow bias of 0.1 for spot and omni light, fixes #8654
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 8 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.h | 4 | ||||
-rw-r--r-- | drivers/gles3/shaders/scene.glsl | 14 |
3 files changed, 13 insertions, 13 deletions
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 87347b8d95..87a2ca8bb9 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -3840,8 +3840,8 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const state.ubo_data.subsurface_scatter_width = subsurface_scatter_size; - state.ubo_data.shadow_z_offset = 0; - state.ubo_data.shadow_slope_scale = 0; + state.ubo_data.z_offset = 0; + state.ubo_data.z_slope_scale = 0; state.ubo_data.shadow_dual_paraboloid_render_side = 0; state.ubo_data.shadow_dual_paraboloid_render_zfar = 0; @@ -4514,8 +4514,8 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_ glClear(GL_DEPTH_BUFFER_BIT); glDisable(GL_SCISSOR_TEST); - state.ubo_data.shadow_z_offset = bias; - state.ubo_data.shadow_slope_scale = normal_bias; + state.ubo_data.z_offset = bias; + state.ubo_data.z_slope_scale = normal_bias; state.ubo_data.shadow_dual_paraboloid_render_side = dp_direction; state.ubo_data.shadow_dual_paraboloid_render_zfar = zfar; diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index 59b8e3fb35..f9953f83db 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -119,8 +119,8 @@ public: float ambient_energy; float bg_energy; - float shadow_z_offset; - float shadow_slope_scale; + float z_offset; + float z_slope_scale; float shadow_dual_paraboloid_render_zfar; float shadow_dual_paraboloid_render_side; float screen_pixel_size[2]; diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 855b96236a..0f1a7458d7 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -74,8 +74,8 @@ layout(std140) uniform SceneData { //ubo:0 float ambient_energy; float bg_energy; - float shadow_z_offset; - float shadow_z_slope_scale; + float z_offset; + float z_slope_scale; float shadow_dual_paraboloid_render_zfar; float shadow_dual_paraboloid_render_side; @@ -319,7 +319,7 @@ VERTEX_SHADER_CODE //for dual paraboloid shadow mapping, this is the fastest but least correct way, as it curves straight edges - highp vec3 vtx = vertex_interp+normalize(vertex_interp)*shadow_z_offset; + highp vec3 vtx = vertex_interp+normalize(vertex_interp)*z_offset; highp float distance = length(vtx); vtx = normalize(vtx); vtx.xy/=1.0-vtx.z; @@ -332,8 +332,8 @@ VERTEX_SHADER_CODE #else - float z_ofs = shadow_z_offset; - z_ofs += (1.0-abs(normal_interp.z))*shadow_z_slope_scale; + float z_ofs = z_offset; + z_ofs += (1.0-abs(normal_interp.z))*z_slope_scale; vertex_interp.z-=z_ofs; #endif //RENDER_DEPTH_DUAL_PARABOLOID @@ -446,8 +446,8 @@ layout(std140) uniform SceneData { float ambient_energy; float bg_energy; - float shadow_z_offset; - float shadow_z_slope_scale; + float z_offset; + float z_slope_scale; float shadow_dual_paraboloid_render_zfar; float shadow_dual_paraboloid_render_side; |