53 if (attenuation < 1e-30f) {
61 float visibility =
shadow * attenuation;
66template<
bool is_transmission>
struct EvalCtx {
88 bool is_translucent_with_thickness = is_transmission &&
89 (
stack.cl[0].type == LIGHT_TRANSLUCENT_WITH_THICKNESS);
102 is_translucent_with_thickness,
120 for (uint i = 0u; i < 3; i++) [[
unroll]] {
121 if constexpr (is_transmission) {
145template struct EvalCtx<true>;
146template struct EvalCtx<false>;
#define LIGHT_ATTENUATION_THRESHOLD
float light_attenuation_surface(LightData light, const bool is_directional, LightVector lv)
#define compilation_constant
SamplerBase< float, 2, false, true > sampler2DArray
void eval_single_closure(sampler2DArray util_tx, LightData light, LightVector lv, LightShape shape, ClosureLight &cl, float attenuation, float shadow)
float power_get(LightData light, LightingType type)
void foreach_visible(const LightRenderData &srt, float2 pixel, float linear_view_z, CallbackT &cb, ResourceT &res)
EvalCtx< true > init_from_reflect_ctx(EvalCtx< false > ctx)
bool light_linking_affects_receiver(uint2 light_set_membership, uchar receiver_light_set)
float evaluate(sampler2DArray util_tx, LightData light, LightShape shape, LightVector lv, LTCData ltc_data)
float shadow_eval(ShadowRenderData &srd, LightData light, const bool is_directional, const bool is_transmission, bool is_translucent_with_thickness, float2 frag_co, Thickness thickness, float3 P, float3 Ng, float3 N, float terminator_normal_offset, float terminator_geometry_offset, float soft_shadow_scale, int ray_count, int ray_step_count)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
packed_float3 light_shadowed
packed_float3 light_unshadowed
static LightShape get(LightData light, LightVector lv)
static LightVector get(LightData light, const bool is_directional, float3 P)
sampler2DArray utility_tx
static LTCData unpack_from(ClosureLight cl)
int light_closure_eval_count_reflect
int light_closure_count_transmit
int light_closure_count_reflect
int light_closure_eval_count_transmit
LightEvalConstants constants
UtilityTexture utility_tx
ShadowRenderData shadow_data
LightRenderData light_data
void eval_transmission(light::EvalCtx< true > &ctx, float vPz)
void eval_reflection(light::EvalCtx< false > &ctx, float vPz)
void eval_local(LightEvalData &srt, uint, LightData light)
ClosureStack< is_transmission > stack
void light_eval_single(LightEvalData &srt, LightData light, const bool is_directional)
float terminator_normal_offset
float terminator_geometry_offset
void eval_directional(LightEvalData &srt, uint, LightData light)