Coordinate Transformations | |
#define | AI_WORLD_TO_OBJECT 1 |
World-to-object coordinate transformation. | |
#define | AI_OBJECT_TO_WORLD 2 |
Object-to-world coordinate transformation. | |
Wireframe Types | |
#define | AI_WIREFRAME_TRIANGLES 0 |
Tessellated triangles. | |
#define | AI_WIREFRAME_POLYGONS 1 |
Tessellated polygons. | |
#define | AI_WIREFRAME_PATCHES 2 |
Patches before subdivision. | |
Lighting Functions | |
AI_API AtColor | AiOcclusion (const AtVector *N, const AtVector *Ng, AtShaderGlobals *sg, float mint, float maxt, float spread, float falloff, const AtSampler *sampler, AtVector *Nbent) |
Returns the ambient occlusion at a shading point. More... | |
AI_API AtColor | AiDirectDiffuse (const AtVector *N, AtShaderGlobals *sg) |
Returns the direct-lighting component of the irradiance at a shading point. More... | |
AI_API AtColor | AiHairDirectDiffuseCache (const struct AtShaderGlobals *sg) |
Return the direct irradiance interpolated from the hair diffuse cache. More... | |
AI_API AtColor | AiIndirectDiffuse (const AtVector *N, AtShaderGlobals *sg) |
Returns the indirect-lighting component of the irradiance at a shading point. More... | |
AI_API void | AiReflect (const AtVector *I, const AtVector *N, AtVector *R) |
Returns specular direction R from incident direction I and normal N. More... | |
AI_API void | AiReflectSafe (const AtVector *I, const AtVector *N, const AtVector *Ng, AtVector *R) |
Returns specular direction R from incident direction I and normal N. More... | |
AI_API bool | AiRefract (const AtVector *I, const AtVector *N, AtVector *T, float n1, float n2) |
Returns transmitted direction T from incident direction I and normal N. More... | |
AI_API float | AiFresnelWeight (AtVector N, AtVector Rd, float Krn) |
Computes Fresnel reflectance at an air-dielectric interface for given normal and viewing vectors. More... | |
AI_API void | AiFresnelWeightRGB (const AtVector *N, const AtVector *Rd, const AtColor *Krn, AtColor *Kf) |
Optimized version of AiFresnelWeight() for RGB reflectance. More... | |
AI_API void | AiFaceForward (AtVector *N, AtVector I) |
Make a normal vector face forward with respect to a given vector. More... | |
AI_API void | AiBuildLocalFrameShirley (AtVector *u, AtVector *v, const AtVector *N) |
Build an orthonormal basis aligned with vector N (Shirley's method). More... | |
AI_API void | AiBuildLocalFramePolar (AtVector *u, AtVector *v, const AtVector *N) |
Build an orthonormal basis aligned with vector N (polar method). More... | |
Utility Helper Types | |
typedef float(* | AtFloatBumpEvaluator )(AtShaderGlobals *sg, void *data) |
This function pointer points to float-based bump-mapping function for use by AiShaderGlobalsEvaluateBump(). More... | |
Utility Functions | |
AI_API bool | AiShaderGlobalsGetTriangle (const AtShaderGlobals *sg, int key, AtPoint p[3]) |
Get triangle vertices at a given motion key. More... | |
AI_API bool | AiShaderGlobalsGetVertexNormals (const AtShaderGlobals *sg, int key, AtVector n[3]) |
Get normal vectors for all triangle vertices. More... | |
AI_API bool | AiShaderGlobalsGetVertexUVs (const AtShaderGlobals *sg, AtPoint2 uv[3]) |
Get UV coordinates for all triangle vertices. More... | |
AI_API AtUInt32 | AiShaderGlobalsGetPolygon (const AtShaderGlobals *sg, int key, AtPoint *p) |
Get polygon vertices at a given motion key. More... | |
AI_API void | AiShaderGlobalsGetPositionAtTime (const AtShaderGlobals *sg, float time, AtPoint *P, AtVector *N, AtVector *Ng, AtVector *Ns) |
Reproject the shading point to a different time. More... | |
AI_API AtPoint2 | AiShaderGlobalsGetPixelMotionVector (const AtShaderGlobals *sg, float time0, float time1) |
Compute motion vector. More... | |
AI_API AtBBox | AiShaderGlobalsGetBBoxLocal (const AtShaderGlobals *sg) |
Get the object-space bounds of the current object. More... | |
AI_API AtBBox | AiShaderGlobalsGetBBoxWorld (const AtShaderGlobals *sg) |
Get the world-space bounds of the current object. More... | |
AI_API AtVector | AiShaderGlobalsTransformNormal (const AtShaderGlobals *sg, AtVector N, int space) |
AI_API AtPoint | AiShaderGlobalsTransformPoint (const AtShaderGlobals *sg, AtPoint P, int space) |
AI_API AtVector | AiShaderGlobalsTransformVector (const AtShaderGlobals *sg, AtVector V, int space) |
AI_API void | AiShaderGlobalsSetTraceSet (AtShaderGlobals *sg, const char *set, bool inclusive) |
Takes a trace-set string and assigns it to the shader globals. More... | |
AI_API void | AiShaderGlobalsUnsetTraceSet (AtShaderGlobals *sg) |
Resets the trace-set for this shader globals. More... | |
AI_API void * | AiShaderGlobalsQuickAlloc (const AtShaderGlobals *sg, AtUInt32 size) |
Allocates temporary memory for this ray-tree. More... | |
AI_API AtVector | AiShaderGlobalsEvaluateBump (AtShaderGlobals *sg, AtFloatBumpEvaluator bump_func, void *data) |
Computes and returns a normal based on the current shading point and the specified bump-function. More... | |
AI_API bool | AiShaderGlobalsApplyOpacity (AtShaderGlobals *sg, AtRGB opacity) |
Computes and applies the given opacity setting to the shader globals probabilistically for increased efficiency. More... | |
AI_API float | AiShaderGlobalsEdgeLength (const AtShaderGlobals *sg) |
Computes the maximum (for now) edge length of a given polygon. More... | |
AI_API float | AiWireframe (const AtShaderGlobals *sg, float line_width, bool raster_space, int edge_type) |
Computes wireframe shading for a mesh. More... | |
void | AiFaceViewer (const AtShaderGlobals *sg, AtVector &n) |
Make the surface normal face the viewer. More... | |
Camera Information | |
AI_API float | AiCameraGetShutterStart () |
Fetch camera shutter start. More... | |
AI_API float | AiCameraGetShutterEnd () |
Fetch camera shutter end. More... | |
AI_API void | AiCameraToWorldMatrix (const AtNode *node, float time, AtMatrix out) |
Computes camera to world matrix. More... | |
AI_API void | AiWorldToCameraMatrix (const AtNode *node, float time, AtMatrix out) |
Computes world to camera matrix. More... | |
AI_API void | AiWorldToScreenMatrix (const AtNode *node, float time, AtMatrix out) |
Computes world to screen matrix. More... | |
Environment Mappings | |
AI_API void | AiMappingMirroredBall (const AtVector *dir, float *u, float *v) |
Maps a world-space direction vector to texture coordinates (u,v) based on the mirrored-ball mapping. More... | |
AI_API void | AiMappingAngularMap (const AtVector *dir, float *u, float *v) |
Maps a world-space direction vector to texture coordinates (u,v) based on an angular mapping. More... | |
AI_API void | AiMappingLatLong (const AtVector *dir, float *u, float *v) |
Maps a world-space direction vector to texture coordinates (u,v) based on the Latitude/Longitude mapping. More... | |
AI_API void | AiMappingCubicMap (const AtVector *dir, float *u, float *v) |
Maps a world-space direction vector to texture coordnates (u,v) based on a cubic mapping. More... | |
Derivatives for Environment Mappings | |
AI_API void | AiMappingMirroredBallDerivs (const AtVector *dir, const AtVector *dDdx, const AtVector *dDdy, float *u, float *v, float *dudx, float *dudy, float *dvdx, float *dvdy) |
Derivative version of AiMappingMirroredBall(). More... | |
AI_API void | AiMappingAngularMapDerivs (const AtVector *dir, const AtVector *dDdx, const AtVector *dDdy, float *u, float *v, float *dudx, float *dudy, float *dvdx, float *dvdy) |
Derivative version of AiMappingAngularMap(). More... | |
AI_API void | AiMappingLatLongDerivs (const AtVector *dir, const AtVector *dDdx, const AtVector *dDdy, float *u, float *v, float *dudx, float *dudy, float *dvdx, float *dvdy) |
Derivative version of AiMappingLatLong(). More... | |
AI_API void | AiMappingCubicMapDerivs (const AtVector *dir, const AtVector *dDdx, const AtVector *dDdy, float *u, float *v, float *dudx, float *dudy, float *dvdx, float *dvdy) |
Derivative version of AiMappingCubicMap(). More... | |
typedef float(* AtFloatBumpEvaluator)(AtShaderGlobals *sg, void *data) |
This function pointer points to float-based bump-mapping function for use by AiShaderGlobalsEvaluateBump().
This function would return the displacement height for the given shading context. This function would be called three times (on three different shading contexts). The returned displacements would be used to generate a triangle from which a normal is calculated.
sg | the current shading context |
data | user-defined data pointer |
AI_API AtColor AiOcclusion | ( | const AtVector * | N, |
const AtVector * | Ng, | ||
AtShaderGlobals * | sg, | ||
float | mint, | ||
float | maxt, | ||
float | spread, | ||
float | falloff, | ||
const AtSampler * | sampler, | ||
AtVector * | Nbent | ||
) |
Returns the ambient occlusion at a shading point.
Computes an ambient occlusion lookup: fire a number of hemispherical rays, return the ratio of hits/rays and, optionally, also return the bent normal.
Note that if N is set to the mirror direction, you get reflection occlusion. In the extreme, if spread is set to 0, you get sharp mirror occlusion.
The geometric normal is used for detecting occlusion rays that penetrate into the surface, thus biasing the result.
N | normal vector at the shading point | |
Ng | geometric normal | |
sg | the shader globals context where occlusion is evaluated | |
mint | minimum ray distance | |
maxt | maximum ray distance | |
spread | angular spread around the normal vector N, in the range [0,1], where 1 maps to 90 degrees (the full hemisphere) | |
falloff | exponential falloff rate for the occlusion along the ray distance | |
sampler | a two-dimensional AtSampler object that holds the number of samples to take per evaluation | |
[out] | Nbent | if non-NULL, the average direction to non-occluded areas, or bent normal, will be stored here |
AI_API AtColor AiDirectDiffuse | ( | const AtVector * | N, |
AtShaderGlobals * | sg | ||
) |
Returns the direct-lighting component of the irradiance at a shading point.
Computes the irradiance coming directly from all light sources in the scene, at shading point sg->P with normal N.
N | normal vector that defines the hemisphere of incoming radiance |
sg | shader globals context where irradiance is evaluated at |
AI_API AtColor AiHairDirectDiffuseCache | ( | const struct AtShaderGlobals * | sg | ) |
Return the direct irradiance interpolated from the hair diffuse cache.
This function stores direct diffuse lighting at hair vertices (technically: segment end points). The cache is filled on-demand on the first lookup.
This cache should only be used indirectly for GI rays, so the error introduced by interpolating within a segment is hopefully not too great (for directly viewed rays there is little benefit to using the diffuse cache because the specular highlights require their own light loop anyway).
sg | a shader globals context |
AI_API AtColor AiIndirectDiffuse | ( | const AtVector * | N, |
AtShaderGlobals * | sg | ||
) |
Returns the indirect-lighting component of the irradiance at a shading point.
Computes the indirect irradiance as an integral of the incident radiance over the hemisphere. The irradiance is computed at surface point sg->P.
This is usually called from shaders that need diffuse global illumination.
N | normal vector that defines the hemisphere of incoming radiance |
sg | shader globals context where irradiance is evaluated at |
Returns specular direction R from incident direction I and normal N.
I | incident direction | |
N | surface normal | |
[out] | R | outgoing mirror direction with respect to N |
AI_API void AiReflectSafe | ( | const AtVector * | I, |
const AtVector * | N, | ||
const AtVector * | Ng, | ||
AtVector * | R | ||
) |
Returns specular direction R from incident direction I and normal N.
This function should be used for Phong-smoothed meshes instead of AiReflect(). It makes sure the reflected vector doesn't penetrate below the geometric normal, which happens when the smooth (interpolated) normal points away from the viewing direction near silhouettes.
I | incident direction | |
N | surface normal | |
Ng | surface normal | |
[out] | R | outgoing mirror direction with respect to N |
Returns transmitted direction T from incident direction I and normal N.
I | incident direction | |
N | surface normal | |
[out] | T | outgoing transmitted direction with respect to N |
n1 | index of refraction (IOR) of the medium the incident ray travels in | |
n2 | index of refraction (IOR) of the medium the transmitted ray travels in |
Computes Fresnel reflectance at an air-dielectric interface for given normal and viewing vectors.
Uses Schlick's cos^5 approximation.
N | surface normal |
V | incident viewing direction |
Krn | reflectance at normal incidence, derived from the dielectric's IOR |
AI_API void AiFresnelWeightRGB | ( | const AtVector * | N, |
const AtVector * | V, | ||
const AtColor * | Krn, | ||
AtColor * | Kf | ||
) |
Optimized version of AiFresnelWeight() for RGB reflectance.
Using this function once avoids three calls to the scalar AiFresnelWeight(), saving a few CPU cycles.
N | surface normal | |
V | incident viewing direction | |
Krn | reflectance at normal incidence, derived from the dielectric's IOR | |
[out] | Kf | reflectance value, in [0,1]^3 |
Make a normal vector face forward with respect to a given vector.
Reverses vector N if needed, in order to make it face forward with respect to vector I.
[in,out] | N | surface normal |
I | incident direction |
Build an orthonormal basis aligned with vector N (Shirley's method).
This is Peter Shirley's method of building a local reference frame (U,V,W), where W = N. This method is discontinuous at the planes separating the spherical quadrants.
[out] | U | normalized U basis vector |
[out] | V | normalized V basis vector |
N | normalized vector that will serve as our W basis vector (usually this is a surface normal) |
Build an orthonormal basis aligned with vector N (polar method).
Builds local reference frame (U,V,W), where W = N. Uses the parametric tangent vectors in polar coordinates. This is continuous all across the sphere but at the poles.
[out] | U | normalized U basis vector |
[out] | V | normalized V basis vector |
N | normalized vector that will serve as our W basis vector (usually this is a surface normal) |
AI_API bool AiShaderGlobalsGetTriangle | ( | const AtShaderGlobals * | sg, |
int | key, | ||
AtPoint | p[3] | ||
) |
Get triangle vertices at a given motion key.
Return object-space triangle vertices at this shading context, at a given motion key. It is up to the caller to transform the vertices to world-space as needed.
sg | a shader globals context of type AI_CONTEXT_SURFACE | |
key | motion key to get the triangle at (if -1, vertices are interpolated at sg->time ) | |
[out] | p | output array of triangle vertices in object-space |
AI_API bool AiShaderGlobalsGetVertexNormals | ( | const AtShaderGlobals * | sg, |
int | key, | ||
AtVector | n[3] | ||
) |
Get normal vectors for all triangle vertices.
sg | a shader globals context of type AI_CONTEXT_SURFACE | |
key | motion key to get the normals at (if -1, normals are interpolated at sg->time ) | |
[out] | n | output array of triangle vertex normals |
AI_API bool AiShaderGlobalsGetVertexUVs | ( | const AtShaderGlobals * | sg, |
AtPoint2 | uv[3] | ||
) |
Get UV coordinates for all triangle vertices.
sg | a shader globals context of type AI_CONTEXT_SURFACE | |
[out] | uv | output array of UV coordinates |
AI_API AtUInt32 AiShaderGlobalsGetPolygon | ( | const AtShaderGlobals * | sg, |
int | key, | ||
AtPoint * | p | ||
) |
Get polygon vertices at a given motion key.
Return object-space polygon vertices at this shading context, at a given motion key. It is up to the caller to transform the vertices to world-space as needed.
Usage example:
sg | a shader globals context of type AI_CONTEXT_SURFACE | |
key | motion key to get the polygon at (if -1, vertices are interpolated at sg->time ) | |
[out] | p | if non-null, it will be filled with polygon vertices in object-space |
sg
AI_API void AiShaderGlobalsGetPositionAtTime | ( | const AtShaderGlobals * | sg, |
float | time, | ||
AtPoint * | P, | ||
AtVector * | N, | ||
AtVector * | Ng, | ||
AtVector * | Ns | ||
) |
Reproject the shading point to a different time.
The function will take in a shader globals and output a new position, smooth and geometric normal. Note that the normals are optional, if any of them is not needed, you may pass NULL
to avoid their calculation.
A typical use of this function is to reproject the shading point to time=0, so that the new point can be used to index into a user-created spatial data structure that was built at time=0 and thus has no support for motion-blur. For example, a static, octree-based irradiance cache.
sg | a shader globals context of type AI_CONTEXT_SURFACE | |
time | time at which sg->P will be reprojected | |
[out] | P | reprojected sg->P (required) |
[out] | N | reprojected sg->N (optional) |
[out] | Ng | reprojected sg->Ng (optional) |
[out] | Ns | reprojected sg->Ns (optional) |
AI_API AtPoint2 AiShaderGlobalsGetPixelMotionVector | ( | const AtShaderGlobals * | sg, |
float | time0, | ||
float | time1 | ||
) |
Compute motion vector.
Measures the motion of the hit point in screen space during the given time interval. This can be used to implement screen space motion vector shaders.
sg | shader globals for current hit point |
time0 | time from which to start the vector |
time1 | time at which to stop the vector |
AI_API AtBBox AiShaderGlobalsGetBBoxLocal | ( | const AtShaderGlobals * | sg | ) |
Get the object-space bounds of the current object.
sg | a shader globals context of type AI_CONTEXT_SURFACE |
AI_API AtBBox AiShaderGlobalsGetBBoxWorld | ( | const AtShaderGlobals * | sg | ) |
Get the world-space bounds of the current object.
sg | a shader globals context of type AI_CONTEXT_SURFACE |
AI_API void AiShaderGlobalsSetTraceSet | ( | AtShaderGlobals * | sg, |
const char * | set, | ||
bool | inclusive | ||
) |
Takes a trace-set string and assigns it to the shader globals.
Any ray created on the basis of this shader globals, will use this trace-set.
sg | shader globals context where the trace-set will be stored |
set | the trace-set string |
inclusive | indicates if the trace-set is to be treated as an inclusive set, as opposed to an exclusive one |
AI_API void AiShaderGlobalsUnsetTraceSet | ( | AtShaderGlobals * | sg | ) |
Resets the trace-set for this shader globals.
Sets the trace-set to NULL which indicates that trace-sets are to be ignored. While the same behavior can be achieved by calling AiShaderGlobalsSetTraceSet() and either passing in a NULL, or passing the name of a trace-set that doesn't exist and setting inclusive
to false, it is both cleaner and more efficient to use this function instead.
sg | shader globals context where the trace-set will be removed from |
AI_API void* AiShaderGlobalsQuickAlloc | ( | const AtShaderGlobals * | sg, |
AtUInt32 | size | ||
) |
Allocates temporary memory for this ray-tree.
This function returns a block of memory that will be accessible until the camera ray for this sample is done. The memory is allocated from an internal memory pool that is flushed after each sub-pixel sample. This is much faster than allocating memory via malloc()
or AiMalloc(). This can be useful to exchange data of type pointer or string within shader networks or across rays by using message passing.
sg | non-NULL shader globals context for the point being shaded |
size | number of bytes to allocate |
NULL
if either parameter was NULL
or 0 AI_API AtVector AiShaderGlobalsEvaluateBump | ( | AtShaderGlobals * | sg, |
AtFloatBumpEvaluator | bump_func, | ||
void * | data | ||
) |
Computes and returns a normal based on the current shading point and the specified bump-function.
This function will compute and return a perturbed normal based on the specified shading point and bump-mapping function. This function will create three new shader-globals contexts surrounding the shading point, and call the supplied bump-mapping function with the three new displaced shading contexts. Given a particular shading context, the bump-mapping function should return its associated displacement value (a float). The new normal is calculated based on a forward differencing of the the values returned by this bump-mapping function.
This function itself will not modify the incoming AtShaderGlobals, but it is possible that the bump-mapping function itself, or those functions that it might call, will modify the incoming 'sg'.
sg | shader globals context for the point whose perturbed normal is being computed |
bump_func | a bump-mapping function which returns a float-based displacement amount. This function will be executed three times with three different shading point contexts. |
data | an opaque user-pointer which is passed on to the bump-mapping function in order to help pass on state information. |
AI_API bool AiShaderGlobalsApplyOpacity | ( | AtShaderGlobals * | sg, |
AtRGB | opacity | ||
) |
Computes and applies the given opacity setting to the shader globals probabilistically for increased efficiency.
This function will compute an equivalent probabilistic opacity to that given as the parameter. It will then set the sg->out_opacity value with the result of this computation.
The function will return a boolean result indicating whether or not the resulting opacity is totally transparent. If the value is true, the sg->out_opacity was set to AI_RGB_BLACK and the shader can perform an early exit since its result will not be visible.
sg | shader globals context for the point whose probabilistic opacity is being applied |
opacity | opacity value upon which the probabilistic technique is applied |
AI_API float AiShaderGlobalsEdgeLength | ( | const AtShaderGlobals * | sg | ) |
Computes the maximum (for now) edge length of a given polygon.
This is currently used by the heatmap code in the utility
node.
sg | shader globals context at the shading point |
sg
AI_API float AiWireframe | ( | const AtShaderGlobals * | sg, |
float | line_width, | ||
bool | raster_space, | ||
int | edge_type | ||
) |
Computes wireframe shading for a mesh.
Returns 0 when the current point is close to the triangle's edges and 1 otherwise. A fractional value may be returned in between for anti-aliasing purposes. This can be used to render the wireframe of a mesh.
sg | shader globals context at the shading point |
line_width | the size of the lines in either pixel-space or world-space |
raster_space | if enabled, line_width works in pixel-space |
edge_type | this value should be one of AI_WIREFRAME_* |
|
inline |
Make the surface normal face the viewer.
Reverses vector sg->N if needed, in order to make it face forward with respect to viewing vector sg->Rd (not necessarily a camera ray).
sg | the current shading context | |
[out] | n | viewer-facing normal vector |
AI_API float AiCameraGetShutterStart | ( | ) |
Fetch camera shutter start.
AI_API float AiCameraGetShutterEnd | ( | ) |
Fetch camera shutter end.
This function correctly accounts for closed shutters and disabled motion blur.
Computes camera to world matrix.
Computes the matrix that transforms between camera space and world space. Camera space is defined such that +x is right, +y is up and looks down -z. This function accounts for camera motion blur by calculating the matrix at the requested time. If you are not interested in motion information, you can use options.reference_time or AiCameraGetShutterStart() for time.
If the provided node is invalid, not a camera or otherwise not initialized this function will return the identity matrix.
node | camera node to get matrix from | |
time | absolute time at which to calculate the matrix | |
[out] | out | this matrix will be filled with the camera to world matrix for the requested time |
Computes world to camera matrix.
Computes the matrix that transforms between world space and camera space. Camera space is defined such that +x is right, +y is up and looks down -z. This function accounts for camera motion blur by calculating the matrix at the requested time. If you are not interested in motion information, you can use options.reference_time or AiCameraGetShutterStart() for time.
If the provided node is invalid, not a camera or otherwise not initialized this function will return the identity matrix.
node | camera node to get matrix from | |
time | absolute time at which to calculate the matrix | |
[out] | out | this matrix will be filled with the world to camera matrix for the requested time |
Computes world to screen matrix.
Computes the matrix that transforms between world space and screen space. Screen space is defined such that +x is right, +y is up and looks down +z. After a homogenous transform and normalization by w, you will have x and y in [-1,+1] and z in [0,1] (which correspond to near and far clipping planes).
This function accounts for camera motion blur by calculating the matrix at the requested time. If you are not interested in motion information, you can use options.reference_time or AiCameraGetShutterStart() for time.
If the provided node is invalid, not a camera or otherwise not initialized this function will return the identity matrix.
node | camera node to get matrix from | |
time | absolute time at which to calculate the matrix | |
[out] | out | this matrix will be filled with the world to screen matrix for the requested time |
AI_API void AiMappingMirroredBall | ( | const AtVector * | dir, |
float * | u, | ||
float * | v | ||
) |
Maps a world-space direction vector to texture coordinates (u,v) based on the mirrored-ball mapping.
dir | World-space direction vector | |
[out] | u | Pointer to location in which to write u |
[out] | v | Pointer to location in which to write v |
AI_API void AiMappingAngularMap | ( | const AtVector * | dir, |
float * | u, | ||
float * | v | ||
) |
Maps a world-space direction vector to texture coordinates (u,v) based on an angular mapping.
dir | World-space direction vector | |
[out] | u | Pointer to location in which to write u |
[out] | v | Pointer to location in which to write v |
AI_API void AiMappingLatLong | ( | const AtVector * | dir, |
float * | u, | ||
float * | v | ||
) |
Maps a world-space direction vector to texture coordinates (u,v) based on the Latitude/Longitude mapping.
dir | World-space direction vector | |
[out] | u | Pointer to location in which to write u |
[out] | v | Pointer to location in which to write v |
AI_API void AiMappingCubicMap | ( | const AtVector * | dir, |
float * | u, | ||
float * | v | ||
) |
Maps a world-space direction vector to texture coordnates (u,v) based on a cubic mapping.
The cubic environment map is composed of 6 faces and must have the following layout:
This is also known as the Vertical Cross Cube format.
dir | World-space direction vector | |
[out] | u | Pointer to location in which to write u |
[out] | v | Pointer to location in which to write v |
AI_API void AiMappingMirroredBallDerivs | ( | const AtVector * | dir, |
const AtVector * | dDdx, | ||
const AtVector * | dDdy, | ||
float * | u, | ||
float * | v, | ||
float * | dudx, | ||
float * | dudy, | ||
float * | dvdx, | ||
float * | dvdy | ||
) |
Derivative version of AiMappingMirroredBall().
dir | World-space direction vector | |
dDdx | Directional derivative of the ray with respect to the x pixel coordinate | |
dDdy | Directional derivative of the ray with respect to the y pixel coordinate | |
[out] | u | Pointer to location in which to write u |
[out] | v | Pointer to location in which to write v |
[out] | dudx | Pointer to location in which to write dudx |
[out] | dudy | Pointer to location in which to write dudy |
[out] | dvdx | Pointer to location in which to write dvdx |
[out] | dvdy | Pointer to location in which to write dvdy |
AI_API void AiMappingAngularMapDerivs | ( | const AtVector * | dir, |
const AtVector * | dDdx, | ||
const AtVector * | dDdy, | ||
float * | u, | ||
float * | v, | ||
float * | dudx, | ||
float * | dudy, | ||
float * | dvdx, | ||
float * | dvdy | ||
) |
Derivative version of AiMappingAngularMap().
dir | World-space direction vector | |
dDdx | Directional derivative of the ray with respect to the x pixel coordinate | |
dDdy | Directional derivative of the ray with respect to the y pixel coordinate | |
[out] | u | Pointer to location in which to write u |
[out] | v | Pointer to location in which to write v |
[out] | dudx | Pointer to location in which to write dudx |
[out] | dudy | Pointer to location in which to write dudy |
[out] | dvdx | Pointer to location in which to write dvdx |
[out] | dvdy | Pointer to location in which to write dvdy |
AI_API void AiMappingLatLongDerivs | ( | const AtVector * | dir, |
const AtVector * | dDdx, | ||
const AtVector * | dDdy, | ||
float * | u, | ||
float * | v, | ||
float * | dudx, | ||
float * | dudy, | ||
float * | dvdx, | ||
float * | dvdy | ||
) |
Derivative version of AiMappingLatLong().
dir | World-space direction vector | |
dDdx | Directional derivative of the ray with respect to the x pixel coordinate | |
dDdy | Directional derivative of the ray with respect to the y pixel coordinate | |
[out] | u | Pointer to location in which to write u |
[out] | v | Pointer to location in which to write v |
[out] | dudx | Pointer to location in which to write dudx |
[out] | dudy | Pointer to location in which to write dudy |
[out] | dvdx | Pointer to location in which to write dvdx |
[out] | dvdy | Pointer to location in which to write dvdy |
AI_API void AiMappingCubicMapDerivs | ( | const AtVector * | dir, |
const AtVector * | dDdx, | ||
const AtVector * | dDdy, | ||
float * | u, | ||
float * | v, | ||
float * | dudx, | ||
float * | dudy, | ||
float * | dvdx, | ||
float * | dvdy | ||
) |
Derivative version of AiMappingCubicMap().
dir | World-space direction vector | |
dDdx | Directional derivative of the ray with respect to the x pixel coordinate | |
dDdy | Directional derivative of the ray with respect to the y pixel coordinate | |
[out] | u | Pointer to location in which to write u |
[out] | v | Pointer to location in which to write v |
[out] | dudx | Pointer to location in which to write dudx |
[out] | dudy | Pointer to location in which to write dudy |
[out] | dvdx | Pointer to location in which to write dvdx |
[out] | dvdy | Pointer to location in which to write dvdy |