Data Structures | Functions
ai_ray.h File Reference

Ray struct and various trace functions. More...

#include "ai_vector.h"
#include <stdint.h>
#include "ai_shader_sample.h"
#include "ai_string.h"
#include "ai_matrix.h"

Go to the source code of this file.

Data Structures

struct  AtRay
 Ray data structure. More...


Ray Types
#define AI_RAY_UNDEFINED   0x00
 undefined type
#define AI_RAY_CAMERA   0x01
 ray originating at the camera
#define AI_RAY_SHADOW   0x02
 shadow ray towards a light source
 indirect diffuse transmission ray
 indirect specular transmission ray
#define AI_RAY_VOLUME   0x10
 indirect volume scattering ray
 indirect diffuse reflection ray
 indirect specular reflection ray
#define AI_RAY_SUBSURFACE   0x80
 subsurface scattering probe ray
Ray Type Masks
 all indirect diffuse ray types
 all indirect specular ray types
 all reflection ray types
 all transmission specular ray types
#define AI_RAY_ALL   uint8_t(-1)
 mask for all ray types


AI_API AI_DEVICE AtRay AiMakeRay (uint8_t type, const AtVector &origin, const AtVector *dir, float maxdist, const AtShaderGlobals *sg)
 Creates a ray for tracing. More...
AI_API void AiReflectRay (AtRay &ray, const AtVector &normal, const AtShaderGlobals *sg)
 Computes and sets the reflected ray direction and proper ray direction differentials (ray->dDdx and ray->dDdy). More...
AI_API AI_DEVICE bool AiRefractRay (AtRay &ray, const AtVector &normal, float n1, float n2, const AtShaderGlobals *sg)
 Helps make a refracted ray with high quality ray derivatives when called after AiMakeRay(). More...
AI_API bool AiTrace (const AtRay &ray, const AtRGB &weight, AtScrSample &sample)
 Traces a ray through the whole scene, and for non-shadow rays, the radiance and first-hit information will be returned. More...
AI_API AI_DEVICE void AiTraceBackground (const AtRay &ray, AtScrSample &sample)
 Traces a ray against the background without touching the geometry. More...
AI_API bool AiTraceProbe (const AtRay &ray, AtShaderGlobals *sgout)
 Traces a ray through the whole scene and returns the first intersection, if there is one. More...

Detailed Description

Ray struct and various trace functions.

© 2020 Autodesk, Inc. · All rights reserved ·