Data Structures | Functions
Sub-Surface Scattering API

Data Structures

struct  AtPointCloudSample
 

Functions

AI_API AtColor AiBSSRDFCubic (const AtShaderGlobals *sg, const float *radius, const AtColor *weight, unsigned int num=1)
 Calculate SSS using a weighted sum of cubic BSSRDFs at the specified shading point. More...
 
AI_API AtColor AiBSSRDFGaussian (const AtShaderGlobals *sg, const float *variance, const AtColor *weight, unsigned int num=1)
 Calculate SSS using a weighted sum of gaussian BSSRDFs at the specified shading point. More...
 
AI_API AtColor AiSSSTraceSingleScatter (AtShaderGlobals *sg, AtColor Rd, AtColor mfp, float g, float eta)
 Perform a single scattered ray traced SSS computation based on the BSSRDF formulation by Henrik Wann Jensen et al. More...
 
AI_API bool AiShaderGlobalsFromSSS (const AtShaderGlobals *sg)
 Check to see if the shader globals are coming from an SSS evaluation. More...
 

Deprecated

The pointcloud iterator interface will be removed in a future release.

AI_API AtPointCloudIterator * AiPointCloudIteratorCreate (const AtShaderGlobals *sg, int distribution, float spacing=0.1f)
 Create a point cloud sample iterator. More...
 
AI_API void AiPointCloudIteratorDestroy (AtPointCloudIterator *iter)
 Destroy a point cloud sample iterator. More...
 
AI_API AtPointCloudSample AiPointCloudIteratorGetNext (AtPointCloudIterator *iter)
 Get the next AtPointCloudSample from the sample iterator. More...
 
AI_API bool AiPointCloudIteratorFinished (const AtPointCloudIterator *iter)
 Detect whether or not the AtPointCloudIterator has looped through all of the samples. More...
 
AI_API AtUInt32 AiPointCloudGetSampleCount (const AtPointCloudIterator *iter)
 Return the number of samples in the point cloud for the given shader globals. More...
 
#define AI_POINTCLOUD_BLUE_NOISE   0x00
 
#define AI_POINTCLOUD_TRIANGLE_MIDPOINT   0x01
 
#define AI_POINTCLOUD_POLYGON_MIDPOINT   0x02
 

Detailed Description

Function Documentation

AI_API AtColor AiBSSRDFCubic ( const AtShaderGlobals sg,
const float *  radius,
const AtColor weight,
unsigned int  num 
)

Calculate SSS using a weighted sum of cubic BSSRDFs at the specified shading point.

BSSRDF sampling quality is controlled by the sss_bssrdf_samples render option.

Parameters
sgshader globals to perform the lookup at
radiusarray of scattering radii (as world space distances)
weightarray of weights (one for each scattering radius)
numnumber of elements in radius and weight arrays
Returns
color lookup
AI_API AtColor AiBSSRDFGaussian ( const AtShaderGlobals sg,
const float *  variance,
const AtColor weight,
unsigned int  num 
)

Calculate SSS using a weighted sum of gaussian BSSRDFs at the specified shading point.

BSSRDF sampling quality is controlled by the sss_bssrdf_samples render option.

Parameters
sgshader globals to perform the lookup at
variancearray of variance values for gaussians
weightarray of weights (one for each scattering radius)
numnumber of elements in radius and weight arrays
Returns
color lookup
AI_API AtColor AiSSSTraceSingleScatter ( AtShaderGlobals sg,
AtColor  Rd,
AtColor  mfp,
float  g,
float  eta 
)

Perform a single scattered ray traced SSS computation based on the BSSRDF formulation by Henrik Wann Jensen et al.

The quality of the SSS computation is controlled by the GI_single_scatter_samples render option.

See Also
http://graphics.ucsd.edu/~henrik/papers/bssrdf/
Parameters
sgshader globals to perform the lookup at
Rdreduced albedo term
mfpmean free path length (mfp = 1/sigmat' = 1/(sigmas' + sigmaa))
gHenyey-Greenstein phase function coefficient, in the (-1,+1) open interval, where 0 means isotropic scattering, positive values mean forward scattering, and negative values mean backward scattering
etaindex of refraction
Returns
sampled SSS color result
AI_API bool AiShaderGlobalsFromSSS ( const AtShaderGlobals sg)

Check to see if the shader globals are coming from an SSS evaluation.

This can be used to simplify shader returns while point clouds are being calculated.

Parameters
sgshader globals for the currently running shader
Returns
true if this sample is being computed in the context of point cloud creation
AI_API AtPointCloudIterator* AiPointCloudIteratorCreate ( const AtShaderGlobals sg,
int  distribution,
float  spacing 
)

Create a point cloud sample iterator.

Parameters
sgshader globals for the currently running shader
distributiondistribution type for placing the points in the surface. The valid values are defined by the macros AI_POINTCLOUD_*
spacingIf distribution is set to AI_POINTCLOUD_BLUE_NOISE, this parameter controls the minimum spacing between points
Returns
a newly constructed AtPointCloudIterator
AI_API void AiPointCloudIteratorDestroy ( AtPointCloudIterator *  iter)

Destroy a point cloud sample iterator.

Parameters
iterthe AtPointCloudIterator to destroy
AI_API AtPointCloudSample AiPointCloudIteratorGetNext ( AtPointCloudIterator *  iter)

Get the next AtPointCloudSample from the sample iterator.

Parameters
iterthe AtPointCloudIterator the samples are being taken from
Returns
the next sample from the iterator
AI_API bool AiPointCloudIteratorFinished ( const AtPointCloudIterator *  iter)

Detect whether or not the AtPointCloudIterator has looped through all of the samples.

Parameters
iterthe AtPointCloudIterator the samples are being taken from
Returns
true if there are no more remaining samples, false otherwise
AI_API AtUInt32 AiPointCloudGetSampleCount ( const AtPointCloudIterator *  iter)

Return the number of samples in the point cloud for the given shader globals.

Parameters
iterthe AtPointCloudIterator the samples are being taken from
Returns
the number of samples in the point cloud

© 2009-2013 Solid Angle SL · all rights reserved · www.solidangle.com