Functions | |
AI_API AtColor | AiIrradiance (const AtPoint *p, const AtVector *n, AtByte tid, AtUInt32 pid) |
Irradiance lookup at a (point,normal) pair. More... | |
AI_API AtColor | AiRadiance (const AtPoint *p, const AtVector *dir, const AtVector *n, AtNode *obj, AtUInt32 face, float u, float v, AtNode *shader, AtByte tid, AtUInt32 pid) |
Radiance lookup at a point. More... | |
AI_API AtRGB | AiSSSEvaluateIrradiance (const AtShaderGlobals *sg, float u, float v, AtUInt32 face, const AtPoint *p, AtUInt32 index) |
Return irradiance at the specified sample. More... | |
Irradiance lookup at a (point,normal) pair.
This function computes the total hemispherical irradiance at a given point and normal vector, including both direct and indirect illumination.
This can be used to precompute (or "bake") lightmaps as it's typically done for videogames and other realtime applications.
Here is a snippet of code that shows how to make "free" calls to AiIrradiance() and store them in an array:
p | the input shading point |
n | the input shading normal |
tid | thread id for the irradiance calculation (used for multi-threaded code) |
pid | a unique identifier, or point id, for this irradiance calculation, used to generate variations in the illumination sampling patterns |
AI_API AtColor AiRadiance | ( | const AtPoint * | p, |
const AtVector * | dir, | ||
const AtVector * | n, | ||
AtNode * | obj, | ||
AtUInt32 | face, | ||
float | u, | ||
float | v, | ||
AtNode * | shader, | ||
AtByte | tid, | ||
AtUInt32 | pid | ||
) |
Radiance lookup at a point.
This function computes the radiance along a given direction, coming from a given point. The local surface properties at the point must be passed in: normal vector, object, face, parametric coordinates, and shader.
This function is used in "free" mode just like AiIrradiance(). Possible uses include precomputing a spherical harmonics representation of the reflected radiance function at a point in space.
p | the point where radiance comes from |
dir | the radiance direction |
n | the unit normal vector at p |
obj | an AtNode* for the geometry object at p, usually a polymesh |
face | the face in the polymesh |
u | the U parametric coordinate, or barycentric coordinate for a polymesh |
v | the V parametric coordinate, or barycentric coordinate for a polymesh |
shader | an AtNode* for the shader at p |
tid | thread id for the irradiance calculation (used for multi-threaded code) |
pid | point id used to set random values |
AI_API AtRGB AiSSSEvaluateIrradiance | ( | const AtShaderGlobals * | sg, |
float | u, | ||
float | v, | ||
AtUInt32 | face, | ||
const AtPoint * | p, | ||
AtUInt32 | index | ||
) |
Return irradiance at the specified sample.
This function was designed to work in conjunction with the pointcloud iterator API as in the following example:
You probably won't ever need to use this function unless you are implementing a custom SSS engine.
sg | shader globals (needed for thread id, etc) |
u | barycentric u sample coordinate |
v | barycentric v sample coordinate |
face | index of the face where the sample is located |
p | position of the sample in world space |
index | unique index for this sample, used to seed RNG's |