12#include "gpu_shader_codegen_lib.glsl"
19 ClosureUndetermined cl,
25 constexpr float rng_bias = 0.08f;
29 random_point_on_cylinder.
x = 1.0f - random_point_on_cylinder.
x * (1.0f - rng_bias);
36 case CLOSURE_BSDF_MICROFACET_GGX_REFLECTION_ID:
60 case CLOSURE_BSDF_MICROFACET_GGX_REFLECTION_ID: {
63 square(to_closure_reflection(cl).roughness),
70 square(to_closure_refraction(cl).roughness),
71 to_closure_refraction(cl).ior,
79 square(to_closure_thin_refraction(cl).roughness),
118 constexpr uint tile_size = uint(RAYTRACE_GROUP_SIZE);
120 int2 texel =
int2(local_id.xy + tile_coord * tile_size);
122 int2 texel_fullres = texel * uni.raytrace_buf.trace_pixel_scale +
123 uni.raytrace_buf.trace_pixel_offset;
126 ClosureUndetermined closure = reader.read_bin(texel_fullres, srt.closure_index);
148 float inv_pdf = (samp.
pdf == 0.0f) ? 0.0f :
max(6e-8f, 1.0f / samp.
pdf);
BsdfSample bxdf_translucent_sample(float3 rand, Thickness thickness)
BsdfSample bxdf_diffuse_sample(const float3 rand_cylinder)
BsdfSample bxdf_ggx_sample_refraction(float3 rand, float3 Vt, float alpha, float ior, Thickness thickness, const bool do_clamp)
void bxdf_ggx_context_amend_transmission(ClosureUndetermined &cl, float3 &V, Thickness thickness)
BsdfSample bxdf_ggx_sample_reflection(float3 rand, float3 Vt, float alpha, bool do_clamp)
#define UTIL_BLUE_NOISE_LAYER
PipelineCompute eevee_ray_generate(eevee::raytracing::generate_rays)
float3 sample_cylinder(float2 rand)
#define assert(assertion)
#define storage(slot, qualifiers)
#define image(slot, qualifiers, format)
#define specialization_constant(default_value)
#define local_invocation_id
ImageBase< float, 2 > image2D
IMG_TEMPLATE void imageStore(T &, IntCoord, DataVec)
TEX_TEMPLATE SizeVec textureSize(T, int) RET
float3x3 from_up_axis(float3 up)
uint2 unpackUvec2x16(uint a)
@ CLOSURE_BSDF_MICROFACET_GGX_REFRACTION_ID
@ CLOSURE_BSDF_DIFFUSE_ID
@ CLOSURE_BSSRDF_BURLEY_ID
@ CLOSURE_BSDF_THIN_GLASS_TRANSMISSION_ID
@ CLOSURE_BSDF_TRANSLUCENT_ID
void generate_rays(RayGenerate &srt, const Uniform &uni, const Sampling &sampling, const UtilityTexture &util_tx, const draw::View &views, const gbuffer::Reader &reader, const uint3 group_id, const uint3 local_id)
BsdfSample ray_generate_direction(float2 noise, ClosureUndetermined cl, float3 V, Thickness thickness)
float3 point_screen_to_world(float3 ssP) const
float3 world_incident_vector(float3 P) const
const uint(& tiles_coord_buf)[]
CCL_NAMESPACE_BEGIN struct Window V