unreal.ImportanceSamplingLibrary

class unreal.ImportanceSamplingLibrary(outer=None, name='None')

Bases: unreal.BlueprintFunctionLibrary

Importance Sampling Library

C++ Source:

  • Module: Engine

  • File: ImportanceSamplingLibrary.h

classmethod importance_sample(texture, rand, samples, intensity) -> (sample_position=Vector2D, sample_color=LinearColor, sample_intensity=float, sample_size=float)

Distribute sample points proportional to Texture2D luminance. outparam: SamplePosition - Importance sampled 2D output texture coordinate (0-1) outparam: SampleColor - Representative color near Position from MIP level for SampleSize outparam: SampleIntensity - Intensity of individual points, scaled by probability and number of samples outparam: SampleSize - Local density of points near Position (scaled for 1x1 texture space)

Parameters
  • texture (ImportanceTexture) –

  • rand (Vector2D) – Random 2D point with components evenly distributed between 0 and 1

  • samples (int32) – Total number of samples that will be used

  • intensity (float) – Total intensity for light

Returns

sample_position (Vector2D):

sample_color (LinearColor):

sample_intensity (float):

sample_size (float):

Return type

tuple

classmethod next_sobol_cell2d(index, num_cells=1, previous_value=[0.0, 0.0])Vector2D
Parameters
  • index (int32) – Which sequential point

  • num_cells (int32) – Size of cell grid, 1 to 32768. Rounded up to the next power of two

  • previous_value (Vector2D) – The Sobol value for Index-1

Returns

Sobol-distributed random 2D position in the same grid cell

Return type

Vector2D

classmethod next_sobol_cell3d(index, num_cells=1, previous_value=[0.0, 0.0, 0.0])Vector
Parameters
  • index (int32) – Which sequential point

  • num_cells (int32) – Size of cell grid, 1 to 1024. Rounded up to the next power of two

  • previous_value (Vector) – The Sobol value for Index-1

Returns

Sobol-distributed random 3D position in the same grid cell

Return type

Vector

classmethod next_sobol_float(index, dimension, previous_value)float
Parameters
  • index (int32) – Which sequential point

  • dimension (int32) – Which Sobol dimension (0 to 15)

  • previous_value (float) – The Sobol value for Index-1

Returns

Sobol-distributed random number between 0 and 1

Return type

float

classmethod random_sobol_cell2d(index, num_cells=1, cell=[0.0, 0.0], seed=[0.0, 0.0])Vector2D
Parameters
  • index (int32) – Which sequential point in the cell (starting at 0)

  • num_cells (int32) – Size of cell grid, 1 to 32768. Rounded up to the next power of two

  • cell (Vector2D) – Give a point from this integer grid cell

  • seed (Vector2D) – Random 2D seed (components in the range 0-1) to randomize across multiple sequences

Returns

Sobol-distributed random 2D position in the given grid cell

Return type

Vector2D

classmethod random_sobol_cell3d(index, num_cells=1, cell=[0.0, 0.0, 0.0], seed=[0.0, 0.0, 0.0])Vector
Parameters
  • index (int32) – Which sequential point in the cell (starting at 0)

  • num_cells (int32) – Size of cell grid, 1 to 1024. Rounded up to the next power of two

  • cell (Vector) – Give a point from this integer grid cell

  • seed (Vector) – Random 3D seed (components in the range 0-1) to randomize across multiple sequences

Returns

Sobol-distributed random 3D vector in the given grid cell

Return type

Vector

classmethod random_sobol_float(index, dimension, seed)float
Parameters
  • index (int32) – Which sequential point

  • dimension (int32) – Which Sobol dimension (0 to 15)

  • seed (float) – Random seed (in the range 0-1) to randomize across multiple sequences

Returns

Sobol-distributed random number between 0 and 1

Return type

float