EEVEE-Next: Jittered Soft Shadows #119753
|
@ -363,6 +363,7 @@ void ShadowPunctual::end_sync(Light &light, float lod_bias, Sampling &sampling)
|
|||
float projection_shift = is_area_light(light.type) ? near : 0.0f;
|
||||
|
||||
float4x4 obmat_tmp = light.object_mat;
|
||||
obmat_tmp = obmat_tmp * math::from_location<float4x4>(origin_shift);
|
||||
|
||||
/* Clear embedded custom data. */
|
||||
obmat_tmp[0][3] = obmat_tmp[1][3] = obmat_tmp[2][3] = 0.0f;
|
||||
|
|
|
@ -108,6 +108,7 @@ 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;
|
||||
|
||||
float footprint_ratio = shadow_punctual_footprint_ratio(
|
||||
|
|
|
@ -548,8 +548,9 @@ ShadowEvalResult shadow_eval(LightData light,
|
|||
/* TODO(fclem): Scale based on depth. */
|
||||
P += Ng * normal_offset;
|
||||
|
||||
vec3 lP = is_directional ? light_world_to_local(light, P) :
|
||||
light_world_to_local(light, P - light._position);
|
||||
vec3 lP = is_directional ?
|
||||
light_world_to_local(light, P) :
|
||||
light_world_to_local(light, P - light._position) - light.shadow_origin_shift;
|
||||
vec3 lNg = light_world_to_local(light, Ng);
|
||||
|
||||
float surface_hit = 0.0;
|
||||
|
|
Loading…
Reference in New Issue