beastapi/beastrenderpass.h File Reference

#include "beastapitypes.h"

File Description

Render Pass specification.

Enumerations

enum  ILBAOSelfOcclusion { ILB_SO_DISABLED = 0, ILB_SO_SET_ENVIRONMENT, ILB_SO_ENABLED }
 
enum  ILBBasisType
 
enum  ILBIlluminationMode { ILB_IM_DIRECT_ONLY = 0, ILB_IM_INDIRECT_ONLY, ILB_IM_FULL, ILB_IM_FULL_AND_INDIRECT }
 
enum  ILBLightPassType { ILB_LP_LIGHTMAP = 0, ILB_LP_SHADOWMAP, ILB_LP_FULLSHADING }
 
enum  ILBRNMAllowNegative { ILB_AN_ALLOW = 0, ILB_AN_DISALLOW, ILB_AN_DISALLOW_CULL_HORIZON }
 
enum  ILBRNMBasis { ILB_RB_HL2 = 0, ILB_RB_UE3, ILB_RB_UE3_FLIPPED, ILB_RB_CUSTOM }
 

Functions

ILBStatus ILBAddCustomBasisVector (ILBRenderPassHandle pass, const ILBVec3 *basisVector)
 
ILBStatus ILBAddFullyBakedLight (ILBRenderPassHandle pass, ILBLightHandle light)
 
ILBStatus ILBAddLightToPass (ILBLightPassEntryHandle entry, ILBLightHandle light)
 
ILBStatus ILBAddTargetToPass (ILBLightPassEntryHandle entry, ILBTargetEntityHandle target)
 
ILBStatus ILBCreateAmbientOcclusionPass (ILBJobHandle job, ILBConstString name, float maxDistance, float coneAngle, ILBRenderPassHandle *pass)
 
ILBStatus ILBCreateFullShadingPass (ILBJobHandle job, ILBConstString name, ILBRenderPassHandle *pass)
 
ILBStatus ILBCreateIlluminationPass (ILBJobHandle job, ILBConstString name, ILBIlluminationMode mode, ILBRenderPassHandle *pass)
 
ILBStatus ILBCreateIlluminationPassSH (ILBJobHandle job, ILBConstString name, ILBIlluminationMode mode, ILBRenderPassHandle *pass)
 
ILBStatus ILBCreateLightPass (ILBJobHandle job, ILBConstString name, ILBLightPassType type, ILBRenderPassHandle *pass)
 
ILBStatus ILBCreateLightPassEntry (ILBRenderPassHandle pass, ILBLightPassEntryHandle *entry)
 
ILBStatus ILBCreateLuaPass (ILBJobHandle job, ILBConstString name, ILBConstString scriptFile, ILBRenderPassHandle *pass)
 
ILBStatus ILBCreateNormalPass (ILBJobHandle job, ILBConstString name, ILBRenderPassHandle *pass)
 
ILBStatus ILBCreateRNMPass (ILBJobHandle job, ILBConstString name, ILBIlluminationMode mode, int32 samples, ILBRNMBasis basis, ILBRenderPassHandle *pass)
 
ILBStatus ILBEnableAOBentNormals (ILBRenderPassHandle pass)
 
ILBStatus ILBEnableSignedDistanceField (ILBRenderPassHandle pass, int32 pixelFilterSize, float maxWorldDistance)
 
ILBStatus ILBIncludeNormalComponent (ILBRenderPassHandle pass)
 
ILBStatus ILBNormalizeTextures (ILBRenderPassHandle pass, bool perChannel)
 
ILBStatus ILBRNMMatchNormalIntensity (ILBRenderPassHandle pass)
 
ILBStatus ILBSetAllowNegative (ILBRenderPassHandle pass, ILBRNMAllowNegative allow)
 
ILBStatus ILBSetAOAdaptive (ILBRenderPassHandle pass, float accuracy, float smooth)
 
ILBStatus ILBSetAOContrast (ILBRenderPassHandle pass, float contrast, float scale)
 
ILBStatus ILBSetAONumRays (ILBRenderPassHandle pass, int32 minRay, int32 maxRay)
 
ILBStatus ILBSetAOSelfOcclusion (ILBRenderPassHandle pass, ILBAOSelfOcclusion selfOcclusion)
 
ILBStatus ILBSetAOUniformSampling (ILBRenderPassHandle pass)
 
ILBStatus ILBSetLambertianClamp (ILBRenderPassHandle pass, float val)
 
ILBStatus ILBSetLambertianScale (ILBRenderPassHandle pass, float scale)
 
ILBStatus ILBSetNondirectionalScale (ILBRenderPassHandle pass, float scale)
 
ILBStatus ILBSetResolutionScale (ILBRenderPassHandle pass, float scale)
 

Enumeration Type Documentation

Self Occlusion Mode.

Enumerator
ILB_SO_DISABLED 

Self Occluded rays will continue beyond the originating object.

ILB_SO_SET_ENVIRONMENT 

Self Occluded rays will be set to the environment.

ILB_SO_ENABLED 

Objects can self occlude.

Basis type.

Illumination Modes.

Enumerator
ILB_IM_DIRECT_ONLY 

Only direct illumination (no indirect illumination)

ILB_IM_INDIRECT_ONLY 

Only indirect illumination (no direct illumination)

ILB_IM_FULL 

Both direct and indirect illumination.

ILB_IM_FULL_AND_INDIRECT 

Stores both direct+indirect and indirect separately.

Light Pass Type.

Enumerator
ILB_LP_LIGHTMAP 

Stores the incoming light in the light map.

ILB_LP_SHADOWMAP 

Stores the shadow mask.

The individual light mask intensity will be proportional to the light source intensity.

ILB_LP_FULLSHADING 

Stores the full shading in the light map.

Allow Negative.

Enumerator
ILB_AN_ALLOW 

Allows negative RNM values.

ILB_AN_DISALLOW 

Clamps negative RNM values to 0.

ILB_AN_DISALLOW_CULL_HORIZON 

As ILB_AN_DISALLOW, and also culls lights below the horizon of each triangle.

RNM Basis.

Enumerator
ILB_RB_HL2 

Half-Life 2 compatible basis.

ILB_RB_UE3 

Unreal Engine 3 compatible basis.

ILB_RB_UE3_FLIPPED 

Unreal Engine 3 basis in untouched order.

ILB_RB_CUSTOM 

Allows the user to enter the basis vectors manually.

Function Documentation

ILBStatus ILBAddCustomBasisVector ( ILBRenderPassHandle  pass,
const ILBVec3 basisVector 
)

Adds a custom basis vector to be used with ILB_RB_CUSTOM.

Only supported by the RNM pass.

Parameters
passthe pass
basisVectorthe basis vector to be added.
Returns
The result of the operation.
ILBStatus ILBAddFullyBakedLight ( ILBRenderPassHandle  pass,
ILBLightHandle  light 
)

Add a light to be fully baked to a FullAndIndirectIllumination Pass.

Parameters
passthe illumination pass to add the light to
lightthe light to add
Returns
The result of the operation.
ILBStatus ILBAddLightToPass ( ILBLightPassEntryHandle  entry,
ILBLightHandle  light 
)

Add a light to a light pass.

Parameters
entrythe light pass entry to add the light to
lightthe light to add
Returns
The result of the operation.
ILBStatus ILBAddTargetToPass ( ILBLightPassEntryHandle  entry,
ILBTargetEntityHandle  target 
)

Add an affected target entity to a light pass.

Parameters
entrythe light pass entry to add the target entity to
targetthe target to add
Returns
The result of the operation.
ILBStatus ILBCreateAmbientOcclusionPass ( ILBJobHandle  job,
ILBConstString  name,
float  maxDistance,
float  coneAngle,
ILBRenderPassHandle pass 
)

Creates an Ambient Occlusion render pass.

Parameters
jobthe job to add the pass to
namethe name of the pass
maxDistancethe maximum distance to check for occlusion. 0 for infinite.
coneAnglethe cone angle. Default is 180
passthe handle to store the generated target in
Returns
The result of the operation.
+ Examples:
ILBStatus ILBCreateIlluminationPass ( ILBJobHandle  job,
ILBConstString  name,
ILBIlluminationMode  mode,
ILBRenderPassHandle pass 
)

Creates an Illumination render pass.

Parameters
jobthe job to add the pass to
namethe name of the pass
modeSelects Direct Illumination Only, Indirect Illumination only or both.
passthe handle to store the generated target in
Returns
The result of the operation.
+ Examples:
ILBStatus ILBCreateIlluminationPassSH ( ILBJobHandle  job,
ILBConstString  name,
ILBIlluminationMode  mode,
ILBRenderPassHandle pass 
)

Creates an Illumination render pass with sh output.

Parameters
jobthe job to add the pass to
namethe name of the pass
modeSelects Direct Illumination Only, Indirect Illumination only or both.
passthe handle to store the generated target in
Returns
The result of the operation.
+ Examples:
ILBStatus ILBCreateLightPass ( ILBJobHandle  job,
ILBConstString  name,
ILBLightPassType  type,
ILBRenderPassHandle pass 
)

Creates a Light render pass.

Parameters
jobthe job to add the pass to
namethe name of the pass
typethe lighting mode
passthe handle to store the generated target in
Returns
The result of the operation.
ILBStatus ILBCreateLightPassEntry ( ILBRenderPassHandle  pass,
ILBLightPassEntryHandle entry 
)

Creates a Light Pass Entry.

Parameters
passthe light pass to create the entry on
entrythe created entry
Returns
The result of the operation.
ILBStatus ILBCreateLuaPass ( ILBJobHandle  job,
ILBConstString  name,
ILBConstString  scriptFile,
ILBRenderPassHandle pass 
)

Creates a LUA pass.

Parameters
jobthe job to add the pass to
namethe name of the pass
scriptFilethe file name of the script
passthe handle to store the generated target in
Returns
The result of the operation.
+ Examples:
ILBStatus ILBCreateNormalPass ( ILBJobHandle  job,
ILBConstString  name,
ILBRenderPassHandle pass 
)

Creates a Normal render pass.

Parameters
jobthe job to add the pass to
namethe name of the pass
passthe handle to store the generated target in
Returns
The result of the operation.
ILBStatus ILBCreateRNMPass ( ILBJobHandle  job,
ILBConstString  name,
ILBIlluminationMode  mode,
int32  samples,
ILBRNMBasis  basis,
ILBRenderPassHandle pass 
)

Creates an RNM render pass.

Parameters
jobthe job to add the pass to
namethe name of the pass
modeSelects Direct Illumination Only, Indirect Illumination only or both.
samplesNumber of samples for non-adaptive RNM. Set to 0 samples to turn on adaptivity (recommended).
basisThe RNM basis to use
passthe handle to store the generated target in
Returns
The result of the operation.
+ Examples:
ILBStatus ILBEnableAOBentNormals ( ILBRenderPassHandle  pass)

No support in physical rendering.

Calculates the "bent normal" (most visible direction). If this is used, sampling cannot be adaptive. The put will contain normals in RGB and occlusion in A

Parameters
passthe affected pass, must be an AO pass
Returns
The result of the operation.
ILBStatus ILBEnableSignedDistanceField ( ILBRenderPassHandle  pass,
int32  pixelFilterSize,
float  maxWorldDistance 
)

No support in physical rendering.

Makes a light pass use signed distance field shadow maps. Each resulting baked pixel will store the distance to the closest shadow transition.
Distances are remapped to the range [0.0, 1.0], where:

  • Values below 0.5 indicate pixels that lie in unlit areas. As the distance from the pixel to the shadow transition increases, the value decreases. The minimum value of 0.0f indicates that the pixel is at a distance of at least maxWorldDistance from the transition.
  • 0.5 indicates a pixel that lies exactly on a shadow transition.
  • Values above 0.5 indicate pixels that lie in lit areas. As the distance from the pixel to the shadow transition increases, the value increases. The maximum value of 1.0f indicates that the pixel is at a distance of at least maxWorldDistance from the transition.
    We strongly recommend that you disable soft shadows on any lights that generate signed distance fields, as sharp shadow transitions generate the best results. Also make sure to specify a high maximum super sampling rate to ensure high quality signed distance fields.
    Only enable signed distance fields for a light pass, and only when the light pass is configured to bake shadow maps (ILB_LP_SHADOWMAP). Any other use will produce undefined results.
    Parameters
    passthe light pass
    pixelFilterSizeSets the maximum search range in pixels in the image. This is mainly a performance optimization hint, having this set too large will cause excessive overlap rendering which will degrade performance. Default value is 20.
    maxWorldDistancethe maximum world distance to be stored. Default value is 1.0f.
    Returns
    The result of the operation.
ILBStatus ILBIncludeNormalComponent ( ILBRenderPassHandle  pass)

Enables inclusion of a normal component in the RNM pass.

Parameters
passthe pass
Returns
The result of the operation.
ILBStatus ILBNormalizeTextures ( ILBRenderPassHandle  pass,
bool  perChannel 
)

Normalizes the texture values to the 0..1 range.

Stores the original range per entity which can be collected with the getNormalization* functions.

Parameters
passthe pass
perChannelif enabled normalization will be done individually for each channel
Returns
The result of the operation.
ILBStatus ILBRNMMatchNormalIntensity ( ILBRenderPassHandle  pass)

Scales the RNM values to the amplitude of the normal component.

Parameters
passthe pass
Returns
The result of the operation.
ILBStatus ILBSetAllowNegative ( ILBRenderPassHandle  pass,
ILBRNMAllowNegative  allow 
)

Determines how the RNM pass handles light contributions that come from below the plane of the surface.

In an ordinary illumination pass, such a light would yield a light contribution of 0. However, in the RNM pass the light can still affect one or two of the RNM basis components. This function determines whether negative RNM components will be taken into account as-is or clamped to 0.

Parameters
passthe pass
allowthe allow value (default is ILB_AN_DISALLOW_CULL_HORIZON)
Returns
The result of the operation.
ILBStatus ILBSetAOAdaptive ( ILBRenderPassHandle  pass,
float  accuracy,
float  smooth 
)

No support in physical rendering.

Enables adaptivity on an AO pass

Parameters
passthe pass to enable adaptivity on, must be an AO pass
accuracyadaptive accuracy, default is 1
smoothsmooth value, default is 1
Returns
The result of the operation.
+ Examples:
ILBStatus ILBSetAOContrast ( ILBRenderPassHandle  pass,
float  contrast,
float  scale 
)

Sets the contrast and scale of an AO pass.

Parameters
passthe affected pass, must be an AO pass
contrastthe desired contrast of the AO pass. Default = 1.0f
scalescale of occlusion values. Default = 1.0f
Returns
The result of the operation.
+ Examples:
ILBStatus ILBSetAONumRays ( ILBRenderPassHandle  pass,
int32  minRay,
int32  maxRay 
)

No support in physical rendering.

Sets the number of rays to use in an AO pass

Parameters
passthe affected pass, must be an AO pass
minRaythe minimum number of rays to sample for each point, default is 64
maxRaythe maximum number of rays to sample for each point, default is 300
Returns
The result of the operation.
+ Examples:
ILBStatus ILBSetAOSelfOcclusion ( ILBRenderPassHandle  pass,
ILBAOSelfOcclusion  selfOcclusion 
)

Sets how the AO pass should react to self occlusion.

Parameters
passthe affected pass, must be an AO pass
selfOcclusionthe self occlusion mode. Default is ILB_SO_ENABLED.
Returns
The result of the operation.
+ Examples:
ILBStatus ILBSetAOUniformSampling ( ILBRenderPassHandle  pass)

Enables Uniform Sampling on an AO pass.

When Uniform Sampling is enabled the sampling is not cos()-weighted.

Parameters
passthe affected pass, must be an AO pass
Returns
The result of the operation.
+ Examples:
ILBStatus ILBSetLambertianClamp ( ILBRenderPassHandle  pass,
float  val 
)

Enable lambertian clamp on an RNM pass.

Parameters
passthe pass
valthe lambertian clamp value
Returns
The result of the operation.
ILBStatus ILBSetLambertianScale ( ILBRenderPassHandle  pass,
float  scale 
)

Sets the lambertian scale on a light pass.


This configures the amount of lambertian reflectance (N * L) to be weighted into the resulting direct lighting. A scale of 1.0f will render the light that is reflected by the surface, just like the ordinary illumination pass. A scale of 0.0f renders the incoming light on the surface, disregarding the orientation from the surface to the light source. This can be useful if you want to do surface shading at a later stage. Please note that this makes sense to bake only for single light sources and only for direct lighting.

Parameters
passthe pass
scalethe scale of influcence from lambertian reflectance (N*L)
Returns
The result of the operation.
ILBStatus ILBSetNondirectionalScale ( ILBRenderPassHandle  pass,
float  scale 
)

Scales the nondirectional influence of materials.

Only supported by the RNM pass.

Parameters
passthe pass
scalethe nondirectional scale factor.
Returns
The result of the operation.
ILBStatus ILBSetResolutionScale ( ILBRenderPassHandle  pass,
float  scale 
)

Scales the resolution on all texture targets for the pass.

Parameters
passthe pass
scalethe resolution scale factor.
Returns
The result of the operation.

Go to the source code of this file.