Fix Global Surface Atlas drawing of objects that are hidden in GBuffer pass but should be visible for GI
This commit is contained in:
@@ -42,7 +42,7 @@ PACK_STRUCT(struct DeferredMaterialShaderData {
|
||||
|
||||
DrawPass DeferredMaterialShader::GetDrawModes() const
|
||||
{
|
||||
return DrawPass::Depth | DrawPass::GBuffer | DrawPass::MotionVectors | DrawPass::QuadOverdraw;
|
||||
return DrawPass::Depth | DrawPass::GBuffer | DrawPass::GlobalSurfaceAtlas | DrawPass::MotionVectors | DrawPass::QuadOverdraw;
|
||||
}
|
||||
|
||||
bool DeferredMaterialShader::CanUseLightmap() const
|
||||
|
||||
@@ -32,6 +32,8 @@ private:
|
||||
case DrawPass::Depth:
|
||||
return useSkinning ? &DepthSkinned : &Depth;
|
||||
case DrawPass::GBuffer:
|
||||
case DrawPass::GBuffer | DrawPass::GlobalSurfaceAtlas:
|
||||
case DrawPass::GlobalSurfaceAtlas:
|
||||
return useLightmap ? &DefaultLightmap : (useSkinning ? &DefaultSkinned : &Default);
|
||||
case DrawPass::MotionVectors:
|
||||
return useSkinning ? (perBoneMotionBlur ? &MotionVectorsSkinnedPerBone : &MotionVectorsSkinned) : &MotionVectors;
|
||||
|
||||
@@ -153,7 +153,7 @@ bool DeformableMaterialShader::Load()
|
||||
|
||||
if (_info.BlendMode == MaterialBlendMode::Opaque)
|
||||
{
|
||||
_drawModes = DrawPass::GBuffer;
|
||||
_drawModes |= DrawPass::GBuffer | DrawPass::GlobalSurfaceAtlas;
|
||||
|
||||
// GBuffer Pass
|
||||
psDesc.VS = _shader->GetVS("VS_SplineModel");
|
||||
@@ -162,7 +162,7 @@ bool DeformableMaterialShader::Load()
|
||||
}
|
||||
else
|
||||
{
|
||||
_drawModes = DrawPass::Forward;
|
||||
_drawModes |= DrawPass::Forward;
|
||||
|
||||
// Forward Pass
|
||||
psDesc.VS = _shader->GetVS("VS_SplineModel");
|
||||
|
||||
@@ -25,6 +25,8 @@ private:
|
||||
case DrawPass::Depth:
|
||||
return &Depth;
|
||||
case DrawPass::GBuffer:
|
||||
case DrawPass::GBuffer | DrawPass::GlobalSurfaceAtlas:
|
||||
case DrawPass::GlobalSurfaceAtlas:
|
||||
case DrawPass::Forward:
|
||||
return &Default;
|
||||
#if USE_EDITOR
|
||||
|
||||
@@ -39,7 +39,7 @@ PACK_STRUCT(struct TerrainMaterialShaderData {
|
||||
|
||||
DrawPass TerrainMaterialShader::GetDrawModes() const
|
||||
{
|
||||
return DrawPass::Depth | DrawPass::GBuffer;
|
||||
return DrawPass::Depth | DrawPass::GBuffer | DrawPass::GlobalSurfaceAtlas;
|
||||
}
|
||||
|
||||
bool TerrainMaterialShader::CanUseLightmap() const
|
||||
|
||||
@@ -26,6 +26,8 @@ private:
|
||||
case DrawPass::Depth:
|
||||
return &Depth;
|
||||
case DrawPass::GBuffer:
|
||||
case DrawPass::GBuffer | DrawPass::GlobalSurfaceAtlas:
|
||||
case DrawPass::GlobalSurfaceAtlas:
|
||||
return useLightmap ? &DefaultLightmap : &Default;
|
||||
#if USE_EDITOR
|
||||
case DrawPass::QuadOverdraw:
|
||||
|
||||
@@ -513,7 +513,7 @@ bool GlobalSurfaceAtlasPass::Render(RenderContext& renderContext, GPUContext* co
|
||||
|
||||
RenderContext renderContextTiles = renderContext;
|
||||
renderContextTiles.List = RenderList::GetFromPool();
|
||||
renderContextTiles.View.Pass = DrawPass::GBuffer;
|
||||
renderContextTiles.View.Pass = DrawPass::GBuffer | DrawPass::GlobalSurfaceAtlas;
|
||||
renderContextTiles.View.Mode = ViewMode::Default;
|
||||
renderContextTiles.View.ModelLODBias += 100000;
|
||||
renderContextTiles.View.ShadowModelLODBias += 100000;
|
||||
@@ -582,7 +582,7 @@ bool GlobalSurfaceAtlasPass::Render(RenderContext& renderContext, GPUContext* co
|
||||
|
||||
// Fake projection matrix to disable Screen Size culling based on RenderTools::ComputeBoundsScreenRadiusSquared
|
||||
renderContextTiles.View.Projection.Values[0][0] = 10000.0f;
|
||||
|
||||
|
||||
// Collect draw calls for the object
|
||||
object.Actor->Draw(renderContextTiles);
|
||||
|
||||
|
||||
@@ -430,7 +430,7 @@ void RenderList::AddDrawCall(DrawPass drawModes, StaticFlags staticFlags, DrawCa
|
||||
{
|
||||
DrawCallsLists[(int32)DrawCallsListType::Depth].Indices.Add(index);
|
||||
}
|
||||
if (mask & DrawPass::GBuffer)
|
||||
if (mask & (DrawPass::GBuffer | DrawPass::GlobalSurfaceAtlas))
|
||||
{
|
||||
if (receivesDecals)
|
||||
DrawCallsLists[(int32)DrawCallsListType::GBuffer].Indices.Add(index);
|
||||
|
||||
Reference in New Issue
Block a user