diff --git a/assets/environments/debug/debug.png b/assets/environments/debug/debug.png index b7ea22b0a6..c8bfb7c934 100644 Binary files a/assets/environments/debug/debug.png and b/assets/environments/debug/debug.png differ diff --git a/third_party/environments/URL.txt b/third_party/environments/URL.txt index 05788390f5..99e51129e1 100644 --- a/third_party/environments/URL.txt +++ b/third_party/environments/URL.txt @@ -1 +1,2 @@ https://hdrihaven.com/ +https://mapswire.com/world/physical-maps/ diff --git a/third_party/environments/earth.png b/third_party/environments/earth.png new file mode 100644 index 0000000000..3bc409da38 Binary files /dev/null and b/third_party/environments/earth.png differ diff --git a/tools/cmgen/src/CubemapUtils.cpp b/tools/cmgen/src/CubemapUtils.cpp index 11a4c2b496..650936af99 100644 --- a/tools/cmgen/src/CubemapUtils.cpp +++ b/tools/cmgen/src/CubemapUtils.cpp @@ -51,14 +51,14 @@ void CubemapUtils::equirectangularToCubemap(Cubemap& dst, const Image& src) { [&](EmptyState&, size_t y, Cubemap::Face f, Cubemap::Texel* data, size_t dim) { for (size_t x=0 ; x\n\n" " --extract-blur=roughness\n" " Blurs the cubemap before saving the faces using the roughness blur\n\n" - " --mirror\n" - " Mirrors generated cubemaps for reflections\n\n" + " --no-mirror\n" + " Skip mirroring of generated cubemaps (for assets with mirroring already backed in)\n\n" " --ibl-samples=numSamples\n" " Number of samples to use for IBL integrations (default 1024)\n\n" "\n" @@ -211,7 +211,7 @@ static int handleCommandLineArgments(int argc, char* argv[]) { { "ibl-dfg-multiscatter", no_argument, nullptr, 'u' }, { "ibl-samples", required_argument, nullptr, 'k' }, { "deploy", required_argument, nullptr, 'x' }, - { "mirror", no_argument, nullptr, 'm' }, + { "no-mirror", no_argument, nullptr, 'm' }, { "debug", no_argument, nullptr, 'd' }, { nullptr, 0, 0, 0 } // termination of the option list }; @@ -449,7 +449,6 @@ int main(int argc, char* argv[]) { Image temp; Cubemap cml = CubemapUtils::create(temp, dim, isHorizontal); CubemapUtils::copyImage(temp, inputImage); - cml.makeSeamless(); images.push_back(std::move(temp)); levels.push_back(std::move(cml)); } else if (width == 2 * height) { @@ -461,7 +460,6 @@ int main(int argc, char* argv[]) { Image temp; Cubemap cml = CubemapUtils::create(temp, dim); CubemapUtils::equirectangularToCubemap(cml, inputImage); - cml.makeSeamless(); images.push_back(std::move(temp)); levels.push_back(std::move(cml)); } else { @@ -492,36 +490,33 @@ int main(int argc, char* argv[]) { CubemapUtils::generateUVGrid(cml, 1); } - cml.makeSeamless(); images.push_back(std::move(temp)); levels.push_back(std::move(cml)); } - // Now generate all the mipmap levels - generateMipmaps(levels, images); - + // we mirror by default -- the mirror option in fact un-mirrors. + g_mirror = !g_mirror; if (g_mirror) { if (!g_quiet) { std::cout << "Mirroring..." << std::endl; } - - std::vector mirrorLevels; - std::vector mirrorImages; - - for (auto& level : levels) { - Image temp; - Cubemap cml = CubemapUtils::create(temp, level.getDimensions()); - CubemapUtils::mirrorCubemap(cml, level); - cml.makeSeamless(); - - mirrorImages.push_back(std::move(temp)); - mirrorLevels.push_back(std::move(cml)); + Image temp; + Cubemap cml = CubemapUtils::create(temp, levels[0].getDimensions()); + CubemapUtils::mirrorCubemap(cml, levels[0]); + std::swap(levels[0], cml); + std::swap(images[0], temp); + } else { + if (!g_quiet) { + std::cout << "Skipped mirroring." << std::endl; } - - std::swap(levels, mirrorLevels); - std::swap(images, mirrorImages); } + // make the cubemap seamless + levels[0].makeSeamless(); + + // Now generate all the mipmap levels + generateMipmaps(levels, images); + if (g_sh_compute) { if (!g_quiet) { std::cout << "Spherical harmonics..." << std::endl;