Fix GlobalSDF and GlobalSurfaceAtlas drawing if disabled by user
This commit is contained in:
@@ -258,12 +258,14 @@ void StaticModel::Draw(RenderContext& renderContext)
|
||||
return;
|
||||
if (renderContext.View.Pass == DrawPass::GlobalSDF)
|
||||
{
|
||||
GlobalSignDistanceFieldPass::Instance()->RasterizeModelSDF(this, Model->SDF, _transform, _box);
|
||||
if (DrawModes & DrawPass::GlobalSDF)
|
||||
GlobalSignDistanceFieldPass::Instance()->RasterizeModelSDF(this, Model->SDF, _transform, _box);
|
||||
return;
|
||||
}
|
||||
if (renderContext.View.Pass == DrawPass::GlobalSurfaceAtlas)
|
||||
{
|
||||
GlobalSurfaceAtlasPass::Instance()->RasterizeActor(this, this, _sphere, _transform, Model->LODs.Last().GetBox());
|
||||
if (DrawModes & DrawPass::GlobalSurfaceAtlas)
|
||||
GlobalSurfaceAtlasPass::Instance()->RasterizeActor(this, this, _sphere, _transform, Model->LODs.Last().GetBox());
|
||||
return;
|
||||
}
|
||||
Matrix world;
|
||||
|
||||
@@ -509,6 +509,8 @@ void Terrain::Draw(RenderContext& renderContext)
|
||||
return;
|
||||
if (renderContext.View.Pass == DrawPass::GlobalSDF)
|
||||
{
|
||||
if ((DrawModes & DrawPass::GlobalSDF) == 0)
|
||||
return;
|
||||
const float chunkSize = TERRAIN_UNITS_PER_VERTEX * (float)_chunkSize;
|
||||
const float posToUV = 0.25f / chunkSize;
|
||||
Float4 localToUV(posToUV, posToUV, 0.0f, 0.0f);
|
||||
@@ -527,6 +529,8 @@ void Terrain::Draw(RenderContext& renderContext)
|
||||
}
|
||||
if (renderContext.View.Pass == DrawPass::GlobalSurfaceAtlas)
|
||||
{
|
||||
if ((DrawModes & DrawPass::GlobalSurfaceAtlas) == 0)
|
||||
return;
|
||||
for (TerrainPatch* patch : _patches)
|
||||
{
|
||||
if (!patch->Heightmap)
|
||||
|
||||
Reference in New Issue
Block a user