diff --git a/source/blender/draw/engines/eevee_next/eevee_shadow.cc b/source/blender/draw/engines/eevee_next/eevee_shadow.cc index ac5053c4f13..0b6bb172858 100644 --- a/source/blender/draw/engines/eevee_next/eevee_shadow.cc +++ b/source/blender/draw/engines/eevee_next/eevee_shadow.cc @@ -854,7 +854,7 @@ void ShadowModule::begin_sync() sub.bind_ssbo("surfel_buf", &surfels_buf); sub.bind_ssbo("capture_info_buf", &capture_info_buf); sub.push_constant("directional_level", directional_level); - sub.push_constant("tilemap_projection_ratio", projection_ratio); + sub.push_constant("tilemap_proj_ratio", projection_ratio); sub.bind_resources(inst_.lights); sub.dispatch(&inst_.volume_probes.bake.dispatch_per_surfel_); @@ -869,7 +869,7 @@ void ShadowModule::begin_sync() sub.bind_ssbo("tilemaps_buf", &tilemap_pool.tilemaps_data); sub.bind_ssbo("tiles_buf", &tilemap_pool.tiles_data); sub.bind_texture("depth_tx", &src_depth_tx_); - sub.push_constant("tilemap_projection_ratio", &data_.tilemap_projection_ratio); + sub.push_constant("tilemap_proj_ratio", &data_.tilemap_projection_ratio); sub.bind_resources(inst_.lights); sub.dispatch(&dispatch_depth_scan_size_); } @@ -885,7 +885,7 @@ void ShadowModule::begin_sync() sub.bind_ssbo("tilemaps_buf", &tilemap_pool.tilemaps_data); sub.bind_ssbo("tiles_buf", &tilemap_pool.tiles_data); sub.bind_ssbo("bounds_buf", &manager.bounds_buf.current()); - sub.push_constant("tilemap_projection_ratio", &data_.tilemap_projection_ratio); + sub.push_constant("tilemap_proj_ratio", &data_.tilemap_projection_ratio); sub.push_constant("pixel_world_radius", &pixel_world_radius_); sub.push_constant("fb_resolution", &usage_tag_fb_resolution_); sub.push_constant("fb_lod", &usage_tag_fb_lod_); @@ -1118,7 +1118,7 @@ void ShadowModule::end_sync() sub.shader_set(inst_.shaders.static_shader_get(SHADOW_TILEMAP_TAG_USAGE_VOLUME)); sub.bind_ssbo("tilemaps_buf", &tilemap_pool.tilemaps_data); sub.bind_ssbo("tiles_buf", &tilemap_pool.tiles_data); - sub.push_constant("tilemap_projection_ratio", &data_.tilemap_projection_ratio); + sub.push_constant("tilemap_proj_ratio", &data_.tilemap_projection_ratio); sub.bind_resources(inst_.uniform_data); sub.bind_resources(inst_.hiz_buffer.front); sub.bind_resources(inst_.sampling); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_lib.glsl index 44e9889fbd8..bd9d2b65ce3 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tag_usage_lib.glsl @@ -111,7 +111,7 @@ void shadow_tag_usage_tilemap_punctual( lP += vec3(0.0, 0.0, -light.shadow_projection_shift); float footprint_ratio = shadow_punctual_footprint_ratio( - light, P, drw_view_is_perspective(), dist_to_cam, tilemap_projection_ratio); + light, P, drw_view_is_perspective(), dist_to_cam, tilemap_proj_ratio); if (radius == 0) { int face_id = shadow_punctual_face_index_get(lP); diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_lib.glsl index e2aa1aeb9d5..13d75a20a23 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_tilemap_lib.glsl @@ -127,7 +127,7 @@ float shadow_directional_level_fractional(LightData light, vec3 lP) lod = length(lP.xy) * narrowing / lod_min_half_size; } float clipmap_lod = lod + light.lod_bias; - return clamp(clipmap_lod, light.clipmap_lod_min, light.clipmap_lod_max); + return clamp(clipmap_lod, float(light.clipmap_lod_min), float(light.clipmap_lod_max)); } int shadow_directional_level(LightData light, vec3 lP) diff --git a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_shadow_info.hh b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_shadow_info.hh index 4a05be9563b..d083d2fb84e 100644 --- a/source/blender/draw/engines/eevee_next/shaders/infos/eevee_shadow_info.hh +++ b/source/blender/draw/engines/eevee_next/shaders/infos/eevee_shadow_info.hh @@ -64,7 +64,7 @@ GPU_SHADER_CREATE_INFO(eevee_shadow_tag_usage_opaque) .sampler(0, ImageType::DEPTH_2D, "depth_tx") .storage_buf(5, Qualifier::READ_WRITE, "ShadowTileMapData", "tilemaps_buf[]") .storage_buf(6, Qualifier::READ_WRITE, SHADOW_TILE_DATA_PACKED, "tiles_buf[]") - .push_constant(Type::FLOAT, "tilemap_projection_ratio") + .push_constant(Type::FLOAT, "tilemap_proj_ratio") .additional_info("eevee_shared", "draw_view", "draw_view_culling", "eevee_light_data") .compute_source("eevee_shadow_tag_usage_comp.glsl"); @@ -75,7 +75,7 @@ GPU_SHADER_CREATE_INFO(eevee_shadow_tag_usage_surfels) /* ShadowTileDataPacked is uint. But MSL translation need the real type. */ .storage_buf(7, Qualifier::READ_WRITE, "uint", "tiles_buf[]") .push_constant(Type::INT, "directional_level") - .push_constant(Type::FLOAT, "tilemap_projection_ratio") + .push_constant(Type::FLOAT, "tilemap_proj_ratio") .additional_info("eevee_shared", "draw_view", "draw_view_culling", @@ -96,7 +96,7 @@ GPU_SHADER_CREATE_INFO(eevee_shadow_tag_usage_transparent) .storage_buf(4, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .storage_buf(5, Qualifier::READ_WRITE, "ShadowTileMapData", "tilemaps_buf[]") .storage_buf(6, Qualifier::READ_WRITE, SHADOW_TILE_DATA_PACKED, "tiles_buf[]") - .push_constant(Type::FLOAT, "tilemap_projection_ratio") + .push_constant(Type::FLOAT, "tilemap_proj_ratio") .push_constant(Type::FLOAT, "pixel_world_radius") .push_constant(Type::IVEC2, "fb_resolution") .push_constant(Type::INT, "fb_lod") @@ -117,7 +117,7 @@ GPU_SHADER_CREATE_INFO(eevee_shadow_tag_usage_volume) .local_group_size(VOLUME_GROUP_SIZE, VOLUME_GROUP_SIZE, VOLUME_GROUP_SIZE) .storage_buf(4, Qualifier::READ_WRITE, "ShadowTileMapData", "tilemaps_buf[]") .storage_buf(5, Qualifier::READ_WRITE, SHADOW_TILE_DATA_PACKED, "tiles_buf[]") - .push_constant(Type::FLOAT, "tilemap_projection_ratio") + .push_constant(Type::FLOAT, "tilemap_proj_ratio") .additional_info("eevee_volume_properties_data", "eevee_shared", "draw_view",