| 937 | } |
| 938 | |
| 939 | static void GenerateSGInnerProductIrradianceTable(float sharpness, const wchar* filePath) |
| 940 | { |
| 941 | std::string output; |
| 942 | |
| 943 | SG sgLight; |
| 944 | sgLight.Amplitude = 1.0f; |
| 945 | sgLight.Axis = Float3(0.0f, 0.0f, 1.0f); |
| 946 | sgLight.Sharpness = sharpness; |
| 947 | |
| 948 | const uint64 NumPoints = 50; |
| 949 | for(uint64 pointIdx = 0; pointIdx < NumPoints; ++pointIdx) |
| 950 | { |
| 951 | float theta = Pi * pointIdx / (NumPoints - 1.0f); |
| 952 | Float3 normal = Float3(std::sin(theta), 0.0f, std::cos(theta)); |
| 953 | |
| 954 | SG cosineLobe = CosineLobeSG(normal); |
| 955 | float irradiance = Max(SGInnerProduct(sgLight, cosineLobe).x, 0.0f); |
| 956 | |
| 957 | output += MakeAnsiString("%f,%f\n", theta, irradiance); |
| 958 | } |
| 959 | |
| 960 | WriteStringAsFile(filePath, output); |
| 961 | } |
| 962 | |
| 963 | static void GenerateSGFittedIrradianceTable(float sharpness, const wchar* filePath) |
| 964 | { |
nothing calls this directly
no test coverage detected