added some more post processing support for path tracing renderer
This commit is contained in:
@@ -565,11 +565,33 @@ namespace wi
|
||||
device->RenderPassEnd(cmd);
|
||||
}
|
||||
|
||||
// Post processing:
|
||||
const Texture* rt_read = &rtMain;
|
||||
const Texture* rt_write = &rtPostprocess;
|
||||
|
||||
for (auto& x : custom_post_processes)
|
||||
{
|
||||
if (x.stage == CustomPostprocess::Stage::BeforeTonemap)
|
||||
{
|
||||
wi::renderer::Postprocess_Custom(
|
||||
x.computeshader,
|
||||
*rt_read,
|
||||
*rt_write,
|
||||
cmd,
|
||||
x.params0,
|
||||
x.params1,
|
||||
x.name.c_str()
|
||||
);
|
||||
|
||||
std::swap(rt_read, rt_write);
|
||||
}
|
||||
}
|
||||
|
||||
if (getEyeAdaptionEnabled())
|
||||
{
|
||||
wi::renderer::ComputeLuminance(
|
||||
luminanceResources,
|
||||
rtMain,
|
||||
*rt_read,
|
||||
cmd,
|
||||
getEyeAdaptionRate(),
|
||||
getEyeAdaptionKey()
|
||||
@@ -579,7 +601,7 @@ namespace wi
|
||||
{
|
||||
wi::renderer::ComputeBloom(
|
||||
bloomResources,
|
||||
rtMain,
|
||||
*rt_read,
|
||||
cmd,
|
||||
getBloomThreshold(),
|
||||
getExposure(),
|
||||
@@ -588,8 +610,8 @@ namespace wi
|
||||
}
|
||||
|
||||
wi::renderer::Postprocess_Tonemap(
|
||||
rtMain,
|
||||
rtPostprocess,
|
||||
*rt_read,
|
||||
*rt_write,
|
||||
cmd,
|
||||
getExposure(),
|
||||
getBrightness(),
|
||||
@@ -605,7 +627,49 @@ namespace wi
|
||||
&distortion_overlay,
|
||||
getHDRCalibration()
|
||||
);
|
||||
lastPostprocessRT = &rtPostprocess;
|
||||
std::swap(rt_read, rt_write);
|
||||
|
||||
for (auto& x : custom_post_processes)
|
||||
{
|
||||
if (x.stage == CustomPostprocess::Stage::AfterTonemap)
|
||||
{
|
||||
wi::renderer::Postprocess_Custom(
|
||||
x.computeshader,
|
||||
*rt_read,
|
||||
*rt_write,
|
||||
cmd,
|
||||
x.params0,
|
||||
x.params1,
|
||||
x.name.c_str()
|
||||
);
|
||||
|
||||
std::swap(rt_read, rt_write);
|
||||
}
|
||||
}
|
||||
|
||||
if (getSharpenFilterEnabled())
|
||||
{
|
||||
wi::renderer::Postprocess_Sharpen(*rt_read, *rt_write, cmd, getSharpenFilterAmount());
|
||||
|
||||
std::swap(rt_read, rt_write);
|
||||
}
|
||||
|
||||
if (getFXAAEnabled())
|
||||
{
|
||||
wi::renderer::Postprocess_FXAA(*rt_read, *rt_write, cmd);
|
||||
|
||||
std::swap(rt_read, rt_write);
|
||||
}
|
||||
|
||||
if (getChromaticAberrationEnabled())
|
||||
{
|
||||
wi::renderer::Postprocess_Chromatic_Aberration(*rt_read, *rt_write, cmd, getChromaticAberrationAmount());
|
||||
|
||||
std::swap(rt_read, rt_write);
|
||||
}
|
||||
|
||||
lastPostprocessRT = rt_read;
|
||||
|
||||
|
||||
// GUI Background blurring:
|
||||
{
|
||||
@@ -617,7 +681,7 @@ namespace wi
|
||||
device->EventEnd(cmd);
|
||||
wi::profiler::EndRange(range);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
RenderPath2D::Render();
|
||||
|
||||
@@ -636,7 +700,7 @@ namespace wi
|
||||
fx.enableFullScreen();
|
||||
fx.blendFlag = wi::enums::BLENDMODE_OPAQUE;
|
||||
fx.quality = wi::image::QUALITY_LINEAR;
|
||||
wi::image::Draw(&rtPostprocess, fx, cmd);
|
||||
wi::image::Draw(lastPostprocessRT, fx, cmd);
|
||||
|
||||
device->EventEnd(cmd);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace wi::version
|
||||
// minor features, major updates, breaking compatibility changes
|
||||
const int minor = 71;
|
||||
// minor bug fixes, alterations, refactors, updates
|
||||
const int revision = 823;
|
||||
const int revision = 824;
|
||||
|
||||
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user