Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird divisor when projecting octahedron probe texture to spherical harmonics. #21

Open
Hineven opened this issue Jun 15, 2024 · 1 comment

Comments

@Hineven
Copy link

Hineven commented Jun 15, 2024

float3 radiance = g_ScreenProbes_ProbeBuffer[probe_pos].xyz / g_ScreenProbesConstants.probe_size;

The line of code above weights the number of hemispherical samples by 1/probe_size when computing SH coefficients for later shading, however the number of samples is probe_size*probe_size. The normalization seems incorrect however if i change the weight to 1/(probe_size*probe_size) the scene seems to be too dark compared to the ray-traced reference.

@Hineven
Copy link
Author

Hineven commented Jun 17, 2024

Maybe an integral area multiplier (4 x PI) is also missing? And by conicidence 4 x PI (12+) and 1/probe_size (1/8) canceled out making the final shading result about 50% darker than the PT reference. Tone mapping further mitigated the difference.

Hineven added a commit to Hineven/Capsaicin that referenced this issue Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant