fixes: MSAA outline, opaque material alpha in envprobe
This commit is contained in:
@@ -263,7 +263,6 @@ struct VertexSurface
|
||||
position = float4(pos_wind.xyz, 1);
|
||||
normal = input.GetNormal();
|
||||
color = half4(material.GetBaseColor() * inst.GetColor());
|
||||
color.a *= half(1 - input.GetInstancePointer().GetDither());
|
||||
|
||||
[branch]
|
||||
if (material.IsUsingVertexColors())
|
||||
@@ -271,6 +270,14 @@ struct VertexSurface
|
||||
color *= input.GetVertexColor();
|
||||
}
|
||||
|
||||
[branch]
|
||||
if (!material.IsTransparent())
|
||||
{
|
||||
color.a = 1;
|
||||
}
|
||||
|
||||
color.a *= half(1 - input.GetInstancePointer().GetDither());
|
||||
|
||||
[branch]
|
||||
if (material.IsUsingVertexAO())
|
||||
{
|
||||
|
||||
@@ -1498,11 +1498,23 @@ namespace wi
|
||||
// Cut off outline source from linear depth:
|
||||
device->EventBegin("Outline Source", cmd);
|
||||
|
||||
RenderPassImage rp[] = {
|
||||
RenderPassImage::RenderTarget(&rtOutlineSource, RenderPassImage::LoadOp::CLEAR),
|
||||
RenderPassImage::DepthStencil(&depthBuffer_Main, RenderPassImage::LoadOp::LOAD)
|
||||
};
|
||||
device->RenderPassBegin(rp, arraysize(rp), cmd);
|
||||
if (getMSAASampleCount() > 1)
|
||||
{
|
||||
RenderPassImage rp[] = {
|
||||
RenderPassImage::RenderTarget(&rtOutlineSource_MSAA, RenderPassImage::LoadOp::CLEAR, RenderPassImage::StoreOp::DONTCARE, ResourceState::RENDERTARGET, ResourceState::RENDERTARGET),
|
||||
RenderPassImage::DepthStencil(&depthBuffer_Main, RenderPassImage::LoadOp::LOAD),
|
||||
RenderPassImage::Resolve(&rtOutlineSource)
|
||||
};
|
||||
device->RenderPassBegin(rp, arraysize(rp), cmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderPassImage rp[] = {
|
||||
RenderPassImage::RenderTarget(&rtOutlineSource, RenderPassImage::LoadOp::CLEAR),
|
||||
RenderPassImage::DepthStencil(&depthBuffer_Main, RenderPassImage::LoadOp::LOAD)
|
||||
};
|
||||
device->RenderPassBegin(rp, arraysize(rp), cmd);
|
||||
}
|
||||
wi::image::Params params;
|
||||
params.enableFullScreen();
|
||||
params.stencilRefMode = wi::image::STENCILREFMODE_ENGINE;
|
||||
@@ -3247,10 +3259,21 @@ namespace wi
|
||||
desc.height = internalResolution.y;
|
||||
device->CreateTexture(&desc, nullptr, &rtOutlineSource);
|
||||
device->SetName(&rtOutlineSource, "rtOutlineSource");
|
||||
|
||||
if (getMSAASampleCount() > 1)
|
||||
{
|
||||
desc.bind_flags = BindFlag::RENDER_TARGET;
|
||||
desc.sample_count = getMSAASampleCount();
|
||||
desc.misc_flags = ResourceMiscFlag::TRANSIENT_ATTACHMENT;
|
||||
desc.layout = ResourceState::RENDERTARGET;
|
||||
device->CreateTexture(&desc, nullptr, &rtOutlineSource_MSAA);
|
||||
device->SetName(&rtOutlineSource_MSAA, "rtOutlineSource_MSAA");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
rtOutlineSource = {};
|
||||
rtOutlineSource_MSAA = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@ namespace wi
|
||||
wi::graphics::Texture rtShadingRate; // UINT8 shading rate per tile
|
||||
wi::graphics::Texture rtFSR[2]; // FSR upscaling result (full resolution LDR)
|
||||
wi::graphics::Texture rtOutlineSource; // linear depth but only the regions which have outline stencil
|
||||
wi::graphics::Texture rtOutlineSource_MSAA; // linear depth but only the regions which have outline stencil
|
||||
|
||||
wi::graphics::Texture rtPostprocess; // ping-pong with main scene RT in post-process chain
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace wi::version
|
||||
// minor features, major updates, breaking compatibility changes
|
||||
const int minor = 72;
|
||||
// minor bug fixes, alterations, refactors, updates
|
||||
const int revision = 42;
|
||||
const int revision = 43;
|
||||
|
||||
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user