outline effect update
This commit is contained in:
+22
-26
@@ -169,9 +169,6 @@ void EditorComponent::ResizeBuffers()
|
||||
}
|
||||
hr = device->CreateTexture(&desc, nullptr, &rt_selectionOutline[0]);
|
||||
assert(SUCCEEDED(hr));
|
||||
|
||||
desc.Format = FORMAT_R8G8B8A8_UNORM;
|
||||
desc.BindFlags = BIND_RENDER_TARGET | BIND_SHADER_RESOURCE | BIND_UNORDERED_ACCESS;
|
||||
hr = device->CreateTexture(&desc, nullptr, &rt_selectionOutline[1]);
|
||||
assert(SUCCEEDED(hr));
|
||||
}
|
||||
@@ -188,8 +185,11 @@ void EditorComponent::ResizeBuffers()
|
||||
hr = device->CreateRenderPass(&desc, &renderpass_selectionOutline[0]);
|
||||
assert(SUCCEEDED(hr));
|
||||
|
||||
desc.numAttachments = 1;
|
||||
desc.attachments[0] = { RenderPassAttachment::RENDERTARGET, RenderPassAttachment::LOADOP_CLEAR, &rt_selectionOutline[1], -1 };
|
||||
if (renderPath->getMSAASampleCount() > 1)
|
||||
{
|
||||
desc.attachments[0].texture = &rt_selectionOutline_MSAA;
|
||||
}
|
||||
hr = device->CreateRenderPass(&desc, &renderpass_selectionOutline[1]);
|
||||
assert(SUCCEEDED(hr));
|
||||
}
|
||||
@@ -1736,7 +1736,7 @@ void EditorComponent::Render() const
|
||||
GraphicsDevice* device = wiRenderer::GetDevice();
|
||||
CommandList cmd = device->BeginCommandList();
|
||||
|
||||
device->EventBegin("Editor - Selection Outline", cmd);
|
||||
device->EventBegin("Editor - Selection Outline Mask", cmd);
|
||||
|
||||
Viewport vp;
|
||||
vp.Width = (float)rt_selectionOutline[0].GetDesc().Width;
|
||||
@@ -1749,12 +1749,9 @@ void EditorComponent::Render() const
|
||||
|
||||
// We will specify the stencil ref in user-space, don't care about engine stencil refs here:
|
||||
// Otherwise would need to take into account engine ref and draw multiple permutations of stencil refs.
|
||||
fx.stencilRefMode = STENCILREFMODE_USER;
|
||||
fx.stencilRefMode = STENCILREFMODE_USER;
|
||||
|
||||
device->RenderPassBegin(&renderpass_selectionOutline[1], cmd); // this renderpass just clears so its empty
|
||||
device->RenderPassEnd(cmd);
|
||||
|
||||
// Materials outline (green):
|
||||
// Materials outline:
|
||||
{
|
||||
device->RenderPassBegin(&renderpass_selectionOutline[0], cmd);
|
||||
|
||||
@@ -1768,16 +1765,12 @@ void EditorComponent::Render() const
|
||||
{
|
||||
device->MSAAResolve(&rt_selectionOutline[0], &rt_selectionOutline_MSAA, cmd);
|
||||
}
|
||||
|
||||
// Outline the solid blocks:
|
||||
wiRenderer::BindCommonResources(cmd);
|
||||
wiRenderer::Postprocess_Outline(rt_selectionOutline[0], rt_selectionOutline[1], cmd, 0.1f, 1, selectionColor2);
|
||||
}
|
||||
|
||||
// Objects outline (orange):
|
||||
// Objects outline:
|
||||
{
|
||||
device->UnbindResources(TEXSLOT_ONDEMAND0, 1, cmd);
|
||||
device->RenderPassBegin(&renderpass_selectionOutline[0], cmd);
|
||||
device->RenderPassBegin(&renderpass_selectionOutline[1], cmd);
|
||||
|
||||
// Draw solid blocks of selected objects
|
||||
fx.stencilRef = EDITORSTENCILREF_HIGHLIGHT_OBJECT;
|
||||
@@ -1787,12 +1780,8 @@ void EditorComponent::Render() const
|
||||
|
||||
if (renderPath->getMSAASampleCount() > 1)
|
||||
{
|
||||
device->MSAAResolve(&rt_selectionOutline[0], &rt_selectionOutline_MSAA, cmd);
|
||||
device->MSAAResolve(&rt_selectionOutline[1], &rt_selectionOutline_MSAA, cmd);
|
||||
}
|
||||
|
||||
// Outline the solid blocks:
|
||||
wiRenderer::BindCommonResources(cmd);
|
||||
wiRenderer::Postprocess_Outline(rt_selectionOutline[0], rt_selectionOutline[1], cmd, 0.1f, 1, selectionColor);
|
||||
}
|
||||
|
||||
device->EventEnd(cmd);
|
||||
@@ -1810,14 +1799,21 @@ void EditorComponent::Compose(CommandList cmd) const
|
||||
return;
|
||||
}
|
||||
|
||||
// Compose the selection outline to the screen:
|
||||
// Draw selection outline to the screen:
|
||||
const float selectionColorIntensity = std::sinf(selectionOutlineTimer * XM_2PI * 0.8f) * 0.5f + 0.5f;
|
||||
if (renderPath->GetDepthStencil() != nullptr && !translator.selected.empty())
|
||||
{
|
||||
wiImageParams fx;
|
||||
fx.enableFullScreen();
|
||||
fx.opacity = wiMath::Lerp(0.4f, 1.0f, selectionColorIntensity);
|
||||
wiImage::Draw(&rt_selectionOutline[1], fx, cmd);
|
||||
GraphicsDevice* device = wiRenderer::GetDevice();
|
||||
device->EventBegin("Editor - Selection Outline", cmd);
|
||||
wiRenderer::BindCommonResources(cmd);
|
||||
float opacity = wiMath::Lerp(0.4f, 1.0f, selectionColorIntensity);
|
||||
XMFLOAT4 col = selectionColor2;
|
||||
col.w *= opacity;
|
||||
wiRenderer::Postprocess_Outline(rt_selectionOutline[0], cmd, 0.1f, 1, col);
|
||||
col = selectionColor;
|
||||
col.w *= opacity;
|
||||
wiRenderer::Postprocess_Outline(rt_selectionOutline[1], cmd, 0.1f, 1, col);
|
||||
device->EventEnd(cmd);
|
||||
}
|
||||
|
||||
const CameraComponent& camera = wiRenderer::GetCamera();
|
||||
|
||||
@@ -465,11 +465,11 @@ void RenderPath3D::DownsampleDepthBuffer(CommandList cmd) const
|
||||
|
||||
device->RenderPassEnd(cmd);
|
||||
}
|
||||
void RenderPath3D::RenderOutline(const Texture& dstSceneRT, CommandList cmd) const
|
||||
void RenderPath3D::RenderOutline(CommandList cmd) const
|
||||
{
|
||||
if (getOutlineEnabled())
|
||||
{
|
||||
wiRenderer::Postprocess_Outline(rtLinearDepth, dstSceneRT, cmd, getOutlineThreshold(), getOutlineThickness(), getOutlineColor());
|
||||
wiRenderer::Postprocess_Outline(rtLinearDepth, cmd, getOutlineThreshold(), getOutlineThickness(), getOutlineColor());
|
||||
}
|
||||
}
|
||||
void RenderPath3D::RenderLightShafts(CommandList cmd) const
|
||||
|
||||
@@ -88,9 +88,9 @@ protected:
|
||||
const wiGraphics::Texture* GetLastPostprocessRT() const
|
||||
{
|
||||
int ldr_postprocess_count = 0;
|
||||
ldr_postprocess_count += sharpenFilterEnabled ? 1 : 0;
|
||||
ldr_postprocess_count += fxaaEnabled ? 1 : 0;
|
||||
ldr_postprocess_count += chromaticAberrationEnabled ? 1 : 0;
|
||||
ldr_postprocess_count += getSharpenFilterEnabled() ? 1 : 0;
|
||||
ldr_postprocess_count += getFXAAEnabled() ? 1 : 0;
|
||||
ldr_postprocess_count += getChromaticAberrationEnabled() ? 1 : 0;
|
||||
int rt_index = ldr_postprocess_count % 2;
|
||||
return &rtPostprocess_LDR[rt_index];
|
||||
}
|
||||
@@ -105,7 +105,7 @@ protected:
|
||||
virtual void RenderSSAO(wiGraphics::CommandList cmd) const;
|
||||
virtual void RenderSSR(const wiGraphics::Texture& gbuffer1, const wiGraphics::Texture& gbuffer2, wiGraphics::CommandList cmd) const;
|
||||
virtual void DownsampleDepthBuffer(wiGraphics::CommandList cmd) const;
|
||||
virtual void RenderOutline(const wiGraphics::Texture& dstSceneRT, wiGraphics::CommandList cmd) const;
|
||||
virtual void RenderOutline(wiGraphics::CommandList cmd) const;
|
||||
virtual void RenderLightShafts(wiGraphics::CommandList cmd) const;
|
||||
virtual void RenderVolumetrics(wiGraphics::CommandList cmd) const;
|
||||
virtual void RenderSceneMIPChain(const wiGraphics::Texture& srcSceneRT, wiGraphics::CommandList cmd) const;
|
||||
|
||||
@@ -239,8 +239,6 @@ void RenderPath3D_Deferred::Render() const
|
||||
|
||||
RenderTransparents(renderpass_transparent, RENDERPASS_FORWARD, cmd);
|
||||
|
||||
RenderOutline(rtDeferred, cmd);
|
||||
|
||||
RenderPostprocessChain(rtDeferred, rtGBuffer[1], cmd);
|
||||
|
||||
});
|
||||
@@ -302,5 +300,7 @@ void RenderPath3D_Deferred::RenderDeferredComposition(CommandList cmd) const
|
||||
);
|
||||
wiRenderer::DrawSky(cmd);
|
||||
|
||||
RenderOutline(cmd);
|
||||
|
||||
device->RenderPassEnd(cmd);
|
||||
}
|
||||
|
||||
@@ -175,6 +175,8 @@ void RenderPath3D_Forward::Render() const
|
||||
wiRenderer::DrawScene(wiRenderer::GetCamera(), getTessellationEnabled(), cmd, RENDERPASS_FORWARD, true, true);
|
||||
wiRenderer::DrawSky(cmd);
|
||||
|
||||
RenderOutline(cmd);
|
||||
|
||||
device->RenderPassEnd(cmd);
|
||||
|
||||
wiProfiler::EndRange(range); // Opaque Scene
|
||||
@@ -211,8 +213,6 @@ void RenderPath3D_Forward::Render() const
|
||||
device->MSAAResolve(GetSceneRT_Read(0), &rtMain[0], cmd);
|
||||
}
|
||||
|
||||
RenderOutline(*GetSceneRT_Read(0), cmd);
|
||||
|
||||
RenderPostprocessChain(*GetSceneRT_Read(0), *GetSceneRT_Read(1), cmd);
|
||||
|
||||
});
|
||||
|
||||
@@ -168,8 +168,6 @@ void RenderPath3D_TiledDeferred::Render() const
|
||||
|
||||
RenderTransparents(renderpass_transparent, RENDERPASS_TILEDFORWARD, cmd);
|
||||
|
||||
RenderOutline(rtDeferred, cmd);
|
||||
|
||||
RenderPostprocessChain(rtDeferred, rtGBuffer[1], cmd);
|
||||
|
||||
});
|
||||
|
||||
@@ -105,6 +105,8 @@ void RenderPath3D_TiledForward::Render() const
|
||||
wiRenderer::DrawScene(wiRenderer::GetCamera(), getTessellationEnabled(), cmd, RENDERPASS_TILEDFORWARD, true, true);
|
||||
wiRenderer::DrawSky(cmd);
|
||||
|
||||
RenderOutline(cmd);
|
||||
|
||||
device->RenderPassEnd(cmd);
|
||||
|
||||
wiProfiler::EndRange(range); // Opaque Scene
|
||||
@@ -141,8 +143,6 @@ void RenderPath3D_TiledForward::Render() const
|
||||
device->MSAAResolve(GetSceneRT_Read(0), &rtMain[0], cmd);
|
||||
}
|
||||
|
||||
RenderOutline(*GetSceneRT_Read(0), cmd);
|
||||
|
||||
RenderPostprocessChain(*GetSceneRT_Read(0), *GetSceneRT_Read(1), cmd);
|
||||
});
|
||||
|
||||
|
||||
@@ -649,12 +649,8 @@
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">5.0</ShaderModel>
|
||||
</FxCompile>
|
||||
<FxCompile Include="outlineCS_float4.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
</FxCompile>
|
||||
<FxCompile Include="outlineCS_unorm4.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compute</ShaderType>
|
||||
<ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">5.0</ShaderModel>
|
||||
<FxCompile Include="outlinePS.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
|
||||
</FxCompile>
|
||||
<FxCompile Include="pointLightPS.hlsl">
|
||||
<ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
|
||||
|
||||
@@ -780,12 +780,6 @@
|
||||
<FxCompile Include="hairparticlePS_tiledforward_transparent.hlsl">
|
||||
<Filter>PS</Filter>
|
||||
</FxCompile>
|
||||
<FxCompile Include="outlineCS_unorm4.hlsl">
|
||||
<Filter>CS</Filter>
|
||||
</FxCompile>
|
||||
<FxCompile Include="outlineCS_float4.hlsl">
|
||||
<Filter>CS</Filter>
|
||||
</FxCompile>
|
||||
<FxCompile Include="motionblur_neighborhoodMaxVelocityCS.hlsl">
|
||||
<Filter>CS</Filter>
|
||||
</FxCompile>
|
||||
@@ -876,6 +870,9 @@
|
||||
<FxCompile Include="ssr_temporalCS.hlsl">
|
||||
<Filter>CS</Filter>
|
||||
</FxCompile>
|
||||
<FxCompile Include="outlinePS.hlsl">
|
||||
<Filter>PS</Filter>
|
||||
</FxCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="PS">
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#define OUTLINE_OUTPUT_FORMAT unorm float4
|
||||
#include "outlineCS_float4.hlsl"
|
||||
@@ -1,19 +1,10 @@
|
||||
#include "globals.hlsli"
|
||||
#include "ShaderInterop_Postprocess.h"
|
||||
|
||||
#ifndef OUTLINE_OUTPUT_FORMAT
|
||||
#define OUTLINE_OUTPUT_FORMAT float4
|
||||
#endif // OUTLINE_OUTPUT_FORMAT
|
||||
|
||||
TEXTURE2D(input, float, TEXSLOT_ONDEMAND0);
|
||||
|
||||
RWTEXTURE2D(output, OUTLINE_OUTPUT_FORMAT, 0);
|
||||
|
||||
[numthreads(POSTPROCESS_BLOCKSIZE, POSTPROCESS_BLOCKSIZE, 1)]
|
||||
void main(uint3 DTid : SV_DispatchThreadID)
|
||||
float4 main(float4 pos : SV_Position, float2 uv : TEXCOORD) : SV_TARGET
|
||||
{
|
||||
const float2 uv = (DTid.xy + 0.5f) * xPPResolution_rcp;
|
||||
|
||||
const float middle = input.SampleLevel(sampler_linear_clamp, uv, 0);
|
||||
|
||||
const float outlineThickness = xPPParams0.y;
|
||||
@@ -71,6 +62,5 @@ void main(uint3 DTid : SV_DispatchThreadID)
|
||||
|
||||
float edge = dist > outlineThreshold ? 1 : 0;
|
||||
|
||||
float4 color_prev = output[DTid.xy];
|
||||
output[DTid.xy] = lerp(color_prev, outlineColor, edge);
|
||||
return float4(outlineColor.rgb, outlineColor.a * edge);
|
||||
}
|
||||
@@ -232,6 +232,7 @@ enum PSTYPES
|
||||
PSTYPE_DEFERREDCOMPOSITION,
|
||||
PSTYPE_POSTPROCESS_SSS,
|
||||
PSTYPE_POSTPROCESS_UPSAMPLE_BILATERAL,
|
||||
PSTYPE_POSTPROCESS_OUTLINE,
|
||||
PSTYPE_LENSFLARE,
|
||||
PSTYPE_COUNT
|
||||
};
|
||||
@@ -313,8 +314,6 @@ enum CSTYPES
|
||||
CSTYPE_POSTPROCESS_DEPTHOFFIELD_MAIN_CHEAP,
|
||||
CSTYPE_POSTPROCESS_DEPTHOFFIELD_POSTFILTER,
|
||||
CSTYPE_POSTPROCESS_DEPTHOFFIELD_UPSAMPLE,
|
||||
CSTYPE_POSTPROCESS_OUTLINE_FLOAT4,
|
||||
CSTYPE_POSTPROCESS_OUTLINE_UNORM4,
|
||||
CSTYPE_POSTPROCESS_MOTIONBLUR_TILEMAXVELOCITY_HORIZONTAL,
|
||||
CSTYPE_POSTPROCESS_MOTIONBLUR_TILEMAXVELOCITY_VERTICAL,
|
||||
CSTYPE_POSTPROCESS_MOTIONBLUR_NEIGHBORHOODMAXVELOCITY,
|
||||
|
||||
+18
-32
@@ -968,6 +968,7 @@ PipelineState PSO_downsampledepthbuffer;
|
||||
PipelineState PSO_deferredcomposition;
|
||||
PipelineState PSO_sss;
|
||||
PipelineState PSO_upsample_bilateral;
|
||||
PipelineState PSO_outline;
|
||||
|
||||
enum SKYRENDERING
|
||||
{
|
||||
@@ -1282,6 +1283,7 @@ void LoadShaders()
|
||||
wiJobSystem::Execute(ctx, [] { LoadShader(PS, pixelShaders[PSTYPE_DEFERREDCOMPOSITION], "deferredPS.cso"); });
|
||||
wiJobSystem::Execute(ctx, [] { LoadShader(PS, pixelShaders[PSTYPE_POSTPROCESS_SSS], "sssPS.cso"); });
|
||||
wiJobSystem::Execute(ctx, [] { LoadShader(PS, pixelShaders[PSTYPE_POSTPROCESS_UPSAMPLE_BILATERAL], "upsample_bilateralPS.cso"); });
|
||||
wiJobSystem::Execute(ctx, [] { LoadShader(PS, pixelShaders[PSTYPE_POSTPROCESS_OUTLINE], "outlinePS.cso"); });
|
||||
wiJobSystem::Execute(ctx, [] { LoadShader(PS, pixelShaders[PSTYPE_LENSFLARE], "lensFlarePS.cso"); });
|
||||
|
||||
wiJobSystem::Execute(ctx, [] { LoadShader(GS, geometryShaders[GSTYPE_VOXELIZER], "objectGS_voxelizer.cso"); });
|
||||
@@ -1345,8 +1347,6 @@ void LoadShaders()
|
||||
wiJobSystem::Execute(ctx, [] { LoadShader(CS, computeShaders[CSTYPE_POSTPROCESS_DEPTHOFFIELD_MAIN_CHEAP], "depthoffield_mainCS_cheap.cso"); });
|
||||
wiJobSystem::Execute(ctx, [] { LoadShader(CS, computeShaders[CSTYPE_POSTPROCESS_DEPTHOFFIELD_POSTFILTER], "depthoffield_postfilterCS.cso"); });
|
||||
wiJobSystem::Execute(ctx, [] { LoadShader(CS, computeShaders[CSTYPE_POSTPROCESS_DEPTHOFFIELD_UPSAMPLE], "depthoffield_upsampleCS.cso"); });
|
||||
wiJobSystem::Execute(ctx, [] { LoadShader(CS, computeShaders[CSTYPE_POSTPROCESS_OUTLINE_FLOAT4], "outlineCS_float4.cso"); });
|
||||
wiJobSystem::Execute(ctx, [] { LoadShader(CS, computeShaders[CSTYPE_POSTPROCESS_OUTLINE_UNORM4], "outlineCS_unorm4.cso"); });
|
||||
wiJobSystem::Execute(ctx, [] { LoadShader(CS, computeShaders[CSTYPE_POSTPROCESS_MOTIONBLUR_TILEMAXVELOCITY_HORIZONTAL], "motionblur_tileMaxVelocity_horizontalCS.cso"); });
|
||||
wiJobSystem::Execute(ctx, [] { LoadShader(CS, computeShaders[CSTYPE_POSTPROCESS_MOTIONBLUR_TILEMAXVELOCITY_VERTICAL], "motionblur_tileMaxVelocity_verticalCS.cso"); });
|
||||
wiJobSystem::Execute(ctx, [] { LoadShader(CS, computeShaders[CSTYPE_POSTPROCESS_MOTIONBLUR_NEIGHBORHOODMAXVELOCITY], "motionblur_neighborhoodMaxVelocityCS.cso"); });
|
||||
@@ -1846,6 +1846,16 @@ void LoadShaders()
|
||||
|
||||
device->CreatePipelineState(&desc, &PSO_upsample_bilateral);
|
||||
});
|
||||
wiJobSystem::Execute(ctx, [device] {
|
||||
PipelineStateDesc desc;
|
||||
desc.vs = &vertexShaders[VSTYPE_SCREEN];
|
||||
desc.ps = &pixelShaders[PSTYPE_POSTPROCESS_OUTLINE];
|
||||
desc.rs = &rasterizers[RSTYPE_DOUBLESIDED];
|
||||
desc.bs = &blendStates[BSTYPE_TRANSPARENT];
|
||||
desc.dss = &depthStencils[DSSTYPE_XRAY];
|
||||
|
||||
device->CreatePipelineState(&desc, &PSO_outline);
|
||||
});
|
||||
wiJobSystem::Execute(ctx, [device] {
|
||||
PipelineStateDesc desc;
|
||||
desc.vs = &vertexShaders[VSTYPE_LENSFLARE];
|
||||
@@ -9464,7 +9474,6 @@ void Postprocess_DepthOfField(
|
||||
}
|
||||
void Postprocess_Outline(
|
||||
const Texture& input,
|
||||
const Texture& output,
|
||||
CommandList cmd,
|
||||
float threshold,
|
||||
float thickness,
|
||||
@@ -9476,22 +9485,13 @@ void Postprocess_Outline(
|
||||
device->EventBegin("Postprocess_Outline", cmd);
|
||||
auto range = wiProfiler::BeginRangeGPU("Outline", cmd);
|
||||
|
||||
const TextureDesc& desc = output.GetDesc();
|
||||
device->BindPipelineState(&PSO_outline, cmd);
|
||||
|
||||
if (device->IsFormatUnorm(desc.Format))
|
||||
{
|
||||
device->BindComputeShader(&computeShaders[CSTYPE_POSTPROCESS_OUTLINE_UNORM4], cmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
device->BindComputeShader(&computeShaders[CSTYPE_POSTPROCESS_OUTLINE_FLOAT4], cmd);
|
||||
}
|
||||
|
||||
device->BindResource(CS, &input, TEXSLOT_ONDEMAND0, cmd);
|
||||
device->BindResource(PS, &input, TEXSLOT_ONDEMAND0, cmd);
|
||||
|
||||
PostProcessCB cb;
|
||||
cb.xPPResolution.x = desc.Width;
|
||||
cb.xPPResolution.y = desc.Height;
|
||||
cb.xPPResolution.x = (uint)input.GetDesc().Width;
|
||||
cb.xPPResolution.y = (uint)input.GetDesc().Height;
|
||||
cb.xPPResolution_rcp.x = 1.0f / cb.xPPResolution.x;
|
||||
cb.xPPResolution_rcp.y = 1.0f / cb.xPPResolution.y;
|
||||
cb.xPPParams0.x = threshold;
|
||||
@@ -9501,23 +9501,9 @@ void Postprocess_Outline(
|
||||
cb.xPPParams1.z = color.z;
|
||||
cb.xPPParams1.w = color.w;
|
||||
device->UpdateBuffer(&constantBuffers[CBTYPE_POSTPROCESS], &cb, cmd);
|
||||
device->BindConstantBuffer(CS, &constantBuffers[CBTYPE_POSTPROCESS], CB_GETBINDSLOT(PostProcessCB), cmd);
|
||||
device->BindConstantBuffer(PS, &constantBuffers[CBTYPE_POSTPROCESS], CB_GETBINDSLOT(PostProcessCB), cmd);
|
||||
|
||||
const GPUResource* uavs[] = {
|
||||
&output,
|
||||
};
|
||||
device->BindUAVs(CS, uavs, 0, arraysize(uavs), cmd);
|
||||
|
||||
|
||||
device->Dispatch(
|
||||
(desc.Width + POSTPROCESS_BLOCKSIZE - 1) / POSTPROCESS_BLOCKSIZE,
|
||||
(desc.Height + POSTPROCESS_BLOCKSIZE - 1) / POSTPROCESS_BLOCKSIZE,
|
||||
1,
|
||||
cmd
|
||||
);
|
||||
|
||||
device->Barrier(&GPUBarrier::Memory(), 1, cmd);
|
||||
device->UnbindUAVs(0, arraysize(uavs), cmd);
|
||||
device->Draw(3, 0, cmd);
|
||||
|
||||
wiProfiler::EndRange(range);
|
||||
device->EventEnd(cmd);
|
||||
|
||||
@@ -233,7 +233,6 @@ namespace wiRenderer
|
||||
);
|
||||
void Postprocess_Outline(
|
||||
const wiGraphics::Texture& input,
|
||||
const wiGraphics::Texture& output,
|
||||
wiGraphics::CommandList cmd,
|
||||
float threshold = 0.1f,
|
||||
float thickness = 1.0f,
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace wiVersion
|
||||
// minor features, major updates
|
||||
const int minor = 38;
|
||||
// minor bug fixes, alterations, refactors, updates
|
||||
const int revision = 14;
|
||||
const int revision = 15;
|
||||
|
||||
|
||||
long GetVersion()
|
||||
|
||||
Reference in New Issue
Block a user