7#include "gpu_shader_codegen_lib.glsl"
11#define CLOSURE_DEFAULT 0.0f
22 this->chosen_weight = 0.0f;
23 this->total_weight = 0.0f;
27 void add(
T candidate,
float candidate_weight)
29 if (candidate_weight < 1e-5f) {
35 bool chosen = (
rand <
x);
69 return CLOSURE_BSDF_MICROFACET_GGX_REFLECTION_ID;
92 reservoir.
add(candidate, candidate.weight());
void closure_select(Reservoir< ClosureUndetermined > &reservoir, ClosureUndetermined candidate)
ClosureType closure_type_get(ClosureDiffuse)
@ CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID
@ CLOSURE_BSDF_DIFFUSE_ID
@ CLOSURE_BSSRDF_BURLEY_ID
@ CLOSURE_BSDF_THIN_GLASS_TRANSMISSION_ID
@ CLOSURE_BSDF_TRANSLUCENT_ID
float get_final_weight() const
void add(T candidate, float candidate_weight)