G1R AngelScript
Scripting reference for the Gothic 1 Remake
Loading...
Searching...
No Matches
ImportanceSampling Namespace Reference

Functions

Math|Random
FVector NextSobolCell3D (int Index, int NumCells=1, FVector PreviousValue=FVector(0.000000, 0.000000, 0.000000))
void ImportanceSample (FImportanceTexture Texture, FVector2D Rand, int Samples, float32 Intensity, FVector2D &SamplePosition, FLinearColor &SampleColor, float32 &SampleIntensity, float32 &SampleSize)
 Distribute sample points proportional to Texture2D luminance.
FImportanceTexture MakeImportanceTexture (UTexture2D Texture, EImportanceWeight WeightingFunc)
 Create an FImportanceTexture object for texture-driven importance sampling from a 2D RGBA8 texture.
FVector2D NextSobolCell2D (int Index, int NumCells=1, FVector2D PreviousValue=FVector2D(0.000000, 0.000000))
void BreakImportanceTexture (FImportanceTexture ImportanceTexture, UTexture2D &Texture, EImportanceWeight &WeightingFunc)
 Get texture used to create an ImportanceTexture object.
float32 NextSobolFloat (int Index, int Dimension, float32 PreviousValue)
FVector2D RandomSobolCell2D (int Index, int NumCells=1, FVector2D Cell=FVector2D(0.000000, 0.000000), FVector2D Seed=FVector2D(0.000000, 0.000000))
FVector RandomSobolCell3D (int Index, int NumCells=1, FVector Cell=FVector(0.000000, 0.000000, 0.000000), FVector Seed=FVector(0.000000, 0.000000, 0.000000))
float32 RandomSobolFloat (int Index, int Dimension, float32 Seed)

Function Documentation

◆ BreakImportanceTexture()

void BreakImportanceTexture ( FImportanceTexture ImportanceTexture,
UTexture2D & Texture,
EImportanceWeight & WeightingFunc )

Get texture used to create an ImportanceTexture object.

Parameters
ImportanceTextureThe source ImportanceTexture object
WeightingFuncHow to turn the texture data into probability weights
Returns
new ImportanceTexture object for use with ImportanceSample

◆ ImportanceSample()

void ImportanceSample ( FImportanceTexture Texture,
FVector2D Rand,
int Samples,
float32 Intensity,
FVector2D & SamplePosition,
FLinearColor & SampleColor,
float32 & SampleIntensity,
float32 & SampleSize )

Distribute sample points proportional to Texture2D luminance.

Parameters
RandRandom 2D point with components evenly distributed between 0 and 1
SamplesTotal number of samples that will be used
IntensityTotal intensity for light

◆ MakeImportanceTexture()

FImportanceTexture MakeImportanceTexture ( UTexture2D Texture,
EImportanceWeight WeightingFunc )

Create an FImportanceTexture object for texture-driven importance sampling from a 2D RGBA8 texture.

Parameters
TextureTexture object to use. Must be RGBA8 format.
WeightingFuncHow to turn the texture data into probability weights
Returns
new ImportanceTexture object for use with ImportanceSample

◆ NextSobolCell2D()

FVector2D NextSobolCell2D ( int Index,
int NumCells = 1,
FVector2D PreviousValue = FVector2D ( 0.000000 , 0.000000 ) )
Parameters
IndexWhich sequential point
NumCellsSize of cell grid, 1 to 32768. Rounded up to the next power of two
PreviousValueThe Sobol value for Index-1
Returns
Sobol-distributed random 2D position in the same grid cell

◆ NextSobolCell3D()

FVector NextSobolCell3D ( int Index,
int NumCells = 1,
FVector PreviousValue = FVector ( 0.000000 , 0.000000 , 0.000000 ) )
Parameters
IndexWhich sequential point
NumCellsSize of cell grid, 1 to 1024. Rounded up to the next power of two
PreviousValueThe Sobol value for Index-1
Returns
Sobol-distributed random 3D position in the same grid cell

◆ NextSobolFloat()

float32 NextSobolFloat ( int Index,
int Dimension,
float32 PreviousValue )
Parameters
IndexWhich sequential point
DimensionWhich Sobol dimension (0 to 15)
PreviousValueThe Sobol value for Index-1
Returns
Sobol-distributed random number between 0 and 1

◆ RandomSobolCell2D()

FVector2D RandomSobolCell2D ( int Index,
int NumCells = 1,
FVector2D Cell = FVector2D ( 0.000000 , 0.000000 ),
FVector2D Seed = FVector2D ( 0.000000 , 0.000000 ) )
Parameters
IndexWhich sequential point in the cell (starting at 0)
NumCellsSize of cell grid, 1 to 32768. Rounded up to the next power of two
CellGive a point from this integer grid cell
SeedRandom 2D seed (components in the range 0-1) to randomize across multiple sequences
Returns
Sobol-distributed random 2D position in the given grid cell

◆ RandomSobolCell3D()

FVector RandomSobolCell3D ( int Index,
int NumCells = 1,
FVector Cell = FVector ( 0.000000 , 0.000000 , 0.000000 ),
FVector Seed = FVector ( 0.000000 , 0.000000 , 0.000000 ) )
Parameters
IndexWhich sequential point in the cell (starting at 0)
NumCellsSize of cell grid, 1 to 1024. Rounded up to the next power of two
CellGive a point from this integer grid cell
SeedRandom 3D seed (components in the range 0-1) to randomize across multiple sequences
Returns
Sobol-distributed random 3D vector in the given grid cell

◆ RandomSobolFloat()

float32 RandomSobolFloat ( int Index,
int Dimension,
float32 Seed )
Parameters
IndexWhich sequential point
DimensionWhich Sobol dimension (0 to 15)
SeedRandom seed (in the range 0-1) to randomize across multiple sequences
Returns
Sobol-distributed random number between 0 and 1