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
4 changes: 2 additions & 2 deletions utils/pxrad/ambientcube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ static void CalcRayAmbientLighting( int threadnum, const vec3_t vStart, const ve
if( trace.surface == STUDIO_SURFACE_HIT )
{
for (int i = 0; i < MAXLIGHTMAPS; i++ )
if( (trace.styles[i] == LS_NORMAL)||(trace.styles[i] == LS_SKY)) //only sun and default style
if( (trace.styles[i] == LS_NORMAL)||(trace.styles[i] == LS_SKY)||(trace.styles[i] == g_skystyle)) //only sun, sky and default style
VectorAdd( radcolor, trace.light[i], radcolor );
//Msg( "model hit, color %f %f %f\n", radcolor[0], radcolor[1], radcolor[2] );
return;
Expand All @@ -296,7 +296,7 @@ static void CalcRayAmbientLighting( int threadnum, const vec3_t vStart, const ve
scaleAvg = 4.0f * M_PI / ((float)NUMVERTEXNORMALS * scaleAvg); //ratio of ray cone and face solid angles
scaleAvg = bound( 0.0f, scaleAvg, 1.0f );
for (int i = 0; i < MAXLIGHTMAPS; i++ )
if( (info.styles[i] == LS_NORMAL)||(info.styles[i] == LS_SKY)) //only sun and default style
if( (info.styles[i] == LS_NORMAL)||(info.styles[i] == LS_SKY)||(info.styles[i] == g_skystyle)) //only sun, sky and default style
{
VectorLerp( info.diffuse[i], scaleAvg, info.average[i], temp_color );
VectorAdd( radcolor, temp_color, radcolor );
Expand Down
4 changes: 3 additions & 1 deletion utils/pxrad/lightmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2589,7 +2589,7 @@ vec3_t *s_light, vec3_t *s_dir, vec_t *s_occ, byte *styles, byte *vislight, bool
VectorScale( add, 4.0f * g_indirect_sun / (float)g_numskynormals[skylevel], add );
VectorScale( add_direction, 4.0f * g_indirect_sun / (float)g_numskynormals[skylevel], add_direction );

AddSampleLight( threadnum, topatch, add, add_direction, LS_NORMAL, s_light, s_dir, s_occ, styles );
AddSampleLight( threadnum, topatch, add, add_direction, g_skystyle, s_light, s_dir, s_occ, styles );
}
}

Expand Down Expand Up @@ -4408,6 +4408,8 @@ void ReduceLightmap( void )
SetKeyValue( &g_entities[0], "_smooth", va( "%.2f", g_smoothvalue ));
if( g_hdrcompresslog )
SetKeyValue( &g_entities[0], "_hdr", "compress_log" );
if( g_skystyle )
SetKeyValue( &g_entities[0], "_skystyle", va( "%d", g_skystyle ));

int oldsize = g_lightdatasize;

Expand Down
14 changes: 10 additions & 4 deletions utils/pxrad/qrad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ rgbdata_t *g_skytextures[6];
vec_t g_lightprobeepsilon = DEFAULT_LIGHTPROBE_EPSILON;
bool g_vertexblur = false;
uint g_numstudiobounce = DEFAULT_STUDIO_BOUNCE;
int g_studiogipasscounter = 0;
int g_studiogipasscounter = 0;
vec3_t *g_studioskynormals;
int g_numstudioskynormals;
int g_numstudioskynormals;
bool g_noemissive = false;

int g_skystyle = LS_NORMAL;


bool g_drawsample = false;
Expand Down Expand Up @@ -2761,6 +2761,7 @@ static void PrintRadUsage( void )
Msg( " -studiobounce #: set number of studio model radiosity bounces. default is %d\n", DEFAULT_STUDIO_BOUNCE );
Msg( " -vertexblur : blur per-vertex lighting\n" );
Msg( " -noemissive : do not add emissive textures to the lightmap\n" );
Msg( " -skystyle # : set lightstyle for sky lighting. default is %d\n", LS_NORMAL );

#ifdef HLRAD_PARANOIA_BUMP
Msg( " -gammamode # : gamma correction mode (0, 1, 2)\n" );
Expand Down Expand Up @@ -2925,7 +2926,12 @@ int main( int argc, char **argv )
else if( !Q_strcmp( argv[i], "-noemissive" ))
{
g_noemissive = true;
}
}
else if( !Q_strcmp( argv[i], "-skystyle" ))
{
g_skystyle = atoi( argv[i+1] );
i++;
}
else if( !Q_strcmp( argv[i], "-chop" ))
{
g_chop = (float)atof( argv[i+1] );
Expand Down
1 change: 1 addition & 0 deletions utils/pxrad/qrad.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ extern int g_studiogipasscounter;
extern vec3_t *g_studioskynormals;
extern int g_numstudioskynormals;
extern bool g_noemissive;
extern int g_skystyle;

//
// ambientcube.c
Expand Down
4 changes: 2 additions & 2 deletions utils/pxrad/vertexlight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,12 @@ void VertexPatchLights( int indexnum, int threadnum = -1 )
continue;

for( lightstyles = 0; lightstyles < MAXLIGHTMAPS && newstyles[lightstyles] != 255; lightstyles++ )
if( newstyles[lightstyles] == LS_NORMAL )
if( newstyles[lightstyles] == g_skystyle )
break;
if( lightstyles == MAXLIGHTMAPS ) // overflowed
continue;
else if( newstyles[lightstyles] == 255 )
newstyles[lightstyles] = LS_NORMAL;
newstyles[lightstyles] = g_skystyle;

GetSkyColor( skynormals[j], temp_color );

Expand Down
Loading