This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paper: ZH3: Quadratic Zonal Harmonics, i3D 2024. https://torust.me/ZH3.pdf | |
// Code based on paper and demo https://www.shadertoy.com/view/Xfj3RK | |
#include "UnityCG.cginc" | |
// L0 radiance = L0 irradiance * PI / Y_0 / AHat_0 | |
// PI / (sqrt(1 / PI) / 2) / PI = 2 * sqrt(PI) | |
const static float L0IrradianceToRadiance = 2 * sqrt(UNITY_PI); | |
// L1 radiance = L1 irradiance * PI / Y_1 / AHat_1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
// Author: pema99 | |
// This file contains functions that simulate Quad and Wave Intrinsics without access to either. | |
// For more information on those, see: https://github.com/Microsoft/DirectXShaderCompiler/wiki/Wave-Intrinsics | |
// To use the functions, you must call SETUP_QUAD_INTRINSICS(pos) at the start of your fragment shader, | |
// where 'pos' is the pixel position, ie. the fragment input variable with the SV_Position semantic. | |
// Note that some functions will require SM 5.0, ie. #pragma target 5.0. |