| 961 | } |
| 962 | |
| 963 | static void GenerateSGFittedIrradianceTable(float sharpness, const wchar* filePath) |
| 964 | { |
| 965 | std::string output; |
| 966 | |
| 967 | SG sgLight; |
| 968 | sgLight.Amplitude = 1.0f; |
| 969 | sgLight.Axis = Float3(0.0f, 0.0f, 1.0f); |
| 970 | sgLight.Sharpness = sharpness; |
| 971 | |
| 972 | const uint64 NumPoints = 50; |
| 973 | for(uint64 pointIdx = 0; pointIdx < NumPoints; ++pointIdx) |
| 974 | { |
| 975 | float theta = Pi * pointIdx / (NumPoints - 1.0f); |
| 976 | Float3 normal = Float3(std::sin(theta), 0.0f, std::cos(theta)); |
| 977 | |
| 978 | float irradiance = SGIrradianceFitted(sgLight, normal).x; |
| 979 | |
| 980 | output += MakeAnsiString("%f,%f\n", theta, irradiance); |
| 981 | } |
| 982 | |
| 983 | WriteStringAsFile(filePath, output); |
| 984 | } |
| 985 | |
| 986 | int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) |
| 987 | { |
nothing calls this directly
no test coverage detected