Skip to content

Commit 866ede5

Browse files
authored
utils: pxrad: renamed vertex lighting procedures (#277)
1 parent 805f974 commit 866ede5

4 files changed

Lines changed: 31 additions & 21 deletions

File tree

utils/pxrad/qrad.cpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2593,14 +2593,17 @@ void RadWorld( void )
25932593
#endif
25942594

25952595
#ifdef HLRAD_VERTEXLIGHTING
2596-
BuildVertexLights(); //BuildFaceLights will get single gi bounce from studiomodels
2596+
Msg( "\n" );
2597+
VertexDirectLighting(); //BuildFaceLights will get single gi bounce from studiomodels
25972598

25982599
if( g_numstudiobounce > 0 )
25992600
{
2600-
g_studiogipasscounter = 1;
2601-
VertexPatchLights();
2602-
VertexBlendGI();
2601+
g_studiogipasscounter = 1;
2602+
Msg( "VertexIndirectLighting Prepass\n" );
2603+
VertexIndirectGather();
2604+
VertexIndirectBlend();
26032605
}
2606+
Msg( "\n" );
26042607
#endif
26052608

26062609

@@ -2689,15 +2692,19 @@ void RadWorld( void )
26892692

26902693

26912694
#ifdef HLRAD_VERTEXLIGHTING
2695+
Msg( "\n" );
26922696
g_studiogipasscounter = 0;
26932697
for( int i = 0; i < Q_max( 1, g_numstudiobounce ); i++ )
26942698
{
2695-
g_studiogipasscounter++;
2696-
VertexPatchLights();
2697-
VertexBlendGI();
2699+
g_studiogipasscounter++;
2700+
Msg( "VertexIndirectLighting Pass %d/%d\n", g_studiogipasscounter, g_numstudiobounce );
2701+
VertexIndirectGather();
2702+
VertexIndirectBlend();
2703+
Msg( "\n" );
26982704
}
26992705

27002706
FinalLightVertex();
2707+
Msg( "\n" );
27012708
#endif
27022709

27032710
#ifdef HLRAD_AMBIENTCUBES

utils/pxrad/qrad.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,10 @@ void CalcLuxelsCount( void );
539539
//
540540
// vertexlight.c
541541
//
542-
void BuildVertexLights( void );
543-
void VertexPatchLights( void );
542+
void VertexDirectLighting( void );
543+
void VertexIndirectGather( void );
544544
void FinalLightVertex( void );
545-
void VertexBlendGI( void );
545+
void VertexIndirectBlend( void );
546546

547547
//
548548
// model_lightmaps.c

utils/pxrad/trace.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,10 @@ void InitWorldTrace( void )
867867
#ifdef HLRAD_RAYTRACE
868868
int dispatch = 0, total = 0;
869869
double start = I_FloatTime();
870-
Msg( "Build KD-Trees:\n" );
870+
if( g_studiolegacy )
871+
Msg( "Build KD-Trees:\n" );
872+
else
873+
Msg( "Build BVH-Trees:\n" );
871874
StartPacifier();
872875

873876
for( i = 1; i < g_numentities; i++ )

utils/pxrad/vertexlight.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ void SmoothModelNormals( int modelnum, int threadnum = -1 )
169169
Mem_Free( normals );
170170
}
171171

172-
void BuildVertexLights( int indexnum, int thread = -1 )
172+
void VertexDirectLighting( int indexnum, int thread = -1 )
173173
{
174174
int modelnum = g_vertexlight_indexes[indexnum].modelnum;
175175
int vertexnum = g_vertexlight_indexes[indexnum].vertexnum;
@@ -310,12 +310,12 @@ void BuildVertexLights( int indexnum, int thread = -1 )
310310

311311
/*
312312
============
313-
VertexPatchLights
313+
VertexIndirectGather
314314
315315
This function is run multithreaded
316316
============
317317
*/
318-
void VertexPatchLights( int indexnum, int threadnum = -1 )
318+
void VertexIndirectGather( int indexnum, int threadnum = -1 )
319319
{
320320
int modelnum = g_vertexlight_indexes[indexnum].modelnum;
321321
int vertexnum = g_vertexlight_indexes[indexnum].vertexnum;
@@ -485,7 +485,7 @@ void VertexPatchLights( int indexnum, int threadnum = -1 )
485485
AddStylesToMesh( mesh, newstyles );
486486
}
487487

488-
void VertexBlendGI( int modelnum, int threadnum = -1 )
488+
void VertexIndirectBlend( int modelnum, int threadnum = -1 )
489489
{
490490
entity_t *mapent = g_vertexlight[modelnum];
491491
tmesh_t *mesh;
@@ -924,27 +924,27 @@ static void AllocVertexLighting( void )
924924
// otherwise it's valid
925925
}
926926

927-
void BuildVertexLights( void )
927+
void VertexDirectLighting( void )
928928
{
929929
GenerateLightCacheNumbers();
930930

931931
if( !g_vertexlight_numindexes ) return;
932932

933-
RunThreadsOnIndividual( g_vertexlight_numindexes, true, BuildVertexLights );
933+
RunThreadsOnIndividual( g_vertexlight_numindexes, true, VertexDirectLighting );
934934
}
935935

936-
void VertexPatchLights( void )
936+
void VertexIndirectGather( void )
937937
{
938938
if( !g_vertexlight_numindexes ) return;
939939

940-
RunThreadsOnIndividual( g_vertexlight_numindexes, true, VertexPatchLights );
940+
RunThreadsOnIndividual( g_vertexlight_numindexes, true, VertexIndirectGather );
941941
}
942942

943-
void VertexBlendGI( void )
943+
void VertexIndirectBlend( void )
944944
{
945945
if( !g_vertexlight_modnum ) return;
946946

947-
RunThreadsOnIndividual( g_vertexlight_modnum, true, VertexBlendGI );
947+
RunThreadsOnIndividual( g_vertexlight_modnum, true, VertexIndirectBlend );
948948
}
949949

950950
void FinalLightVertex( void )

0 commit comments

Comments
 (0)