Lowered irradiance probe resolution to ( 16 + 2 )^2

This commit is contained in:
Robert Beckebans 2021-04-23 00:36:14 +02:00
parent f3ee2baac8
commit 8d1e7c5afd
5 changed files with 270 additions and 260 deletions

View file

@ -108,7 +108,7 @@ void main( PS_IN fragment, out PS_OUT result )
// offset by one pixel border bleed size for linear filtering
#if 1
float2 octCoordNormalizedToTextureDimensions = ( normalizedOctCoordZeroOne * ( 32.0 / ( 34.0 * 1.0 ) ) );
float2 octCoordNormalizedToTextureDimensions = ( normalizedOctCoordZeroOne * ( 16.0 / 18.0 ) );
float2 probeTopLeftPosition;
probeTopLeftPosition.x = ( gridCoord[0] * gridStep[0] + gridCoord[2] * gridStep[1] ) * 2.0 + 1.0;

View file

@ -333,7 +333,7 @@ void main( PS_IN fragment, out PS_OUT result )
// offset by one pixel border bleed size for linear filtering
#if 1
float2 octCoordNormalizedToTextureDimensions = ( ( normalizedOctCoordZeroOne + atlasOffset ) * ( 32.0 / ( 34.0 * 1.0 ) ) );
float2 octCoordNormalizedToTextureDimensions = ( ( normalizedOctCoordZeroOne + atlasOffset ) * ( 16.0 / 18.0 ) );
float2 probeTopLeftPosition;
probeTopLeftPosition.x = ( gridCoord2[0] * gridStep[0] + gridCoord2[2] * gridStep[1] ) * 2.0 + 1.0;

View file

@ -513,7 +513,7 @@ struct calcEnvprobeParms_t
static const int LIGHTGRID_IRRADIANCE_SIZE = ( 16 * 2 ) + 2;
static const int LIGHTGRID_IRRADIANCE_SIZE = ( 16 * 1 ) + 2;
struct calcLightGridPointParms_t
{

File diff suppressed because it is too large Load diff

View file

@ -405,8 +405,16 @@ void idRenderWorldLocal::LoadLightGridImages()
for( int i = 0; i < numPortalAreas; i++ )
{
portalArea_t* area = &portalAreas[i];
filename.Format( "env/%s/area%i_lightgrid_amb", baseName.c_str(), i );
area->lightGrid.irradianceImage = globalImages->ImageFromFile( filename, TF_LINEAR, TR_CLAMP, TD_R11G11B10F, CF_2D );
if( !area->lightGrid.irradianceImage )
{
filename.Format( "env/%s/area%i_lightgrid_amb", baseName.c_str(), i );
area->lightGrid.irradianceImage = globalImages->ImageFromFile( filename, TF_LINEAR, TR_CLAMP, TD_R11G11B10F, CF_2D );
}
else
{
area->lightGrid.irradianceImage->Reload( false );
}
}
}
@ -452,6 +460,8 @@ void idRenderWorldLocal::WriteLightGridsToFile( const char* filename )
void idRenderWorldLocal::WriteLightGrid( idFile* fp, const LightGrid& lightGrid )
{
// TODO write used irradiance resolution
fp->WriteFloatString( "lightGridPoints { /* area = */ %i /* numLightGridPoints = */ %i\n", lightGrid.area, lightGrid.lightGridPoints.Num() );
fp->WriteFloatString( "/* gridMins */ " );