45 srd.uniforms, srd.views,
light, is_directional,
P);
51 P_offset -=
Ng * normal_offset;
56 float occluder_delta = srd.shadow_sample(is_directional,
light, P_offset);
57 if (occluder_delta > 0.0f) {
58 float hit_distance =
abs(occluder_delta);
61 hit_distance += (normal_offset + 1.0f) * texel_radius;
125 constexpr float bias = 2.4e-7f;
126 const float depth =
texelFetch(
hiz.hiz_tx, texel, 0).r - bias;
135 uchar data_layer = uni.pipeline_buf.gbuffer_additional_data_layer_id;
138 if (gbuffer_thickness.
value() == 0.0f) {
147 .gbuffer_thickness = gbuffer_thickness,
148 .thickness_accum = 0.0f,
149 .weight_accum = 0.0f,
163 if (shadow_thickness < gbuffer_thickness.
value()) {
static Thickness from(float value, ThicknessMode mode)
ThicknessMode mode() const
float light_attenuation_facing(LightData light, float3 L, float distance_to_light, float3 Ng, const bool is_transmission)
#define LIGHT_ATTENUATION_THRESHOLD
float light_attenuation_surface(LightData light, const bool is_directional, LightVector lv)
#define image(slot, qualifiers, format)
#define early_fragment_tests
float dot(VecOp< float, D >, VecOp< float, D >) RET
IMG_TEMPLATE DataVec imageLoad(const T &, IntCoord) RET
ImageBase< float, 2, true > image2DArray
IMG_TEMPLATE void imageStore(T &, IntCoord, DataVec)
SamplerBase< uint, 2, false, true > usampler2DArray
TEX_TEMPLATE DataVec texelFetch(T, IntCoord, int) RET
void fullscreen_vertex(int vertex_id, float4 &out_position)
void foreach_visible(const LightRenderData &srt, float2 pixel, float linear_view_z, CallbackT &cb, ResourceT &res)
PipelineGraphic deferred_thickness_amend(amend_vert, amend_frag, eevee::ShadowRenderConstants{.shadow_random=true})
void amend_vert(const int vert_id, VertOut &v_out, float4 &out_position)
float3 shadow_pcf_offset(float3 L, float3 Ng, float2 random)
void amend_frag(ThicknessAmend &srt, ShadowRenderData &srd, const draw::View &views, const LightRenderData &lrd, const Uniform &uni, const HiZ &hiz, const VertOut &v_out, const float4 frag_co)
float shadow_normal_offset(float3 Ng, float3 L, float texel_radius)
float shadow_texel_radius_at_position(const Uniform &uni, const draw::View &views, LightData light, const bool is_directional, float3 P)
float thickness_pack(Thickness thickness)
Thickness thickness_unpack(float thickness_packed)
float3 normal_unpack(float2 N_packed)
static LightVector get(LightData light, const bool is_directional, float3 P)
float3 point_screen_to_world(float3 ssP) const
float rng_1D_get(const eSamplingDimension dim) const
usampler2DArray gbuf_header_tx
image2DArray gbuf_normal_img
Thickness gbuffer_thickness
void eval_local(ShadowRenderData &srd, uint, LightData light)
void eval(ShadowRenderData &srd, LightData light, const bool is_directional)
void eval_directional(ShadowRenderData &srd, uint, LightData light)