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

© 2022 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com