Use width instead of heigh

This commit is contained in:
Romain Guy
2023-05-01 13:53:25 -07:00
parent cf1bbf63fc
commit 88be599c2e

View File

@@ -1022,7 +1022,7 @@ void CubemapIBL::DFG(JobSystem& js, Image& dst, bool multiscatter, bool cloth) {
// here we're using ^2, but other mappings are possible.
// ==> coord = sqrt(linear_roughness)
const float linear_roughness = coord * coord;
for (size_t x = 0; x < height; x++, data++) {
for (size_t x = 0; x < width; x++, data++) {
// const float NoV = float(x) / (width-1);
const float NoV = saturate((x + 0.5f) / width);
float3 r = { dfvFunction(NoV, linear_roughness, 1024), 0 };