Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions utils/pxrad/qrad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2593,14 +2593,17 @@ void RadWorld( void )
#endif

#ifdef HLRAD_VERTEXLIGHTING
BuildVertexLights(); //BuildFaceLights will get single gi bounce from studiomodels
Msg( "\n" );
VertexDirectLighting(); //BuildFaceLights will get single gi bounce from studiomodels

if( g_numstudiobounce > 0 )
{
g_studiogipasscounter = 1;
VertexPatchLights();
VertexBlendGI();
g_studiogipasscounter = 1;
Msg( "VertexIndirectLighting Prepass\n" );
VertexIndirectGather();
VertexIndirectBlend();
}
Msg( "\n" );
#endif


Expand Down Expand Up @@ -2689,15 +2692,19 @@ void RadWorld( void )


#ifdef HLRAD_VERTEXLIGHTING
Msg( "\n" );
g_studiogipasscounter = 0;
for( int i = 0; i < Q_max( 1, g_numstudiobounce ); i++ )
{
g_studiogipasscounter++;
VertexPatchLights();
VertexBlendGI();
g_studiogipasscounter++;
Msg( "VertexIndirectLighting Pass %d/%d\n", g_studiogipasscounter, g_numstudiobounce );
VertexIndirectGather();
VertexIndirectBlend();
Msg( "\n" );
}

FinalLightVertex();
Msg( "\n" );
#endif

#ifdef HLRAD_AMBIENTCUBES
Expand Down
6 changes: 3 additions & 3 deletions utils/pxrad/qrad.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,10 +539,10 @@ void CalcLuxelsCount( void );
//
// vertexlight.c
//
void BuildVertexLights( void );
void VertexPatchLights( void );
void VertexDirectLighting( void );
void VertexIndirectGather( void );
void FinalLightVertex( void );
void VertexBlendGI( void );
void VertexIndirectBlend( void );

//
// model_lightmaps.c
Expand Down
5 changes: 4 additions & 1 deletion utils/pxrad/trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,10 @@ void InitWorldTrace( void )
#ifdef HLRAD_RAYTRACE
int dispatch = 0, total = 0;
double start = I_FloatTime();
Msg( "Build KD-Trees:\n" );
if( g_studiolegacy )
Msg( "Build KD-Trees:\n" );
else
Msg( "Build BVH-Trees:\n" );
StartPacifier();

for( i = 1; i < g_numentities; i++ )
Expand Down
20 changes: 10 additions & 10 deletions utils/pxrad/vertexlight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void SmoothModelNormals( int modelnum, int threadnum = -1 )
Mem_Free( normals );
}

void BuildVertexLights( int indexnum, int thread = -1 )
void VertexDirectLighting( int indexnum, int thread = -1 )
{
int modelnum = g_vertexlight_indexes[indexnum].modelnum;
int vertexnum = g_vertexlight_indexes[indexnum].vertexnum;
Expand Down Expand Up @@ -310,12 +310,12 @@ void BuildVertexLights( int indexnum, int thread = -1 )

/*
============
VertexPatchLights
VertexIndirectGather

This function is run multithreaded
============
*/
void VertexPatchLights( int indexnum, int threadnum = -1 )
void VertexIndirectGather( int indexnum, int threadnum = -1 )
{
int modelnum = g_vertexlight_indexes[indexnum].modelnum;
int vertexnum = g_vertexlight_indexes[indexnum].vertexnum;
Expand Down Expand Up @@ -485,7 +485,7 @@ void VertexPatchLights( int indexnum, int threadnum = -1 )
AddStylesToMesh( mesh, newstyles );
}

void VertexBlendGI( int modelnum, int threadnum = -1 )
void VertexIndirectBlend( int modelnum, int threadnum = -1 )
{
entity_t *mapent = g_vertexlight[modelnum];
tmesh_t *mesh;
Expand Down Expand Up @@ -924,27 +924,27 @@ static void AllocVertexLighting( void )
// otherwise it's valid
}

void BuildVertexLights( void )
void VertexDirectLighting( void )
{
GenerateLightCacheNumbers();

if( !g_vertexlight_numindexes ) return;

RunThreadsOnIndividual( g_vertexlight_numindexes, true, BuildVertexLights );
RunThreadsOnIndividual( g_vertexlight_numindexes, true, VertexDirectLighting );
}

void VertexPatchLights( void )
void VertexIndirectGather( void )
{
if( !g_vertexlight_numindexes ) return;

RunThreadsOnIndividual( g_vertexlight_numindexes, true, VertexPatchLights );
RunThreadsOnIndividual( g_vertexlight_numindexes, true, VertexIndirectGather );
}

void VertexBlendGI( void )
void VertexIndirectBlend( void )
{
if( !g_vertexlight_modnum ) return;

RunThreadsOnIndividual( g_vertexlight_modnum, true, VertexBlendGI );
RunThreadsOnIndividual( g_vertexlight_modnum, true, VertexIndirectBlend );
}

void FinalLightVertex( void )
Expand Down
Loading