This commit is contained in:
2024-11-07 00:08:08 +03:00
parent 471a840ed9
commit e7621d9e52
13 changed files with 64 additions and 4 deletions

View File

@@ -1 +1 @@
devtools\bin\vpc.exe /hl2 /episodic +everything /mksln everything.sln
devtools\bin\vpc.exe /hl2 /episodic +everything /mksln everything.sln /f

View File

@@ -23,7 +23,7 @@ class C_EnvProjectedTexture : public C_BaseEntity
{
DECLARE_CLASS( C_EnvProjectedTexture, C_BaseEntity );
public:
DECLARE_CLIENTCLASS();
DECLARE_CLIENTCLASS()
void SetMaterial( IMaterial *pMaterial );
void SetLightColor( byte r, byte g, byte b, byte a );
@@ -35,6 +35,7 @@ public:
#ifdef MAPBASE
virtual void Simulate();
virtual void Spawn();
#else
virtual bool Simulate();
#endif
@@ -96,6 +97,8 @@ private:
bool m_bAlwaysDraw;
//bool m_bProjectedTextureVersion;
CTextureReference m_depthTex; // Depth-stencil surface
#endif
Vector m_vecExtentsMin;

View File

@@ -114,6 +114,24 @@ C_EnvProjectedTexture::C_EnvProjectedTexture( void )
#endif
}
void C_EnvProjectedTexture::Spawn()
{
BaseClass::Spawn();
#ifdef MAPBASE
materials->BeginRenderTargetAllocation();
ImageFormat dstFormat = materials->GetShadowDepthTextureFormat(); // Vendor-dependent depth texture format
materials->BeginRenderTargetAllocation();
char strRTName[64];
Q_snprintf(strRTName, ARRAYSIZE(strRTName), "_rt_InternalShadowDepthTexture_%d", entindex()); //use entindex for individual rt name
m_depthTex.InitRenderTarget(512, 512, RT_SIZE_NO_CHANGE, dstFormat, MATERIAL_RT_DEPTH_NONE, false, strRTName);
materials->EndRenderTargetAllocation();
#endif
}
C_EnvProjectedTexture::~C_EnvProjectedTexture( void )
{
ShutDownLightHandle();
@@ -146,6 +164,22 @@ void C_EnvProjectedTexture::OnDataChanged( DataUpdateType_t updateType )
{
if ( updateType == DATA_UPDATE_CREATED )
{
//if(m_depthTex.IsValid()) m_depthTex.Shutdown();
//
//materials->BeginRenderTargetAllocation();
//
//ImageFormat dstFormat = materials->GetShadowDepthTextureFormat(); // Vendor-dependent depth texture format
//materials->BeginRenderTargetAllocation();
//
//char strRTName[64];
//Q_snprintf(strRTName, ARRAYSIZE(strRTName), "_rt_ShadowDepthTexture_%d", entindex()); //use entindex for individual rt name
//
//m_depthTex.InitRenderTarget(512, 512, RT_SIZE_NO_CHANGE, dstFormat, MATERIAL_RT_DEPTH_NONE, false, strRTName);
//
//materials->EndRenderTargetAllocation();
m_SpotlightTexture.Init( m_SpotlightTextureName, TEXTURE_GROUP_OTHER, true );
}
#ifdef MAPBASE
@@ -406,6 +440,7 @@ void C_EnvProjectedTexture::UpdateLight( void )
state.m_flShadowDepthBias = mat_depthbias_shadowmap.GetFloat();
state.m_flShadowAtten = m_flShadowAtten;
state.m_flShadowFilterSize = m_flShadowFilter;
state.m_pShadowDepthTexture = m_depthTex;
#else
state.m_fQuadraticAtten = 0.0;
state.m_fLinearAtten = 100;

View File

@@ -4544,6 +4544,8 @@ void CClientShadowMgr::ComputeShadowDepthTextures( const CViewSetup &viewSetup )
// Render to the shadow depth texture with appropriate view
view->UpdateShadowDepthTexture( m_DummyColorTexture, shadowDepthTexture, shadowView );
//view->UpdateShadowDepthTexture( m_DummyColorTexture, shadowDepthTexture, shadowView );
view->UpdateShadowDepthTexture( m_DummyColorTexture, (flashlightState.m_pShadowDepthTexture), shadowView );
#ifdef MAPBASE
if ( j <= ( INT_FLASHLIGHT_DEPTHTEXTURE_FALLBACK_LAST - INT_FLASHLIGHT_DEPTHTEXTURE_FALLBACK_FIRST ) )

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -31,7 +31,7 @@
#include "materialsystem/imaterialsystemhardwareconfig.h"
#include "materialsystem/IColorCorrection.h"
#include "materialsystem/itexture.h"
//-----------------------------------------------------------------------------
// forward declarations
//-----------------------------------------------------------------------------
@@ -415,6 +415,8 @@ struct MaterialVideoMode_t
int m_RefreshRate; // 0 == default (ignored for windowed mode)
};
class CTextureReference;
// fixme: should move this into something else.
struct FlashlightState_t
{
@@ -455,6 +457,9 @@ struct FlashlightState_t
m_fBrightnessScale = 1.0f;
m_pSpotlightTexture = NULL;
#endif
#ifdef MAPBASE
//m_pShadowDepthTexture = NULL;
#endif
}
@@ -496,6 +501,7 @@ struct FlashlightState_t
#ifdef MAPBASE
bool m_bAlwaysDraw;
ITexture *m_pShadowDepthTexture;
#endif
// Getters for scissor members

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs />
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@@ -10,7 +10,7 @@
$Conditional VS2015 "0" // Toggles Visual Studio 2015 (v140) toolset
$Conditional VS2017 "0" // Toggles Visual Studio 2017 (v141) toolset
$Conditional VS2019 "0" // Toggles Visual Studio 2019 (v142) toolset
$Conditional VS2022 "0" // Toggles Visual Studio 2022 (v143) toolset
$Conditional VS2022 "1" // Toggles Visual Studio 2022 (v143) toolset
//
// VPC may still say "Generating for Visual Studio 2013" even when using one of the above toolsets. This message is irrelevant and can be ignored.