module Implementation

This is the documentation for Enlighten.

module Implementation

Implementation details of the extended input lighting API.

Classes

Name

Description

Name

Description

Enlighten::A8CpuTextureSampler

A8 texture sampler.

Enlighten::AllFilter

Return all light types.

Enlighten::BoxSpotlight

BoxSpotlight class used by extended input lighting.

Enlighten::BoxSpotlight::CachedData

Cached data for box spotlight.

Enlighten::CachedLightSelector

Selects the Cached type for the input light.

Enlighten::CachedLightSelector::Select

Selects the Cached type for the input light.

Enlighten::CachedLightWriter

Cached Lights writer.

Enlighten::CanQuickShade

By default, light types do not support quickshade.

Enlighten::CanQuickShade< LIGHT_TYPE_DIRECTIONAL_LIGHT >

Specialization to enable QuickShade on this light type.

Enlighten::ClusterMaterialComponent

Enlighten internal class for per material dynamic updates.

Enlighten::ClusterMaterials

Enlighten internal implementation for cluster albedo materials.

Enlighten::ClusterMaterials::ClusterMaterialCount

Number of dusters and a material index which is assigned to them.

Enlighten::ClusterProbeTransparencySampleData

Precompute data block detailing probe transparency sample data (internal).

Enlighten::ConstLightValueIterator

Const LightValue iterator. This contains the logic for iterating over LightValue64 or LightValue128 arrays.

Enlighten::CountLightSizeVisitor

Count light size.

Enlighten::CpuTextureSamplerBase

CPU texture sampler base class.

Enlighten::CullCluster

A class used to apply cluster-light level culling.

Enlighten::CullClusterGroup

A class used to apply clustergroup-light level culling.

Enlighten::CullingIterator

Struct to iterate over the lights of a particular type, applying the culling operation.

Enlighten::CullingIterator< LIGHT_TYPE_INVALID, Culler >

Terminator for CullingIterator.

Enlighten::CullSystem

A class used to apply system-light level culling.

Enlighten::DefaultGeometryTransparencySampler

The default transparency sampler.

Enlighten::DirectionalLight

DirectionalLight class used by extended input lighting.

Enlighten::DirectionalLight::CachedData

Cached data for DirectionalLight.

Enlighten::DynamicMaterialWorkspace

Enlighten object used for dynamic material updates at runtime.

Enlighten::ExcludeQuickShadeFilter

Return all types except quick shade lights.

Enlighten::Fp16CpuTextureSampler

FP16 texture sampler.

Enlighten::FrustumLight

FrustumLight class used by extended input lighting.

Enlighten::FrustumLight::CachedData

Cached data for FrustumLight.

Enlighten::HashLightVisitor

Hash lights functor.

Enlighten::IncidentLightingBuffer

A buffer containing the incident lighting for a system's input sample points (internal).

Enlighten::IndirectInputLightingInternalParameters

A class containing the parameters to be used as input to the internal indirect input lighting stage.

Enlighten::InputLightingBuffer

A single frame of the InputWorkspace lighting (internal).

Enlighten::InputWorkspaceDebugIterator

This class is used to iterate through the duster samples in order to get a InputWorkspaceDebugPoint.

Enlighten::InputWorkspaceDynamicInternal

Runtime data about the quad approximations to clusters used for radiosity computations for dynamic systems (internal).

Enlighten::InputWorkspaceInternal

Runtime data about the dusters (internal).

Enlighten::InternalLightFalloffTable

The light table stores the falloff model of a light.

Enlighten::LightSelector

Selects the input light type.

Enlighten::LightSelector::Select

Selects the input light type.

Enlighten::LightTypeInfo

A class which represents a group of a particular type of lights.

Enlighten::LightValue64

Convenience value type for a half precision lighting value.

Enlighten::LightValueIterator

LightValue iterator. This contains the logic for iterating over LightValue64 or LightValue128 arrays.

Enlighten::LrbCpuTextureSampler

LRB texture sampler.

Enlighten::MaterialAlbedoSampler

Albedo sampler read the cluster albedo after all the quads have been sampled.

Enlighten::MaterialEmissiveSampler

Emissive sampler reads the emissive for the cluster.

Enlighten::MaterialGuids

Storage of mappings between "old" u64 material IDs and "new" instance, mesh and material GUIDs.

Enlighten::MaterialGuids::GeometryInfo

Stored data for a geometry.

Enlighten::MaterialGuids::InstanceInfo

Stored data for an instance.

Enlighten::MaterialGuids::MaterialGuidMapping

Stored data for a material-guid mapping.

Enlighten::MaterialGuids::MeshInfo

Stored data for a mesh.

Enlighten::MaterialSampler

Material sampler reads albedo, emissive and transparency for the cluster.

Enlighten::MaterialTransparencySampler

Transparency sampler reads the transparency for the cluster.

Enlighten::NullGeometryTransparencySampler

A transparency sampler which samples the transparency as opaque.

Enlighten::NullMaterialEmissiveSampler

An emissive material sampler which returns black.

Enlighten::NullMaterialTransparencySampler

A transparency sampler which samples the transparency as opaque.

Enlighten::NullSampler

A base implementation for a sampler that does nothing.

Enlighten::NullSurroundingsSampler

Surroundings sampler that always returns zero.

Enlighten::PackedDusterPoint

This class contains the positions and normals of 4 duster points (internal).

Enlighten::PixelCoord

Enlighten internal class for storing a pixel index within an albedo or emissive texture.

Enlighten::PointLight

PointLight class used by extended input lighting.

Enlighten::PointLight::CachedData

Cached data for point light.

Enlighten::PrecisionHint

Enumeration for the precision hint. The hint is used depending on whether the option is supported on the platform.

Enlighten::QuadIterator

Quad iterator class applies the samplers to a set of quads for a given cluster.

Enlighten::QuadShader

The QuadShader class is responsible for unpacking the quad positions and normal during the constructor call and then later it will then iterate through a given set of lights shading the extracted quad.

Enlighten::QuickFlatClusterShader

The QuickFlatClusterShader class is responsible for unpacking a single normal during the constructor call and then later it will then iterate through a given set of lights shading the extracted normal.

Enlighten::QuickQuadShader

The QuickQuadShader class is responsible for unpacking four quad normals during the constructor call and then later it will then iterate through a given set of lights shading the extracted normals.

Enlighten::QuickShadeOnlyFilter

Return only quick shade light types.

Enlighten::R11G11B10CpuTextureSampler

R11G11B10 texture sampler.

Enlighten::R9G9B9E5CpuTextureSampler

R9G9B9E5 texture sampler.

Enlighten::RadiosityInputTree

Compressed description of the input cluster tree.

Enlighten::RectangleLight

RectangleLight class used by extended input lighting.

Enlighten::RectangleLight::CachedData

Cached data for rectangle light.

Enlighten::RgbaCpuTextureSampler

RGBA texture sampler.

Enlighten::RgbmCpuTextureSampler

RGBM texture sampler.

Enlighten::SelectAll

Selector which selects all lights.

Enlighten::SelectCulled

Selector which selects culled lights.

Enlighten::SelectUnculled

Selector which selects unculled lights.

Enlighten::ShadeFourSamplesOperator

Visitor operator used to shade four samples for each light type.

Enlighten::ShadeQuadOperator

Visitor operator used to shade the quad for each light type.

Enlighten::SortedLights

A class used to produce a sorted, culled list of lights.

Enlighten::SortedLightsOperator

Sorted lights operator interface.

Enlighten::SortedLightsVisibilityIdxWriter

Sorted lights visibility index writer.

Enlighten::SortedLightsVisitor

Visitor construct to apply each operator to the relevant light types.

Enlighten::SortedLightsVisitor< LIGHT_TYPE_INVALID, Op, LightTypeFilter >

Terminator condition for light visitor.

Enlighten::Spotlight

Spotlight class used by extended input lighting.

Enlighten::Spotlight::CachedData

Cached data for spotlights.

Enlighten::TransformedBounds

A struct used to apply a transform to a bounding box.

Enlighten::TransparencySurroundingsSampler

Surroundings sampler for transparency.

Enlighten::TransparencyWorkspace

Workspace used for authored destruction of lightmapped geometry (internal).

Enlighten::TypeIdToType

Convert from type enum to concrete type Put this above the light type includes so the specialisations can go in the same file.

Enlighten::TypeIdToType< LIGHT_TYPE_BOXSPOT_LIGHT >

Specialization to convert Light type enumeration to concrete type.

Enlighten::TypeIdToType< LIGHT_TYPE_DIRECTIONAL_LIGHT >

Specialization to convert Light type enumeration to concrete type.

Enlighten::TypeIdToType< LIGHT_TYPE_FRUSTUM_LIGHT >

Specialization to convert Light type enumeration to concrete type.

Enlighten::TypeIdToType< LIGHT_TYPE_POINT_LIGHT >

Specialization to convert Light type enumeration to concrete type.

Enlighten::TypeIdToType< LIGHT_TYPE_RECTANGLE_LIGHT >

Specialization to convert Light type enumeration to concrete type.

Enlighten::TypeIdToType< LIGHT_TYPE_SPOT_LIGHT >

Specialization to convert Light type enumeration to concrete type.

Enlighten::TypeIdToType< LIGHT_TYPE_UE4_DIRECTIONAL_LIGHT >

Specialization to convert Light type enumeration to concrete type.

Enlighten::TypeIdToType< LIGHT_TYPE_UE4_DIRECTIONAL_LIGHT_FUNCTION >

Specialization to convert Light type enumeration to concrete type.

Enlighten::TypeIdToType< LIGHT_TYPE_UE4_ISFALLOFF >

Specialization to convert Light type enumeration to concrete type.

Enlighten::TypeIdToType< LIGHT_TYPE_UE4_RECTLIGHT >

Specialization to convert Light type enumeration to concrete type.

Enlighten::TypeIdToType< LIGHT_TYPE_UE4_UNREALFALLOFF >

Specialization to convert Light type enumeration to concrete type.

Enlighten::VisibilityBuffer

Encapsulation of light visibility information.

Enlighten::VisitLightsGeneric

Visit the lights of a particular type. Do this recursively.

Enlighten::VisitLightsGeneric< TypeSelector, Visitor, LIGHT_TYPE_INVALID >

Visitor terminator.

Enlighten::VisitSelectedLightsGeneric

Visitor for selected lights.

Enlighten::VisitSelectedLightsGeneric< TypeSelector, Visitor, LightSelector, LIGHT_TYPE_INVALID >

Visitor for selected lights.

Variables

Name

Description

Name

Description

const Geo::s32 g_MaxLightDataStackDepth = 6

This is the number of copies of lightcount pointers we have in the LightDataStack member of InputWorkspaceData in the lighting internals.

const Geo::v128 g_VFalloffInvSamples = Geo::VBroadcast(1.0f / (InputLightFalloffTable::g_SampleCount - 2.0f))

Light falloff constants for the function: index = (((samples - 1.0) / (samples - 2.0)) / (1.0 / (samples - 2.0) + d * d);.

const Geo::v128 g_VFalloffNumSamples = Geo::VBroadcast(float(InputLightFalloffTable::g_SampleCount))

Light falloff constants for the function: index = (((samples - 1.0) / (samples - 2.0)) / (1.0 / (samples - 2.0) + d * d);.

const Geo::v128 g_VFalloffSampleFraction = Geo::VBroadcast((InputLightFalloffTable::g_SampleCount - 1.0f) / (InputLightFalloffTable::g_SampleCount - 2.0f))

Light falloff constants for the function: index = (((samples - 1.0) / (samples - 2.0)) / (1.0 / (samples - 2.0) + d * d);.

Typedefs

Name

Description

Name

Description

Geo::v128 LightValue128

Convenience value type for a full precision lighting value.

ClusterMaterialComponent< AlbedoBuffer::ColourType > MaterialAlbedoComponent

Material component for albedo.

ClusterMaterialComponent< EmissiveBuffer::ColourType > MaterialEmissiveComponent

Material component for emissive.

ClusterMaterialComponent< TransparencyBuffer::ColourType > MaterialTransparencyComponent

Material component for transparency.

Functions

Name

Description

Name

Description

CalcLightTableMem(Geo::u32)

Calculate the maximum memory required to hold the lights table.

CalcRequiredScratchSpaceMemoryInternal(InputLightBase **, Geo::u32, Geo::s32)

Calculate how much scratchspace memory will be required by the DoDirectInputLighting() function given the lights to be shaded.

CalculateCoordLinearShiftedByHalfPixel(float, float, Geo::s32, Geo::s32, Geo::s32 &, Geo::s32 &, float &, float &)

Shift by half pixel is needed so that the interpolation code (SampleBilinear) interpolates between correct pixels.

CalculateLightsCachedDataSize(InputLightBase **, Geo::u32)

Calculate the size of the cached lighting data.

CreateSortedLights(InputLightBase **, void **, Geo::s32, void *, size_t, Geo::u32 &)

Create the buffer of lights sorted by type.

DoDirectInputLightingInternal(DirectInputLightingParameters *, void *, size_t, TransformOp)

Do the internal direct input lighting stage.

DoIndirectInputLightingInternal(IndirectInputLightingInternalParameters< MaterialSamplerType, InputLightingSurroundingsType, GeometryTransparencySamplerType > *)

Do the internal indirect input lighting stage.

GenerateCachedData(SortedLights *, InputLightBase *, void **)

Go through all the sorted lights generating the CachedData for each. Also modifies sortedLights to point to the cached data.

GenerateCachedDataGeneric(SortedLights *, InputLightBase *, void **)

Generate the CacheData for a specific light type.

GenerateCachedDataGeneric< LIGHT_TYPE_INVALID >(SortedLights *, InputLightBase *, void **)

Specialisation for invalid light types - does nothing.

GetZeroValue()

Helper template to get the zero value of different types.

GetZeroValue< float >()

Helper template to get the zero value of floats.

GetZeroValue< Geo::v128 >()

Helper template to get the zero value of v128s.

LightFalloffFunction(const InternalLightFalloffTable &, const Geo::v128 &, const Geo::v128 &)


common light falloff function used by spot and point lights, computes four lights at a time


 

operator&(DynamicMaterialWorkspace::Status, DynamicMaterialWorkspace::Status)

Bitwise AND of two dynamic material workspace statuses.

operator|(DynamicMaterialWorkspace::Status, DynamicMaterialWorkspace::Status)

Bitwise OR of two dynamic material workspace statuses.

operator~(DynamicMaterialWorkspace::Status)

Bitwise NOT of a dynamic material workspace status.