diff --git a/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh b/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh index 0155da1035b..9aa03e394e1 100644 --- a/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh +++ b/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh @@ -1309,12 +1309,11 @@ struct ShadowTileMapData { int clip_data_index; /** Light type this tilemap is from. */ eLightType light_type; - /** True if the tilemap is part of area light shadow and is one of the side projections. */ - bool32_t is_area_side; /** Entire tilemap (all tiles) needs to be tagged as dirty. */ bool32_t is_dirty; float _pad1; + float _pad2; /** Near and far clip distances for punctual. */ float clip_near; float clip_far; @@ -1332,9 +1331,7 @@ struct ShadowRenderView { /** * Is either: * - positive radial distance for point lights. - * - negative distance to light plane (divided by sqrt3) for area lights side projections. * - zero if disabled. - * Use sign to determine with case we are in. */ float clip_distance_inv; /** Viewport to submit the geometry of this tile-map view to. */ diff --git a/source/blender/draw/engines/eevee_next/eevee_shadow.cc b/source/blender/draw/engines/eevee_next/eevee_shadow.cc index d467aa25a8e..b29abcc4bd2 100644 --- a/source/blender/draw/engines/eevee_next/eevee_shadow.cc +++ b/source/blender/draw/engines/eevee_next/eevee_shadow.cc @@ -36,7 +36,6 @@ void ShadowTileMap::sync_orthographic(const float4x4 &object_mat_, projection_type = projection_type_; level = clipmap_level; light_type = eLightType::LIGHT_SUN; - is_area_side = false; grid_shift = origin_offset - grid_offset; grid_offset = origin_offset; @@ -74,7 +73,6 @@ void ShadowTileMap::sync_cubeface( cubeface = face; grid_offset = int2(0); light_type = light_type_; - is_area_side = is_area_light(light_type) && (face != eCubeFace::Z_NEG); if ((clip_near != near_) || (clip_far != far_)) { set_dirty(); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_finalize_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_finalize_comp.glsl index c1698ae2a9b..87d9e94b324 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_finalize_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_finalize_comp.glsl @@ -138,11 +138,7 @@ void main() render_view_buf[view_index].is_directional = !is_cubemap; render_view_buf[view_index].clip_near = clip_near; /* Clipping setup. */ - if (tilemap_data.is_area_side) { - /* Negative for tagging this case. See shadow_clip_vector_get for explanation. */ - render_view_buf[view_index].clip_distance_inv = -1.0; - } - else if (is_point_light(tilemap_data.light_type)) { + if (is_point_light(tilemap_data.light_type)) { /* Clip as a sphere around the clip_near cube. */ render_view_buf[view_index].clip_distance_inv = M_SQRT1_3 / tilemap_data.clip_near; } diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_lib.glsl index a131e81a5e1..e0deffe2ada 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_surf_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_surf_lib.glsl @@ -179,13 +179,7 @@ vec3 shadow_clip_vector_get(vec3 view_position, float clip_distance_inv) /* No clipping. */ return vec3(2.0); } - - if (clip_distance_inv < 0.0) { - /* Area light side projections. Clip using the up axis (which maps to light -Z). */ - /* NOTE: clip_distance_inv should already be scaled by M_SQRT3. */ - return vec3(view_position.y * clip_distance_inv); - } - /* Sphere light case. */ + /* Punctual shadow case. */ return view_position * clip_distance_inv; } #endif