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...
 

Macros

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
 
#define AI_RAY_DIFFUSE_TRANSMIT   0x04
 indirect diffuse transmission ray
 
#define AI_RAY_SPECULAR_TRANSMIT   0x08
 indirect specular transmission ray
 
#define AI_RAY_VOLUME   0x10
 indirect volume scattering ray
 
#define AI_RAY_DIFFUSE_REFLECT   0x20
 indirect diffuse reflection ray
 
#define AI_RAY_SPECULAR_REFLECT   0x40
 indirect specular reflection ray
 
#define AI_RAY_SUBSURFACE   0x80
 subsurface scattering probe ray
 
Ray Type Masks
#define AI_RAY_ALL_DIFFUSE   (AI_RAY_DIFFUSE_TRANSMIT | AI_RAY_DIFFUSE_REFLECT)
 all indirect diffuse ray types
 
#define AI_RAY_ALL_SPECULAR   (AI_RAY_SPECULAR_TRANSMIT| AI_RAY_SPECULAR_REFLECT)
 all indirect specular ray types
 
#define AI_RAY_ALL_REFLECT   (AI_RAY_DIFFUSE_REFLECT | AI_RAY_SPECULAR_REFLECT)
 all reflection ray types
 
#define AI_RAY_ALL_TRANSMIT   (AI_RAY_DIFFUSE_TRANSMIT | AI_RAY_SPECULAR_TRANSMIT)
 all transmission specular ray types
 
#define AI_RAY_ALL   uint8_t(-1)
 mask for all ray types
 

Functions

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 · www.arnoldrenderer.com