Updated the SDK with the latest code from the TF and HL2 branches.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
//
|
||||
// QC_EYES.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// QC_EYES.RC2 - resources Microsoft Visual C++ does not edit directly
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Add manually edited resources here...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -54,6 +54,8 @@ struct StaticPropBuild_t
|
||||
float m_flForcedFadeScale;
|
||||
unsigned short m_nMinDXLevel;
|
||||
unsigned short m_nMaxDXLevel;
|
||||
int m_LightmapResolutionX;
|
||||
int m_LightmapResolutionY;
|
||||
};
|
||||
|
||||
|
||||
@@ -516,6 +518,9 @@ static void AddStaticPropToLump( StaticPropBuild_t const& build )
|
||||
}
|
||||
}
|
||||
|
||||
propLump.m_nLightmapResolutionX = build.m_LightmapResolutionX;
|
||||
propLump.m_nLightmapResolutionY = build.m_LightmapResolutionY;
|
||||
|
||||
// Add the leaves to the leaf lump
|
||||
for (int j = 0; j < leafList.Size(); ++j)
|
||||
{
|
||||
@@ -523,6 +528,7 @@ static void AddStaticPropToLump( StaticPropBuild_t const& build )
|
||||
insert.m_Leaf = leafList[j];
|
||||
s_StaticPropLeafLump.AddToTail( insert );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -619,6 +625,18 @@ void EmitStaticProps()
|
||||
build.m_Flags |= STATIC_PROP_SCREEN_SPACE_FADE;
|
||||
}
|
||||
|
||||
if (IntForKey( &entities[i], "generatelightmaps") == 0)
|
||||
{
|
||||
build.m_Flags |= STATIC_PROP_NO_PER_TEXEL_LIGHTING;
|
||||
build.m_LightmapResolutionX = 0;
|
||||
build.m_LightmapResolutionY = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
build.m_LightmapResolutionX = IntForKey( &entities[i], "lightmapresolutionx" );
|
||||
build.m_LightmapResolutionY = IntForKey( &entities[i], "lightmapresolutiony" );
|
||||
}
|
||||
|
||||
const char *pKey = ValueForKey( &entities[i], "fadescale" );
|
||||
if ( pKey && pKey[0] )
|
||||
{
|
||||
|
||||
@@ -3548,30 +3548,51 @@ static void LinearToBumpedLightmap(
|
||||
// Convert a RGBExp32 to a RGBA8888
|
||||
// This matches the engine's conversion, so the lighting result is consistent.
|
||||
//-----------------------------------------------------------------------------
|
||||
void ConvertRGBExp32ToRGBA8888( const ColorRGBExp32 *pSrc, unsigned char *pDst )
|
||||
void ConvertRGBExp32ToRGBA8888( const ColorRGBExp32 *pSrc, unsigned char *pDst, Vector* _optOutLinear )
|
||||
{
|
||||
Vector linearColor;
|
||||
Vector vertexColor;
|
||||
|
||||
// convert from ColorRGBExp32 to linear space
|
||||
linearColor[0] = TexLightToLinear( ((ColorRGBExp32 *)pSrc)->r, ((ColorRGBExp32 *)pSrc)->exponent );
|
||||
linearColor[1] = TexLightToLinear( ((ColorRGBExp32 *)pSrc)->g, ((ColorRGBExp32 *)pSrc)->exponent );
|
||||
linearColor[2] = TexLightToLinear( ((ColorRGBExp32 *)pSrc)->b, ((ColorRGBExp32 *)pSrc)->exponent );
|
||||
|
||||
ConvertLinearToRGBA8888( &linearColor, pDst );
|
||||
if ( _optOutLinear )
|
||||
*_optOutLinear = linearColor;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Converts a RGBExp32 to a linear color value.
|
||||
//-----------------------------------------------------------------------------
|
||||
void ConvertRGBExp32ToLinear(const ColorRGBExp32 *pSrc, Vector* pDst)
|
||||
{
|
||||
|
||||
(*pDst)[0] = TexLightToLinear(((ColorRGBExp32 *)pSrc)->r, ((ColorRGBExp32 *)pSrc)->exponent);
|
||||
(*pDst)[1] = TexLightToLinear(((ColorRGBExp32 *)pSrc)->g, ((ColorRGBExp32 *)pSrc)->exponent);
|
||||
(*pDst)[2] = TexLightToLinear(((ColorRGBExp32 *)pSrc)->b, ((ColorRGBExp32 *)pSrc)->exponent);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Converts a linear color value (suitable for combining linearly) to an RBGA8888 value expected by the engine.
|
||||
//-----------------------------------------------------------------------------
|
||||
void ConvertLinearToRGBA8888(const Vector *pSrcLinear, unsigned char *pDst)
|
||||
{
|
||||
Vector vertexColor;
|
||||
|
||||
// convert from linear space to lightmap space
|
||||
// cannot use mathlib routine directly because it doesn't match
|
||||
// the colorspace version found in the engine, which *is* the same sequence here
|
||||
vertexColor[0] = LinearToVertexLight( linearColor[0] );
|
||||
vertexColor[1] = LinearToVertexLight( linearColor[1] );
|
||||
vertexColor[2] = LinearToVertexLight( linearColor[2] );
|
||||
vertexColor[0] = LinearToVertexLight((*pSrcLinear)[0]);
|
||||
vertexColor[1] = LinearToVertexLight((*pSrcLinear)[1]);
|
||||
vertexColor[2] = LinearToVertexLight((*pSrcLinear)[2]);
|
||||
|
||||
// this is really a color normalization with a floor
|
||||
ColorClamp( vertexColor );
|
||||
ColorClamp(vertexColor);
|
||||
|
||||
// final [0..255] scale
|
||||
pDst[0] = RoundFloatToByte( vertexColor[0] * 255.0f );
|
||||
pDst[1] = RoundFloatToByte( vertexColor[1] * 255.0f );
|
||||
pDst[2] = RoundFloatToByte( vertexColor[2] * 255.0f );
|
||||
pDst[0] = RoundFloatToByte(vertexColor[0] * 255.0f);
|
||||
pDst[1] = RoundFloatToByte(vertexColor[1] * 255.0f);
|
||||
pDst[2] = RoundFloatToByte(vertexColor[2] * 255.0f);
|
||||
pDst[3] = 255;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,8 @@ bool g_bDumpRtEnv = false;
|
||||
bool bRed2Black = true;
|
||||
bool g_bFastAmbient = false;
|
||||
bool g_bNoSkyRecurse = false;
|
||||
bool g_bDumpPropLightmaps = false;
|
||||
|
||||
|
||||
int junk;
|
||||
|
||||
@@ -2404,6 +2406,10 @@ int ParseCommandLine( int argc, char **argv, bool *onlydetail )
|
||||
{
|
||||
g_bLargeDispSampleRadius = true;
|
||||
}
|
||||
else if (!Q_stricmp( argv[i], "-dumppropmaps"))
|
||||
{
|
||||
g_bDumpPropLightmaps = true;
|
||||
}
|
||||
else if (!Q_stricmp(argv[i],"-bounce"))
|
||||
{
|
||||
if ( ++i < argc )
|
||||
|
||||
@@ -281,6 +281,7 @@ extern qboolean g_bLowPriority;
|
||||
extern qboolean do_fast;
|
||||
extern bool g_bInterrupt; // Was used with background lighting in WC. Tells VRAD to stop lighting.
|
||||
extern IIncremental *g_pIncremental; // null if not doing incremental lighting
|
||||
extern bool g_bDumpPropLightmaps;
|
||||
|
||||
extern float g_flSkySampleScale; // extra sampling factor for indirect light
|
||||
|
||||
@@ -363,7 +364,10 @@ void BuildFacelights (int facenum, int threadnum);
|
||||
void PrecompLightmapOffsets();
|
||||
void FinalLightFace (int threadnum, int facenum);
|
||||
void PvsForOrigin (Vector& org, byte *pvs);
|
||||
void ConvertRGBExp32ToRGBA8888( const ColorRGBExp32 *pSrc, unsigned char *pDst );
|
||||
void ConvertRGBExp32ToRGBA8888( const ColorRGBExp32 *pSrc, unsigned char *pDst, Vector* _optOutLinear = NULL );
|
||||
void ConvertRGBExp32ToLinear(const ColorRGBExp32 *pSrc, Vector* pDst);
|
||||
void ConvertLinearToRGBA8888( const Vector *pSrc, unsigned char *pDst );
|
||||
|
||||
|
||||
inline byte PVSCheck( const byte *pvs, int iCluster )
|
||||
{
|
||||
|
||||
@@ -738,7 +738,9 @@ void ComputeIndirectLightingAtPoint( Vector &position, Vector &normal, Vector &o
|
||||
ColorRGBExp32ToVector( *pLightmap, lightmapColor );
|
||||
}
|
||||
|
||||
VectorMultiply( lightmapColor, dtexdata[pTex->texdata].reflectivity, lightmapColor );
|
||||
float invLengthSqr = 1.0f / (1.0f + ((vEnd - position) * surfEnum.m_HitFrac / 128.0).LengthSqr());
|
||||
// Include falloff using invsqrlaw.
|
||||
VectorMultiply( lightmapColor, invLengthSqr * dtexdata[pTex->texdata].reflectivity, lightmapColor );
|
||||
VectorAdd( outColor, lightmapColor, outColor );
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@ $Configuration
|
||||
$Compiler
|
||||
{
|
||||
$Create/UsePrecompiledHeader "Use Precompiled Header (/Yu)"
|
||||
$PrecompiledHeaderFile "Debug/vrad_launcher.pch"
|
||||
$PrecompiledHeaderFile "$(IntDir)/vrad_launcher.pch"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user