提交 698e2033 编写于 作者: M Matt Pharr

Fix bug in f94d39f8.

Fixes #368.
上级 f94d39f8
......@@ -2247,6 +2247,7 @@ int denoise_optix(std::vector<std::string> args) {
CUDA_CHECK(cudaFree(nullptr));
int nLayers = 3;
bool oldNormalNaming = false;
ImageChannelDesc desc[3] = {
image.GetChannelDesc({"R", "G", "B"}),
image.GetChannelDesc({"Albedo.R", "Albedo.G", "Albedo.B"}),
......@@ -2264,7 +2265,9 @@ int denoise_optix(std::vector<std::string> args) {
if (!desc[2]) {
// Try the old naming scheme
desc[2] = image.GetChannelDesc({"Nsx", "Nsy", "Nsz"});
if (!desc[2]) {
if (desc[2])
oldNormalNaming = true;
else {
Warning("%s: image doesn't have Ns.X, Ns.Y, Ns.Z channels. "
"Denoising quality may suffer.",
inFilename);
......@@ -2302,7 +2305,10 @@ int denoise_optix(std::vector<std::string> args) {
Normal3f *normalGPU = nullptr;
if (nLayers == 3) {
albedoGPU = (RGB *)copyChannelsToGPU({"Albedo.R", "Albedo.G", "Albedo.B"});
normalGPU = (Normal3f *)copyChannelsToGPU({"Nsx", "Nsy", "Nsz"}, true);
if (oldNormalNaming)
normalGPU = (Normal3f *)copyChannelsToGPU({"Nsx", "Nsy", "Nsz"}, true);
else
normalGPU = (Normal3f *)copyChannelsToGPU({"Ns.X", "Ns.Y", "Ns.Z"}, true);
}
RGB *rgbResultGPU;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册