Go to the documentation of this file.
1 // Copyright 2020 Autodesk, Inc. All rights reserved.
2 //
3 // Use of this software is subject to the terms of the Autodesk license
4 // agreement provided at the time of installation or download, or which
5 // otherwise accompanies this software in either electronic or hard copy form.
12 #pragma once
13 #include "ai_params.h"
14 #include "ai_array.h"
15 #include "ai_color.h"
16 #include "ai_matrix.h"
17 #include "ai_vector.h"
18 #include "ai_string.h"
19 #include "ai_api.h"
20 #include <stdint.h> // uint32_t etc
22 // forward declarations
23 struct AtNode;
24 struct AtBucket;
25 struct AtLightSample;
26 struct AtShaderGlobalsPrivateInfo;
46  int32_t x;
47  int32_t y;
48  float px;
49  float py;
50  uint16_t si;
51  uint16_t transp_index;
54  float Rl;
55  uint16_t tid;
56  uint8_t Rt;
57  uint8_t bounces;
58  uint8_t bounces_diffuse;
59  uint8_t bounces_specular;
60  uint8_t bounces_reflect;
61  uint8_t bounces_transmit;
62  uint8_t bounces_volume;
63  bool fhemi;
64  float time;
78  float bu;
79  float bv;
80  float u;
81  float v;
82  uint32_t fi;
87  uint32_t nlights;
94  float dudx;
95  float dudy;
96  float dvdx;
97  float dvdy;
98  bool skip_shadow;
99  uint8_t sc;
104  AtShaderGlobalsPrivateInfo* privateinfo;
105  AI_DEVICE AtShaderGlobals() : privateinfo(NULL) {}
106 };
114 #define AI_CONTEXT_SURFACE 0x00
115 #define AI_CONTEXT_VOLUME 0x01
116 #define AI_CONTEXT_BACKGROUND 0x02
118 //#define AI_CONTEXT_INTERNAL 0x04
119 #define AI_CONTEXT_IMPORTANCE 0x05
120 /* \}*/
123 AI_API void AiShaderGlobalsDestroy(AtShaderGlobals* sg);
125 /*\}*/
AtMatrix Minv
world-to-local matrix transform
Definition: ai_shaderglobals.h:84
float u
U surface parameter.
Definition: ai_shaderglobals.h:80
AtVector P
shading point in world-space
Definition: ai_shaderglobals.h:70
float dvdy
V derivative wrt screen Y-axis.
Definition: ai_shaderglobals.h:97
float Rl
ray length (|Ro-P|)
Definition: ai_shaderglobals.h:54
AtVector dPdy
surface derivative wrt screen Y-axis
Definition: ai_shaderglobals.h:72
uint8_t Rt
ray type
Definition: ai_shaderglobals.h:56
uint16_t tid
thread ID
Definition: ai_shaderglobals.h:55
AtNode ** lights
array of active lights at this shading context
Definition: ai_shaderglobals.h:85
Light sample data structure.
Definition: ai_shader_lights.h:27
bool inclusive_traceset
is the trace-set inclusive?
Definition: ai_shaderglobals.h:100
AI_API AtShaderGlobals * AiShaderGlobals()
Allocate and initialize an AtShaderGlobals structure (a shading context)
Definition: ai_shaderglobals.cpp:23
AtParamValue out
shader output
Definition: ai_shaderglobals.h:102
uint8_t bounces_specular
ray specular depth level
Definition: ai_shaderglobals.h:59
This represents a node in Arnold.
AtMatrix M
local-to-world matrix transform
Definition: ai_shaderglobals.h:83
uint32_t nlights
number of active lights at this shading context
Definition: ai_shaderglobals.h:87
uint8_t bounces_volume
ray volume depth level
Definition: ai_shaderglobals.h:62
AtVector Ns
smoothed normal (same as N but without bump)
Definition: ai_shaderglobals.h:77
Vector math types, operators and utilities.
AtVector dDdy
ray direction derivative wrt screen Y-axis
Definition: ai_shaderglobals.h:91
AtVector dPdu
surface derivative wrt U parameter
Definition: ai_shaderglobals.h:88
AtVector Po
shading point in object-space
Definition: ai_shaderglobals.h:69
uint16_t transp_index
transparency index
Definition: ai_shaderglobals.h:51
AtVector Ng
geometric normal
Definition: ai_shaderglobals.h:75
Arnold String allows for fast string comparisons.
Definition: ai_string.h:46
bool skip_shadow
if true, don't trace shadow rays
Definition: ai_shaderglobals.h:98
3D point (single precision)
Definition: ai_vector.h:29
bool fhemi
force hemispherical lighting (use only upper hemisphere)
Definition: ai_shaderglobals.h:63
float time
absolute time, between shutter-open and shutter-close
Definition: ai_shaderglobals.h:64
Color types and utilities.
uint32_t fi
primitive ID (triangle, curve segment, etc)
Definition: ai_shaderglobals.h:82
uint8_t bounces_transmit
ray transmission depth level
Definition: ai_shaderglobals.h:61
AtVector Nf
face-forward shading normal
Definition: ai_shaderglobals.h:74
Definition: ai_matrix.h:30
DLL export prefix for API functions (necessary for multi-platform development)
int32_t y
Y raster-space coordinate of this ray tree.
Definition: ai_shaderglobals.h:47
Shader globals data structure.
Definition: ai_shaderglobals.h:45
uint16_t si
subpixel sample index
Definition: ai_shaderglobals.h:50
float dvdx
V derivative wrt screen X-axis.
Definition: ai_shaderglobals.h:96
float v
V surface parameter.
Definition: ai_shaderglobals.h:81
Generic array data type and methods.
uint8_t bounces
recursion level for the ray that created this hit
Definition: ai_shaderglobals.h:57
float px
subpixel X coordinate of this ray in [0,1)
Definition: ai_shaderglobals.h:48
AtShaderGlobalsPrivateInfo * privateinfo
extra information for internal use
Definition: ai_shaderglobals.h:104
float dudx
U derivative wrt screen X-axis.
Definition: ai_shaderglobals.h:94
uint8_t bounces_diffuse
ray diffuse depth level
Definition: ai_shaderglobals.h:58
AtVector dNdy
surface normal derivative wrt screen Y-axis
Definition: ai_shaderglobals.h:93
uint8_t bounces_reflect
ray reflection depth level
Definition: ai_shaderglobals.h:60
Actual parameter value for each supported type.
Definition: ai_params.h:105
AtVector Ro
ray origin (typically the camera position)
Definition: ai_shaderglobals.h:52
float bv
barycentric coordinate (aka beta, or v)
Definition: ai_shaderglobals.h:79
AtNode * Op
pointer to the object being shaded
Definition: ai_shaderglobals.h:65
float dudy
U derivative wrt screen Y-axis.
Definition: ai_shaderglobals.h:95
AtNode * proc
pointer to the procedural object (if exists)
Definition: ai_shaderglobals.h:66
float bu
barycentric coordinate (aka alpha, or u)
Definition: ai_shaderglobals.h:78
uint8_t sc
type of shading context
Definition: ai_shaderglobals.h:99
AtVector dNdx
surface normal derivative wrt screen X-axis
Definition: ai_shaderglobals.h:92
AtVector Rd
ray direction (normalized)
Definition: ai_shaderglobals.h:53
Node parameters.
AI_API void AiShaderGlobalsDestroy(AtShaderGlobals *sg)
Deallocate an AtShaderGlobals struct.
Definition: ai_shaderglobals.cpp:47
AtVector Ngf
face-forward geometric normal
Definition: ai_shaderglobals.h:76
int32_t x
X raster-space coordinate of this ray tree.
Definition: ai_shaderglobals.h:46
AtVector N
shading normal (in object space during displacement)
Definition: ai_shaderglobals.h:73
AtNode * shader
pointer to the current shader
Definition: ai_shaderglobals.h:67
AtVector dPdv
surface derivative wrt V parameter
Definition: ai_shaderglobals.h:89
float py
subpixel Y coordinate of this ray in [0,1)
Definition: ai_shaderglobals.h:49
AtVector dPdx
surface derivative wrt screen X-axis
Definition: ai_shaderglobals.h:71
AtLightSample * light_filter
light sample (for light filter shaders)
Definition: ai_shaderglobals.h:86
AtString traceset
trace-set to assign to rays made from this SG
Definition: ai_shaderglobals.h:101
Matrix math type and methods.
AtVector dDdx
ray direction derivative wrt screen X-axis
Definition: ai_shaderglobals.h:90
AtString class for fast comparisons.
const AtShaderGlobals * psg
parent shader globals (last shaded)
Definition: ai_shaderglobals.h:68

© 2020 Autodesk, Inc. · All rights reserved ·