37#define AI_RAY_UNDEFINED 0x00
38#define AI_RAY_CAMERA 0x01
39#define AI_RAY_SHADOW 0x02
40#define AI_RAY_DIFFUSE_TRANSMIT 0x04
41#define AI_RAY_SPECULAR_TRANSMIT 0x08
42#define AI_RAY_VOLUME 0x10
43#define AI_RAY_DIFFUSE_REFLECT 0x20
44#define AI_RAY_SPECULAR_REFLECT 0x40
45#define AI_RAY_SUBSURFACE 0x80
51#define AI_RAY_ALL_DIFFUSE (AI_RAY_DIFFUSE_TRANSMIT | AI_RAY_DIFFUSE_REFLECT)
52#define AI_RAY_ALL_SPECULAR (AI_RAY_SPECULAR_TRANSMIT| AI_RAY_SPECULAR_REFLECT)
53#define AI_RAY_ALL_REFLECT (AI_RAY_DIFFUSE_REFLECT | AI_RAY_SPECULAR_REFLECT)
54#define AI_RAY_ALL_TRANSMIT (AI_RAY_DIFFUSE_TRANSMIT | AI_RAY_SPECULAR_TRANSMIT)
55#define AI_RAY_ALL uint8_t(-1)
101#ifdef AI_CPU_COMPILER
Color types and utilities.
Matrix math type and methods.
Struct returned by AiTrace(), called "screen sample" for legacy reasons.
AtString class for fast comparisons.
Vector math types, operators and utilities.
Arnold String allows for fast string comparisons.
Definition: ai_string.h:46
const AtLightSample * light_sample
Associated light sample, for shadow rays only
Definition: ai_ray.h:82
AtVector dDdy
Partial derivative of ray direction wrt image-space Y coordinate.
Definition: ai_ray.h:88
uint16_t tid
Thread ID
Definition: ai_ray.h:70
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().
Definition: ai_rtrace.cpp:228
AtRGB weight
Ray weight, AI_RGB_WHITE for clean camera rays
Definition: ai_ray.h:83
uint8_t bounces_diffuse
Number of diffuse bounces so far
Definition: ai_ray.h:62
uint8_t type
Type of ray (AI_RAY_CAMERA, etc)
Definition: ai_ray.h:60
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.
Definition: ai_rtrace.cpp:55
float time
Time at which the ray was created, in [0,1)
Definition: ai_ray.h:84
AtVector origin
Ray origin
Definition: ai_ray.h:77
uint16_t sindex
Sub-pixel sample index when supersampling
Definition: ai_ray.h:72
float mindist
Minimum useful distance from the origin
Definition: ai_ray.h:79
int x
Raster-space X coordinate
Definition: ai_ray.h:73
AtVector dDdx
Partial derivative of ray direction wrt image-space X coordinate.
Definition: ai_ray.h:87
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 r...
Definition: ai_rtrace.cpp:180
AtString traceset
Trace-set for this ray
Definition: ai_ray.h:69
float py
Subpixel Y coordinate in [0,1)
Definition: ai_ray.h:76
AtVector dOdy
Partial derivative of ray origin wrt image-space Y coordinate
Definition: ai_ray.h:86
uint8_t bounces_specular
Number of specular bounces so far
Definition: ai_ray.h:63
float maxdist
Maximum useful distance from the origin (volatile while ray is traced)
Definition: ai_ray.h:80
AI_API AI_DEVICE void AiTraceBackground(const AtRay &ray, AtScrSample &sample)
Traces a ray against the background without touching the geometry.
Definition: ai_rtrace.cpp:930
const AtShaderGlobals * psg
Parent shader globals (last shaded)
Definition: ai_ray.h:81
uint8_t bounces
Number of bounces so far (0 for camera rays)
Definition: ai_ray.h:61
int y
Raster-space Y coordinate
Definition: ai_ray.h:74
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.
Definition: ai_rtrace.cpp:260
uint8_t bounces_volume
Number of volume bounces so far
Definition: ai_ray.h:66
AtVector dir
Unit ray direction
Definition: ai_ray.h:78
uint8_t bounces_transmit
Number of transmission bounces so far
Definition: ai_ray.h:65
uint8_t bounces_reflect
Number of reflection bounces so far
Definition: ai_ray.h:64
AtVector dOdx
Partial derivative of ray origin wrt image-space X coordinate
Definition: ai_ray.h:85
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...
Definition: ai_rtrace.cpp:846
float px
Subpixel X coordinate in [0,1)
Definition: ai_ray.h:75
bool inclusive_traceset
Is the trace-set inclusive or exclusive?
Definition: ai_ray.h:68
Light sample data structure.
Definition: ai_shader_lights.h:27
RGB color.
Definition: ai_color.h:32
Ray data structure.
Definition: ai_ray.h:59
Used to hold the result of AiTrace() calls.
Definition: ai_shader_sample.h:31
Shader globals data structure.
Definition: ai_shaderglobals.h:45
3D point (single precision)
Definition: ai_vector.h:30