From d4b85ad2704fe9144c36856f00d4c1aeeddf93f4 Mon Sep 17 00:00:00 2001 From: yum Date: Mon, 30 Mar 2026 16:01:43 -0700 Subject: Glitter: hacks for 1 neighbor sampling --- glitter.cginc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/glitter.cginc b/glitter.cginc index ebacffe..e6c5cbf 100644 --- a/glitter.cginc +++ b/glitter.cginc @@ -212,12 +212,16 @@ float D_Kemppinen(float3 h, float alpha, float glint_alpha, float2 uv, float w = roulette * normal(sigma_a, x_a - g_a) * normal(sigma_s, x_s - g_s) / N; - D_filter += w; + // This is hacky nonsense intended to improve the 1-sampling case. Original + // code is commented out below. + D_filter += sqrt(w) * 2; + //D_filter += w; if (w > best_weight) { best_weight = w; best_g_a = g_a; } D_filter += w_lambda * compensation(x_a, sigma_a, res_a); + // This is also hacked in. D_filter += w_lambda * compensation(x_s, sigma_s, res_s); } -- cgit v1.2.3