EEVEE-Next: Jittered Soft Shadows #119753

Closed
Miguel Pozo wants to merge 46 commits from pragma37/blender:pull-eevee-jittered-shoft-shadows into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
5 changed files with 8 additions and 20 deletions
Showing only changes of commit 3f858961d9 - Show all commits

View File

@ -74,7 +74,6 @@ void ShadowTileMap::sync_cubeface(const float4x4 &object_mat_,
float far_,
float side_,
float projection_shift,
float3 origin_shift,
eCubeFace face,
float lod_bias_)
{
@ -380,21 +379,15 @@ void ShadowPunctual::end_sync(Light &light, float lod_bias, Sampling &sampling)
tilemaps_.append(tilemap_pool.acquire());
}
tilemaps_[Z_NEG]->sync_cubeface(
obmat_tmp, near, far, side, projection_shift, origin_shift, Z_NEG, lod_bias);
tilemaps_[Z_NEG]->sync_cubeface(obmat_tmp, near, far, side, projection_shift, Z_NEG, lod_bias);
if (tilemaps_needed_ >= 5) {
tilemaps_[X_POS]->sync_cubeface(
obmat_tmp, near, far, side, projection_shift, origin_shift, X_POS, lod_bias);
tilemaps_[X_NEG]->sync_cubeface(
obmat_tmp, near, far, side, projection_shift, origin_shift, X_NEG, lod_bias);
tilemaps_[Y_POS]->sync_cubeface(
obmat_tmp, near, far, side, projection_shift, origin_shift, Y_POS, lod_bias);
tilemaps_[Y_NEG]->sync_cubeface(
obmat_tmp, near, far, side, projection_shift, origin_shift, Y_NEG, lod_bias);
tilemaps_[X_POS]->sync_cubeface(obmat_tmp, near, far, side, projection_shift, X_POS, lod_bias);
tilemaps_[X_NEG]->sync_cubeface(obmat_tmp, near, far, side, projection_shift, X_NEG, lod_bias);
tilemaps_[Y_POS]->sync_cubeface(obmat_tmp, near, far, side, projection_shift, Y_POS, lod_bias);
tilemaps_[Y_NEG]->sync_cubeface(obmat_tmp, near, far, side, projection_shift, Y_NEG, lod_bias);
}
pragma37 marked this conversation as resolved Outdated

This can be removed. And you can use light.object_mat directly as it is junk free now!.

This can be removed. And you can use `light.object_mat` directly as it is junk free now!.
if (tilemaps_needed_ == 6) {
tilemaps_[Z_POS]->sync_cubeface(
obmat_tmp, near, far, side, projection_shift, origin_shift, Z_POS, lod_bias);
tilemaps_[Z_POS]->sync_cubeface(obmat_tmp, near, far, side, projection_shift, Z_POS, lod_bias);
}
light.tilemap_index = tilemap_pool.tilemaps_data.size();

View File

@ -109,7 +109,6 @@ struct ShadowTileMap : public ShadowTileMapData {
float far,
float side,
float projection_shift,
float3 origin_shift,
eCubeFace face,
float lod_bias_);

View File

@ -107,7 +107,6 @@ void shadow_tag_usage_tilemap_punctual(
}
}
/* TODO(fclem): 3D shift for jittered soft shadows. */
lP -= light.shadow_origin_shift;
lP.z -= light.shadow_projection_shift;

View File

@ -300,7 +300,6 @@ ShadowRayPunctual shadow_ray_generate_punctual(LightData light,
float clip_near = intBitsToFloat(light.clip_near);
float clip_side = light.clip_side;
/* TODO(fclem): 3D shift for jittered soft shadows. */
vec3 projection_origin = vec3(0.0, 0.0, -light.shadow_projection_shift);
vec3 direction;
if (is_area_light(light.type)) {

View File

@ -233,8 +233,7 @@ static void test_eevee_shadow_tag_update()
{
ShadowTileMap tilemap(0 * SHADOW_TILEDATA_PER_TILEMAP);
tilemap.sync_cubeface(
float4x4::identity(), 0.01f, 1.0f, 0.01f, 0.0f, float3(0.0f), Z_NEG, 0.0f);
tilemap.sync_cubeface(float4x4::identity(), 0.01f, 1.0f, 0.01f, 0.0f, Z_NEG, 0.0f);
tilemaps_data.append(tilemap);
}
{
@ -1173,8 +1172,7 @@ static void test_eevee_shadow_page_mask()
{
ShadowTileMap tilemap(0);
tilemap.sync_cubeface(
float4x4::identity(), 0.01f, 1.0f, 0.01f, 0.0f, float3(0.0f), Z_NEG, 0.0f);
tilemap.sync_cubeface(float4x4::identity(), 0.01f, 1.0f, 0.01f, 0.0f, Z_NEG, 0.0f);
tilemaps_data.append(tilemap);
}