Fix assert rendering with denoising, after recent changes.
This commit is contained in:
@@ -266,7 +266,7 @@ def register_passes(engine, scene, srl):
|
|||||||
engine.register_pass(scene, srl, "CryptoAsset" + '{:02d}'.format(i), 4, "RGBA", 'COLOR')
|
engine.register_pass(scene, srl, "CryptoAsset" + '{:02d}'.format(i), 4, "RGBA", 'COLOR')
|
||||||
|
|
||||||
if crl.use_denoising or crl.denoising_store_passes:
|
if crl.use_denoising or crl.denoising_store_passes:
|
||||||
engine.register_pass(scene, srl, "Noisy Image", 3, "RGBA", 'COLOR')
|
engine.register_pass(scene, srl, "Noisy Image", 4, "RGBA", 'COLOR')
|
||||||
if crl.denoising_store_passes:
|
if crl.denoising_store_passes:
|
||||||
engine.register_pass(scene, srl, "Denoising Normal", 3, "XYZ", 'VECTOR')
|
engine.register_pass(scene, srl, "Denoising Normal", 3, "XYZ", 'VECTOR')
|
||||||
engine.register_pass(scene, srl, "Denoising Normal Variance", 3, "XYZ", 'VECTOR')
|
engine.register_pass(scene, srl, "Denoising Normal Variance", 3, "XYZ", 'VECTOR')
|
||||||
|
@@ -147,7 +147,7 @@ bool RenderBuffers::copy_from_device()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RenderBuffers::get_denoising_pass_rect(int offset, float exposure, int sample, int components, float *pixels)
|
bool RenderBuffers::get_denoising_pass_rect(int type, float exposure, int sample, int components, float *pixels)
|
||||||
{
|
{
|
||||||
if(buffer.data() == NULL) {
|
if(buffer.data() == NULL) {
|
||||||
return false;
|
return false;
|
||||||
@@ -155,20 +155,20 @@ bool RenderBuffers::get_denoising_pass_rect(int offset, float exposure, int samp
|
|||||||
|
|
||||||
float invsample = 1.0f/sample;
|
float invsample = 1.0f/sample;
|
||||||
float scale = invsample;
|
float scale = invsample;
|
||||||
bool variance = (offset == DENOISING_PASS_NORMAL_VAR) ||
|
bool variance = (type == DENOISING_PASS_NORMAL_VAR) ||
|
||||||
(offset == DENOISING_PASS_ALBEDO_VAR) ||
|
(type == DENOISING_PASS_ALBEDO_VAR) ||
|
||||||
(offset == DENOISING_PASS_DEPTH_VAR) ||
|
(type == DENOISING_PASS_DEPTH_VAR) ||
|
||||||
(offset == DENOISING_PASS_COLOR_VAR);
|
(type == DENOISING_PASS_COLOR_VAR);
|
||||||
|
|
||||||
float scale_exposure = scale;
|
float scale_exposure = scale;
|
||||||
if(offset == DENOISING_PASS_COLOR || offset == DENOISING_PASS_CLEAN) {
|
if(type == DENOISING_PASS_COLOR || type == DENOISING_PASS_CLEAN) {
|
||||||
scale_exposure *= exposure;
|
scale_exposure *= exposure;
|
||||||
}
|
}
|
||||||
else if(offset == DENOISING_PASS_COLOR_VAR) {
|
else if(type == DENOISING_PASS_COLOR_VAR) {
|
||||||
scale_exposure *= exposure*exposure;
|
scale_exposure *= exposure*exposure;
|
||||||
}
|
}
|
||||||
|
|
||||||
offset += params.get_denoising_offset();
|
int offset = type + params.get_denoising_offset();
|
||||||
int pass_stride = params.get_passes_size();
|
int pass_stride = params.get_passes_size();
|
||||||
int size = params.width*params.height;
|
int size = params.width*params.height;
|
||||||
|
|
||||||
@@ -212,7 +212,7 @@ bool RenderBuffers::get_denoising_pass_rect(int offset, float exposure, int samp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(components == 4) {
|
else if(components == 4) {
|
||||||
assert(offset == DENOISING_PASS_COLOR);
|
assert(type == DENOISING_PASS_COLOR);
|
||||||
|
|
||||||
/* Since the alpha channel is not involved in denoising, output the Combined alpha channel. */
|
/* Since the alpha channel is not involved in denoising, output the Combined alpha channel. */
|
||||||
assert(params.passes[0].type == PASS_COMBINED);
|
assert(params.passes[0].type == PASS_COMBINED);
|
||||||
|
Reference in New Issue
Block a user