ai_shader_bsdf.h
Go to the documentation of this file.
1// Copyright 2025 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_color.h"
14#include "ai_ray.h"
15#include "ai_vector.h"
16#include "ai_shaderglobals.h"
17#include "ai_shader_closure.h"
18
27struct AtBSDF;
28
35};
36
37
40 uint8_t ray_type;
41 uint8_t flags;
42 AtString label;
43};
44
45
47typedef uint32_t AtBSDFLobeMask;
48static const AtBSDFLobeMask AI_BSDF_LOBE_MASK_NONE = 0x0;
49
50
53 AI_DEVICE AtBSDFLobeSample(AtRGB weight, float reverse_pdf, float pdf)
54 : weight(weight), reverse_pdf(reverse_pdf), pdf(pdf) { }
55
56 AI_DEVICE AtBSDFLobeSample(AtRGB eval)
57 : weight(eval), reverse_pdf(1.0f), pdf(1.0f) { }
58
59 AtBSDFLobeSample() = default;
60
61 AtRGB weight;
62 float reverse_pdf;
63 float pdf;
64};
65
66
74#ifdef AI_CPU_COMPILER
76{
77 int version;
78 void (*Init)(const AtShaderGlobals* sg,
79 AtBSDF* bsdf);
80 AtBSDFLobeMask (*Eval)(const AtBSDF* bsdf,
81 const AtVector& wi,
82 const AtBSDFLobeMask lobe_mask,
83 const bool need_pdf,
84 AtBSDFLobeSample out_lobes[]);
85 AtBSDFLobeMask (*Sample)(const AtBSDF* bsdf,
86 const AtVector rnd,
87 const float wavelength,
88 const AtBSDFLobeMask lobe_mask,
89 const bool need_pdf,
90 AtVectorDv& out_wi,
91 int& out_lobe_index,
92 AtBSDFLobeSample out_lobes[]);
93 AtRGB (*Albedo)(const AtBSDF* bsdf,
94 const AtShaderGlobals* sg,
95 const AtBSDFLobeMask lobe_mask);
96 bool (*Merge)(AtBSDF* bsdf,
97 const AtBSDF* other_bsdf);
98 AtClosureList (*Interior)(const AtShaderGlobals* sg,
99 AtBSDF* bsdf);
100};
101#endif // AI_CPU_COMPILER
102
104#define AI_BSDF_EXPORT_METHODS(tag) \
105bsdf_init; \
106bsdf_eval; \
107bsdf_sample; \
108static AtBSDFMethods ai_bsdf_methods = { \
109 0, \
110 Init, \
111 Eval, \
112 Sample, \
113 NULL, \
114 NULL, \
115 NULL, \
116}; \
117AtBSDFMethods* tag = &ai_bsdf_methods;
118
128#define bsdf_init \
129static void Init(const AtShaderGlobals* sg, \
130 AtBSDF* bsdf)
131
144#define bsdf_eval \
145static AtBSDFLobeMask Eval(const AtBSDF* bsdf, \
146 const AtVector& wi, \
147 const AtBSDFLobeMask lobe_mask, \
148 const bool need_pdf, \
149 AtBSDFLobeSample out_lobes[])
150
160#define bsdf_sample \
161static AtBSDFLobeMask Sample(const AtBSDF* bsdf, \
162 const AtVector rnd, \
163 const float wavelength, \
164 const AtBSDFLobeMask lobe_mask, \
165 const bool need_pdf, \
166 AtVectorDv& out_wi, \
167 int& out_lobe_index, \
168 AtBSDFLobeSample out_lobes[])
169
173#define bsdf_albedo \
174static AtRGB Albedo(const AtBSDF* bsdf, const AtShaderGlobals* sg, const AtBSDFLobeMask lobe_mask); \
175AI_OPTIONAL_METHOD_INSTALL(ai_bsdf_methods, Albedo) \
176static AtRGB Albedo(const AtBSDF* bsdf, const AtShaderGlobals* sg, const AtBSDFLobeMask lobe_mask)
177
188#define bsdf_merge \
189static bool Merge(AtBSDF* bsdf, const AtBSDF* other_bsdf); \
190AI_OPTIONAL_METHOD_INSTALL(ai_bsdf_methods, Merge) \
191static bool Merge(AtBSDF* bsdf, const AtBSDF* other_bsdf)
192
199#define bsdf_interior \
200static AtClosureList Interior(const AtShaderGlobals* sg, AtBSDF* bsdf); \
201AI_OPTIONAL_METHOD_INSTALL(ai_bsdf_methods, Interior) \
202static AtClosureList Interior(const AtShaderGlobals* sg, AtBSDF* bsdf)
203
204
208#ifdef AI_CPU_COMPILER
209AI_API AtBSDF* AiBSDF(const AtShaderGlobals* sg, const AtRGB& weight, const AtBSDFMethods* methods, size_t data_size);
210
211AI_API const AtBSDFMethods* AiBSDFGetMethods (const AtBSDF* bsdf);
212#endif // AI_CPU_COMPILER
213AI_API AI_DEVICE void* AiBSDFGetData (const AtBSDF* bsdf);
214AI_API const AtBSDFLobeInfo* AiBSDFGetLobes (const AtBSDF* bsdf);
215AI_API int AiBSDFGetNumLobes(const AtBSDF* bsdf);
216AI_API AI_DEVICE AtRGB AiBSDFGetWeight (const AtBSDF* bsdf);
217
218AI_API AI_DEVICE void AiBSDFSetDirectIndirect(AtBSDF* bsdf, float weight_direct, float weight_indirect);
219AI_API AI_DEVICE void AiBSDFGetDirectIndirect(const AtBSDF* bsdf, float& weight_direct, float& weight_indirect);
220
221AI_API AI_DEVICE void AiBSDFInitLobes (AtBSDF* bsdf, const AtBSDFLobeInfo* lobes, int num_lobes);
222AI_API AI_DEVICE void AiBSDFInitNormal(AtBSDF* bsdf, const AtVector& N, bool bounding);
223
224AI_API AI_DEVICE float AiBSDFBumpShadow (const AtVector& Ns, const AtVector& N, const AtVector& Ld);
225AI_API AI_DEVICE float AiBSDFMinRoughness(const AtShaderGlobals* sg);
226/*\}*/
227
228
235
244enum AtOrenNayarModel : unsigned char {
245
248
253
260{
262 AtRGB weight = AI_RGB_WHITE;
263
265 AtVector N = AI_V3_Z;
266
269
271 float r = 0.0f;
272
274 bool transmission = false;
275
278};
279
280AI_API AI_DEVICE AtBSDF* AiOrenNayarBSDF_private(const AtShaderGlobals* sg,
281 const AtOrenNayarBSDFParams& params);
282
283inline AI_DEVICE AtBSDF* AiOrenNayarBSDF(const AtShaderGlobals* sg,
284 const AtOrenNayarBSDFParams& params)
285{
286 return AiOrenNayarBSDF_private(sg, params);
287}
288
289AI_API AI_DEVICE AtBSDF*
290AiOrenNayarBSDF(const AtShaderGlobals* sg, const AtRGB& weight, const AtVector& N,
292 bool transmission = false, const AtString label = AtString());
293
294/* \}*/ // Diffuse BRDF
295
296
298
302#define AI_MICROFACET_BECKMANN 0x00
303#define AI_MICROFACET_GGX 0x01
311{
313 AtRGB weight = AI_RGB_WHITE;
314
317
319 AtVector N = AI_V3_Z;
320
322 AtVector U = AI_V3_ZERO;
323
325 float ior = 1.5f;
326
328 float rx = 0.f;
329
331 float ry = 0.f;
332
334 float haze_weight = 0.f;
335
337 float rx_haze = 0.f;
338
340 float ry_haze = 0.f;
341
344
348
351 float specular_weight = 1.0f;
352
354 float retro_reflectivity = 0.0f;
355
357 uint8_t exit_type = 0;
358
361};
362
363AI_API AI_DEVICE AtBSDF* AiMicrofacetBSDF_private(const AtShaderGlobals* sg,
364 const AtMicrofacetBSDFParams& params);
365
366inline AI_DEVICE AtBSDF* AiMicrofacetBSDF(const AtShaderGlobals* sg,
367 const AtMicrofacetBSDFParams& params)
368{
369 return AiMicrofacetBSDF_private(sg, params);
370}
371
372AI_API AI_DEVICE AtBSDF*
373AiMicrofacetBSDF(const AtShaderGlobals* sg, const AtRGB& weight, int distribution,
374 const AtVector& N, const AtVector* U, float ior, float rx, float ry,
375 uint8_t exit_type = 0, int32_t dielectric_priority = 0,
376 float thin_walled_transmission = 0, const AtString label = AtString());
377
384{
386 AtRGB weight = AI_RGB_WHITE;
387
390
392 AtVector N = AI_V3_Z;
393
395 AtVector U = AI_V3_ZERO;
396
398 float ior = 1.5f;
399
401 float rx = 0.f;
402
404 float ry = 0.f;
405
407 float haze_weight = 0.f;
408
410 float rx_haze = 0.f;
411
413 float ry_haze = 0.f;
414
416 float dispersion = 0.f;
417
418 // volumetric closure giving the (optional) embedded scattering/absorbing medium of the dielectric
419 AtClosureList interior_volume = AtClosureList();
420
422 bool use_fresnel = true;
423
426
429 float specular_weight = 1.0f;
430
432 uint8_t exit_type = 0;
433
436};
437
438AI_API AI_DEVICE AtBSDF*
441
442inline AI_DEVICE AtBSDF* AiMicrofacetRefractionBSDF(const AtShaderGlobals* sg,
444{
445 return AiMicrofacetRefractionBSDF_private(sg, params);
446}
447
448AI_API AI_DEVICE AtBSDF* AiMicrofacetRefractionBSDF(
449 const AtShaderGlobals* sg, const AtRGB& weight, int distribution, const AtVector& N,
450 const AtVector* U, float ior, float rx, float ry, float dispersion, bool use_fresnel = true,
451 AtClosureList interior_volume = AtClosureList(), uint8_t exit_type = 0,
452 int32_t dielectric_priority = 0, const AtString label = AtString());
453
460{
462 AtRGB weight = AI_RGB_WHITE;
463
466
468 AtVector N = AI_V3_Z;
469
471 AtVector U = AI_V3_ZERO;
472
474 float ior = 1.5f;
475
477 float rx = 0.f;
478
480 float ry = 0.f;
481
483 float haze_weight = 0.f;
484
486 float rx_haze = 0.f;
487
489 float ry_haze = 0.f;
490
493 float specular_weight = 1.0f;
494
496 uint8_t exit_type = 0;
497
500};
501
502AI_API AI_DEVICE AtBSDF* AiMicrofacetThinWallRefractionBSDF_private(
504
505inline AI_DEVICE AtBSDF*
508{
510}
511
512AI_API AI_DEVICE AtBSDF*
514 int distribution, const AtVector& N, const AtVector* U,
515 float eta, float rx, float ry, uint8_t exit_type = 0,
516 AtString label = AtString());
517
519
522AI_API AI_DEVICE void AiMicrofacetSetThinFilm(AtBSDF* bsdf, float weight, float thickness,
523 float ior);
524/* \}*/ // Thin-film modifier
525
526/* \}*/ // Microfacet BSDFs
527
528
530
533AI_API AI_DEVICE
534void AiMicrofacetSetThinFilm(AtBSDF* bsdf, float weight, float thickness, float ior);
535/* \}*/ // Thin-film modifier
536
537
539
549
552
556
563{
565 AtRGB weight = AI_RGB_WHITE;
566
569
571 AtVector N = AI_V3_Z;
572
574 AtVector U = AI_V3_ZERO;
575
578
581 AtRGB fresnel1 = AI_RGB_50GREY;
582
585 AtRGB fresnel2 = AI_RGB_WHITE;
586
589 float specular_weight = 1.0f;
590
592 float rx = 0.f;
593
595 float ry = 0.f;
596
598 float haze_weight = 0.f;
599
601 float rx_haze = 0.f;
602
604 float ry_haze = 0.f;
605
607 float retro_reflectivity = 0.0f;
608
611};
612
613AI_API AI_DEVICE AtBSDF* AiMetalBSDF_private(const AtShaderGlobals* sg,
614 const AtMetalBSDFParams& params);
615
616inline AI_DEVICE AtBSDF* AiMetalBSDF(const AtShaderGlobals* sg, const AtMetalBSDFParams& params)
617{
618 return AiMetalBSDF_private(sg, params);
619}
620
621AI_API AI_DEVICE AtBSDF* AiMetalBSDF(const AtShaderGlobals* sg, const AtRGB& weight,
622 int distribution, const AtVector& N, const AtVector* U,
623 AtMetalFresnelMode fresnel_mode, const AtRGB& fresnel1,
624 const AtRGB& fresnel2, float specular_weight,
625 float rx, float ry, const AtString label = AtString());
626
627/* \}*/ // Metal BRDF
628
630
633AI_API AI_DEVICE AtBSDF* AidEonBSDF(const AtShaderGlobals* sg, const AtRGB& absorption, const AtRGB weights[3],
634 const AtVector& tangent,
635 const float roughness_longitudinal, const float roughness_azimuthal,
636 const float eta, const float tilt, const AtString label = AtString());
637
638AI_API AI_DEVICE AtBSDF* AiZinkeBSDF(const AtShaderGlobals* sg, const AtRGB &weight, const AtVector& tangent,
639 const AtString label = AtString());
640
641/* \}*/ // Hair BSDFs
642
643
645
648AI_API AI_DEVICE AtBSDF* AiSheenBSDF(const AtShaderGlobals* sg, const AtRGB &weight, const AtVector& N,
649 const float r, const AtString label = AtString());
650
651AI_API AI_DEVICE AtBSDF* AiFuzzBSDF(const AtShaderGlobals* sg, const AtRGB &weight, const AtVector& N,
652 const float r, const AtString label = AtString());
653
654
655/* \}*/ // Sheen/Fuzz BRDF
656
657/* \}*/ // Built-in BSDFs
658
659
660
664AI_API void AiBSDFIntegrate(AtShaderGlobals* sg, AtRGB* direct, AtRGB* indirect, AtBSDF* bsdf);
665
666AI_API AI_DEVICE AtRGB AiBSDFAlbedo(const AtShaderGlobals* sg, AtBSDF* bsdf);
667/* \}*/
668
669/*\}*/
Color types and utilities.
Ray struct and various trace functions.
Shader closures.
Shader globals struct, methods and macros.
Vector math types, operators and utilities.
Arnold String allows for fast string comparisons.
Definition: ai_string.h:54
float rx_haze
specular roughness of haze lobe, along the U direction
Definition: ai_shader_bsdf.h:486
AtMetalFresnelMode
Metal Fresnel mode selection enum.
Definition: ai_shader_bsdf.h:548
AtBSDFLobeFlags
BSDF Lobe flags.
Definition: ai_shader_bsdf.h:30
AtOrenNayarModel
Oren-Nayar model selection enum.
Definition: ai_shader_bsdf.h:244
AtString label
label string
Definition: ai_shader_bsdf.h:435
AtRGB weight
BSDF weight.
Definition: ai_shader_bsdf.h:313
AtRGB fresnel1
either real part of the complex refractive index for Fresnel (GULBRANDSEN), or F0 reflectance at norm...
Definition: ai_shader_bsdf.h:581
float haze_weight
haze lobe mix weight
Definition: ai_shader_bsdf.h:483
AI_API AI_DEVICE void AiBSDFGetDirectIndirect(const AtBSDF *bsdf, float &weight_direct, float &weight_indirect)
Get the BSDF direct and indirect light contribution weights.
Definition: ai_shader_bsdf.cpp:977
#define AI_MICROFACET_GGX
GGX distribution.
Definition: ai_shader_bsdf.h:303
AtVector U
surface tangent vector along the U coordinate (the AI_V3_ZERO default auto-generates U from N).
Definition: ai_shader_bsdf.h:322
int32_t dielectric_priority
user-specified signed-integer dielectric priority, for nested dielectrics
Definition: ai_shader_bsdf.h:343
float haze_weight
haze lobe mix weight
Definition: ai_shader_bsdf.h:334
float ior
refractive index for Fresnel, use 0 to disable Fresnel
Definition: ai_shader_bsdf.h:325
AtRGB weight
BSDF weight.
Definition: ai_shader_bsdf.h:462
AI_API const AtBSDFLobeInfo * AiBSDFGetLobes(const AtBSDF *bsdf)
Get BSDF lobes, available after the BSDF has been initialized.
Definition: ai_shader_bsdf.cpp:932
float rx_haze
specular roughness of haze lobe, along the U direction
Definition: ai_shader_bsdf.h:410
AtVector U
surface tangent vector along the U coordinate (the AI_V3_ZERO default auto-generates U from N).
Definition: ai_shader_bsdf.h:574
float r
surface roughness, normalized in the [0, 1] range
Definition: ai_shader_bsdf.h:271
uint8_t exit_type
zero, AI_BSDF_LOBE_EXIT_BACKGROUND or AI_BSDF_LOBE_EXIT_WHITE
Definition: ai_shader_bsdf.h:432
AtMetalFresnelMode fresnel_mode
specify which Fresnel model to use for the metal (GULBRANDSEN or F82_TINT)
Definition: ai_shader_bsdf.h:577
AI_API AI_DEVICE AtBSDF * AiFuzzBSDF(const AtShaderGlobals *sg, const AtRGB &weight, const AtVector &N, const float r, const AtString label=AtString())
Create Fuzz BSDF for dusty/fuzzy/textile materials.
Definition: ai_shader_bsdf.cpp:780
AI_API AI_DEVICE AtBSDF * AiOrenNayarBSDF(const AtShaderGlobals *sg, const AtRGB &weight, const AtVector &N, AtOrenNayarModel model=AtOrenNayarModel::ENERGY_PRESERVING, float r=0.0f, bool transmission=false, const AtString label=AtString())
Create Oren-Nayar BSDF.
Definition: ai_shader_bsdf.cpp:204
float ry
specular roughness along the V direction
Definition: ai_shader_bsdf.h:595
AI_API AI_DEVICE AtBSDF * AiMetalBSDF(const AtShaderGlobals *sg, const AtRGB &weight, int distribution, const AtVector &N, const AtVector *U, AtMetalFresnelMode fresnel_mode, const AtRGB &fresnel1, const AtRGB &fresnel2, float specular_weight, float rx, float ry, const AtString label=AtString())
Create microfacet BSDF with conductive Fresnel, for metals.
Definition: ai_shader_bsdf.cpp:615
AtVector U
surface tangent vector along the U coordinate (the AI_V3_ZERO default auto-generates U from N).
Definition: ai_shader_bsdf.h:471
float rx
specular roughness along the U direction
Definition: ai_shader_bsdf.h:328
float ry
specular roughness along the V direction
Definition: ai_shader_bsdf.h:404
AtVector N
normal vector that defines the hemisphere of incoming radiance
Definition: ai_shader_bsdf.h:571
bool transmission
use diffuse transmission instead of reflection
Definition: ai_shader_bsdf.h:274
uint8_t exit_type
zero, AI_BSDF_LOBE_EXIT_BACKGROUND or AI_BSDF_LOBE_EXIT_WHITE
Definition: ai_shader_bsdf.h:496
AI_API void AiBSDFIntegrate(AtShaderGlobals *sg, AtRGB *direct, AtRGB *indirect, AtBSDF *bsdf)
Returns the direct and indirect radiance reflected by the provided BSDF.
Definition: ai_shader_bsdf.cpp:831
AI_API AI_DEVICE AtRGB AiBSDFAlbedo(const AtShaderGlobals *sg, AtBSDF *bsdf)
Returns BSDF albedo for incident direction sg->Rd, i.e.
Definition: ai_shader_bsdf.cpp:227
float ry_haze
specular roughness of haze lobe, along the V direction
Definition: ai_shader_bsdf.h:340
float retro_reflectivity
retro-reflectivity weight
Definition: ai_shader_bsdf.h:354
AtVector N
normal vector that defines the hemisphere of incoming radiance
Definition: ai_shader_bsdf.h:265
AI_API const AtBSDFMethods * AiBSDFGetMethods(const AtBSDF *bsdf)
Get BSDF methods.
Definition: ai_shader_bsdf.cpp:897
int distribution
AI_MICROFACET_BECKMANN or AI_MICROFACET_GGX
Definition: ai_shader_bsdf.h:389
AtString label
string label
Definition: ai_shader_bsdf.h:360
float ior
refractive index of the interior medium
Definition: ai_shader_bsdf.h:474
float specular_weight
modulates dielectric Fresnel factor, without disturbing refraction (as described in the OpenPBR >= v1...
Definition: ai_shader_bsdf.h:493
int distribution
distribution AI_MICROFACET_BECKMANN or AI_MICROFACET_GGX
Definition: ai_shader_bsdf.h:568
float rx
specular roughness along the U direction
Definition: ai_shader_bsdf.h:401
AtRGB fresnel2
either imaginary part of the complex refractive index for Fresnel (GULBRANDSEN), or tint applied at n...
Definition: ai_shader_bsdf.h:585
AtString label
string label
Definition: ai_shader_bsdf.h:277
AI_API AI_DEVICE AtBSDF * AiMicrofacetThinWallRefractionBSDF_private(const AtShaderGlobals *sg, const AtMicrofacetThinWallRefractionBSDFParams &params)
Create thin-walled microfacet refraction BSDF.
Definition: ai_shader_bsdf.cpp:471
AI_API AI_DEVICE void AiBSDFInitNormal(AtBSDF *bsdf, const AtVector &N, bool bounding)
Initialize BSDF normal.
Definition: ai_shader_bsdf.cpp:885
float specular_weight
scale factor applied (with a clamp) to the Fresnel factor, in the F82_TINT mode only (as described in...
Definition: ai_shader_bsdf.h:589
bool use_fresnel
set to true to include Fresnel term
Definition: ai_shader_bsdf.h:422
AI_API AI_DEVICE AtBSDF * AiMicrofacetBSDF_private(const AtShaderGlobals *sg, const AtMicrofacetBSDFParams &params)
Create microfacet reflection BSDF.
Definition: ai_shader_bsdf.cpp:260
AtRGB weight
BSDF weight.
Definition: ai_shader_bsdf.h:262
AI_API AI_DEVICE AtBSDF * AiSheenBSDF(const AtShaderGlobals *sg, const AtRGB &weight, const AtVector &N, const float r, const AtString label=AtString())
Create Sheen BSDF for cloth-like materials.
Definition: ai_shader_bsdf.cpp:741
AI_API AI_DEVICE void AiBSDFInitLobes(AtBSDF *bsdf, const AtBSDFLobeInfo *lobes, int num_lobes)
Initialize BSDF lobes.
Definition: ai_shader_bsdf.cpp:864
AI_API AI_DEVICE float AiBSDFBumpShadow(const AtVector &Ns, const AtVector &N, const AtVector &Ld)
Compute BSDF shadow factor to solve shading artifacts with bump mapping.
Definition: ai_shader_bsdf.cpp:1017
float rx_haze
specular roughness of haze lobe, along the U direction
Definition: ai_shader_bsdf.h:601
uint8_t exit_type
zero, AI_BSDF_LOBE_EXIT_BACKGROUND or AI_BSDF_LOBE_EXIT_WHITE
Definition: ai_shader_bsdf.h:357
int distribution
AI_MICROFACET_BECKMANN or AI_MICROFACET_GGX
Definition: ai_shader_bsdf.h:465
AtString label
label string
Definition: ai_shader_bsdf.h:610
AI_API AI_DEVICE void AiMicrofacetSetThinFilm(AtBSDF *bsdf, float weight, float thickness, float ior)
Set the thickness and refractive index of a thin film layered on top of a microfacet surface.
Definition: ai_shader_bsdf.cpp:995
int distribution
AI_MICROFACET_BECKMANN or AI_MICROFACET_GGX
Definition: ai_shader_bsdf.h:316
float specular_weight
modulates dielectric Fresnel factor, without disturbing refraction (as described in the OpenPBR >= v1...
Definition: ai_shader_bsdf.h:351
uint32_t AtBSDFLobeMask
BSDF lobe bitmask.
Definition: ai_shader_bsdf.h:47
float ry_haze
specular roughness of haze lobe, along the V direction
Definition: ai_shader_bsdf.h:413
AI_API int AiBSDFGetNumLobes(const AtBSDF *bsdf)
Get the number of BSDF lobes, available after the BSDF has been initialized.
Definition: ai_shader_bsdf.cpp:943
float ry_haze
specular roughness of haze lobe, along the V direction
Definition: ai_shader_bsdf.h:489
float haze_weight
haze lobe mix weight
Definition: ai_shader_bsdf.h:407
float dispersion
Cauchy "C" coefficient for dispersion. Zero for no dispersion, higher values give more dispersion.
Definition: ai_shader_bsdf.h:416
float ry
specular roughness of core lobe, along the V direction
Definition: ai_shader_bsdf.h:480
AtVector N
normal vector that defines the hemisphere of incoming radiance
Definition: ai_shader_bsdf.h:468
AI_API AI_DEVICE AtBSDF * AiMicrofacetRefractionBSDF(const AtShaderGlobals *sg, const AtRGB &weight, int distribution, const AtVector &N, const AtVector *U, float ior, float rx, float ry, float dispersion, bool use_fresnel=true, AtClosureList interior_volume=AtClosureList(), uint8_t exit_type=0, int32_t dielectric_priority=0, const AtString label=AtString())
Create microfacet refraction BSDF.
Definition: ai_shader_bsdf.cpp:436
float retro_reflectivity
retro-reflectivity weight
Definition: ai_shader_bsdf.h:607
AtOrenNayarModel model
select Oren-Nayar model variant
Definition: ai_shader_bsdf.h:268
int32_t dielectric_priority
user-specified signed-integer dielectric priority, for nested dielectrics
Definition: ai_shader_bsdf.h:425
AI_API AI_DEVICE AtBSDF * AidEonBSDF(const AtShaderGlobals *sg, const AtRGB &absorption, const AtRGB weights[3], const AtVector &tangent, const float roughness_longitudinal, const float roughness_azimuthal, const float eta, const float tilt, const AtString label=AtString())
Create d'Eon BSDF for hair.
Definition: ai_shader_bsdf.cpp:661
AI_API AtBSDF * AiBSDF(const AtShaderGlobals *sg, const AtRGB &weight, const AtBSDFMethods *methods, size_t data_size)
Allocate a BSDF and data memory to store parameters.
Definition: ai_shader_bsdf.cpp:127
float rx_haze
specular roughness of haze lobe, along the U direction
Definition: ai_shader_bsdf.h:337
AI_API AI_DEVICE AtBSDF * AiZinkeBSDF(const AtShaderGlobals *sg, const AtRGB &weight, const AtVector &tangent, const AtString label=AtString())
Create Zinke BSDF for hair with Lambertian reflectance properties.
Definition: ai_shader_bsdf.cpp:709
float haze_weight
haze lobe mix weight
Definition: ai_shader_bsdf.h:598
float ry
specular roughness along the V direction
Definition: ai_shader_bsdf.h:331
AI_API AI_DEVICE void AiBSDFSetDirectIndirect(AtBSDF *bsdf, float weight_direct, float weight_indirect)
Set the BSDF direct and indirect light contribution weights.
Definition: ai_shader_bsdf.cpp:961
float ior
refractive index for Fresnel, use 0 to disable Fresnel
Definition: ai_shader_bsdf.h:398
AI_API AI_DEVICE AtRGB AiBSDFGetWeight(const AtBSDF *bsdf)
Get the BSDF weight.
Definition: ai_shader_bsdf.cpp:920
AtString label
label string
Definition: ai_shader_bsdf.h:499
AI_API AI_DEVICE AtBSDF * AiMetalBSDF_private(const AtShaderGlobals *sg, const AtMetalBSDFParams &params)
Create microfacet BSDF with conductive Fresnel, for metals.
Definition: ai_shader_bsdf.cpp:554
AI_API AI_DEVICE void * AiBSDFGetData(const AtBSDF *bsdf)
Get BSDF data memory to store BSDF parameters.
Definition: ai_shader_bsdf.cpp:909
AtVector U
surface tangent vector along the U coordinate (the AI_V3_ZERO default auto-generates U from N).
Definition: ai_shader_bsdf.h:395
AI_API AI_DEVICE AtBSDF * AiMicrofacetRefractionBSDF_private(const AtShaderGlobals *sg, const AtMicrofacetRefractionBSDFParams &params)
Create microfacet refraction BSDF.
Definition: ai_shader_bsdf.cpp:361
AtRGB weight
BSDF weight.
Definition: ai_shader_bsdf.h:565
AtVector N
normal vector that defines the hemisphere of incoming radiance
Definition: ai_shader_bsdf.h:319
AI_API AI_DEVICE AtBSDF * AiMicrofacetBSDF(const AtShaderGlobals *sg, const AtRGB &weight, int distribution, const AtVector &N, const AtVector *U, float ior, float rx, float ry, uint8_t exit_type=0, int32_t dielectric_priority=0, float thin_walled_transmission=0, const AtString label=AtString())
Create microfacet reflection BSDF.
Definition: ai_shader_bsdf.cpp:321
float thin_walled_transmission
fraction of the BRDF which represents a thin-walled dielectric (to be used in conjunction with AiMicr...
Definition: ai_shader_bsdf.h:347
AI_API AI_DEVICE AtBSDF * AiOrenNayarBSDF_private(const AtShaderGlobals *sg, const AtOrenNayarBSDFParams &params)
Create Oren-Nayar BSDF.
Definition: ai_shader_bsdf.cpp:164
AtVector N
normal vector that defines the hemisphere of incoming radiance
Definition: ai_shader_bsdf.h:392
float rx
specular roughness of core lobe, along the U direction
Definition: ai_shader_bsdf.h:477
AI_API AI_DEVICE AtBSDF * AiMicrofacetThinWallRefractionBSDF(const AtShaderGlobals *sg, const AtRGB &weight, int distribution, const AtVector &N, const AtVector *U, float eta, float rx, float ry, uint8_t exit_type=0, AtString label=AtString())
Create thin-walled microfacet refraction BSDF.
Definition: ai_shader_bsdf.cpp:522
AtRGB weight
BSDF weight.
Definition: ai_shader_bsdf.h:386
AI_API AI_DEVICE float AiBSDFMinRoughness(const AtShaderGlobals *sg)
Estimate a minimum roughness for specular BSDFs, to reduce noise from caustics.
Definition: ai_shader_bsdf.cpp:1066
float rx
specular roughness along the U direction
Definition: ai_shader_bsdf.h:592
float specular_weight
modulates dielectric Fresnel factor, without disturbing refraction (as described in the OpenPBR >= v1...
Definition: ai_shader_bsdf.h:429
float ry_haze
specular roughness of haze lobe, along the V direction
Definition: ai_shader_bsdf.h:604
@ GULBRANDSEN
based on "Artist Friendly Metallic Fresnel", Gulbrandsen, JCGT (2014)
Definition: ai_shader_bsdf.h:551
@ F82_TINT
based on the F82-tint model, from "Novel aspects of the Adobe Standard Material", Kutz et al....
Definition: ai_shader_bsdf.h:554
@ AI_BSDF_LOBE_WAVELENGTH_SAMPLE
Sampling the BSDF lobe requires a wavelength
Definition: ai_shader_bsdf.h:32
@ AI_BSDF_LOBE_SINGULAR
Sampling the BSDF always returns the same direction.
Definition: ai_shader_bsdf.h:31
@ AI_BSDF_LOBE_EXIT_WHITE
If ray depth exceeded, use white color
Definition: ai_shader_bsdf.h:34
@ AI_BSDF_LOBE_EXIT_BACKGROUND
If ray depth exceeded, use background color
Definition: ai_shader_bsdf.h:33
@ ENERGY_PRESERVING
energy preserving Oren-Nayar model (EON).
Definition: ai_shader_bsdf.h:251
@ QUALITATIVE
classic "qualitative" Oren-Nayar model (QON)
Definition: ai_shader_bsdf.h:247
BSDF lobe information.
Definition: ai_shader_bsdf.h:39
BSDF lobe sample.
Definition: ai_shader_bsdf.h:52
BSDF function table.
Definition: ai_shader_bsdf.h:76
Definition: ai_closure.h:85
AiMetalBSDF parameters.
Definition: ai_shader_bsdf.h:563
AiMicrofacetBSDF parameters.
Definition: ai_shader_bsdf.h:311
AiMicrofacetRefractionBSDF parameters.
Definition: ai_shader_bsdf.h:384
AiMicrofacetThinWallRefractionBSDF parameters.
Definition: ai_shader_bsdf.h:460
AiOrenNayarBSDF parameters.
Definition: ai_shader_bsdf.h:260
RGB color.
Definition: ai_color.h:32
Shader globals data structure.
Definition: ai_shaderglobals.h:45
Vector with differentials.
Definition: ai_vector.h:515
3D point (single precision)
Definition: ai_vector.h:30

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