Disable AO for skybox portals (can be forced back with MAPINFO flag).

This commit is contained in:
Marisa Kirisame 2020-12-30 09:58:39 +01:00
parent c59c2431ea
commit d4c4d9310d
5 changed files with 6 additions and 1 deletions

View file

@ -1653,6 +1653,7 @@ MapFlagHandlers[] =
{ "nocoloredspritelighting", MITYPE_SETFLAG3, LEVEL3_NOCOLOREDSPRITELIGHTING, 0 },
{ "forceworldpanning", MITYPE_SETFLAG3, LEVEL3_FORCEWORLDPANNING, 0 },
{ "propermonsterfallingdamage", MITYPE_SETFLAG3, LEVEL3_PROPERMONSTERFALLINGDAMAGE, 0 },
{ "enableskyboxao", MITYPE_SETFLAG3, LEVEL3_SKYBOXAO, 0 },
{ "nobotnodes", MITYPE_IGNORE, 0, 0 }, // Skulltag option: nobotnodes
{ "compat_shorttex", MITYPE_COMPATFLAG, COMPATF_SHORTTEX, 0 },
{ "compat_stairs", MITYPE_COMPATFLAG, COMPATF_STAIRINDEX, 0 },

View file

@ -251,6 +251,7 @@ enum ELevelFlags : unsigned int
LEVEL3_FORCEWORLDPANNING = 0x00000080, // Forces the world panning flag for all textures, even those without it explicitly set.
LEVEL3_HIDEAUTHORNAME = 0x00000100,
LEVEL3_PROPERMONSTERFALLINGDAMAGE = 0x00000200, // Properly apply falling damage to the monsters
LEVEL3_SKYBOXAO = 0x00000400, // Apply SSAO to sector skies
};

View file

@ -672,7 +672,7 @@ void HWDrawInfo::DrawScene(int drawmode)
}
else if (drawmode == DM_PORTAL && ssao_portals_available > 0)
{
applySSAO = true;
applySSAO = (mCurrentPortal->AllowSSAO() || Level->flags3&LEVEL3_SKYBOXAO);
ssao_portals_available--;
}

View file

@ -718,6 +718,7 @@ void HWSkyboxPortal::Shutdown(HWDrawInfo *di, FRenderState &rstate)
}
const char *HWSkyboxPortal::GetName() { return "Skybox"; }
bool HWSkyboxPortal::AllowSSAO() { return false; } // [MK] sector skyboxes don't allow SSAO by default
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------

View file

@ -77,6 +77,7 @@ public:
virtual line_t *ClipLine() { return nullptr; }
virtual void * GetSource() const = 0; // GetSource MUST be implemented!
virtual const char *GetName() = 0;
virtual bool AllowSSAO() { return true; }
virtual bool IsSky() { return false; }
virtual bool NeedCap() { return true; }
virtual bool NeedDepthBuffer() { return true; }
@ -258,6 +259,7 @@ protected:
virtual void * GetSource() const { return portal; }
virtual bool IsSky() { return true; }
virtual const char *GetName();
virtual bool AllowSSAO() override;
public: