Data Structures | Macros | Typedefs | Enumerations
ai_shader_bsdf.h File Reference

Various BSDF functions available to shader writers. More...

#include "ai_color.h"
#include "ai_ray.h"
#include "ai_vector.h"
#include "ai_shaderglobals.h"
#include "ai_shader_closure.h"

Go to the source code of this file.

Data Structures

struct  AtBSDFLobeInfo
 BSDF lobe information. More...
 
struct  AtBSDFLobeSample
 BSDF lobe sample. More...
 
struct  AtBSDFMethods
 BSDF function table. More...
 
struct  AtOrenNayarBSDFParams
 AiOrenNayarBSDF parameters. More...
 
struct  AtMicrofacetBSDFParams
 AiMicrofacetBSDF parameters. More...
 
struct  AtMicrofacetRefractionBSDFParams
 AiMicrofacetRefractionBSDF parameters. More...
 
struct  AtMicrofacetThinWallRefractionBSDFParams
 AiMicrofacetThinWallRefractionBSDF parameters. More...
 
struct  AtMetalBSDFParams
 AiMetalBSDF parameters. More...
 

Macros

#define AI_BSDF_EXPORT_METHODS(tag)
 BSDF methods exporter. More...
 
#define bsdf_init
 Initialize BSDF when before it is used for the first time. More...
 
#define bsdf_eval
 Evaluate BSDF for the given incoming light direction. More...
 
#define bsdf_sample
 Sample BSDF for an incoming light direction, and evaluate BSDF. More...
 
#define bsdf_albedo
 Compute BSDF albedo for AOVs and importance sampling (optional method) More...
 
#define bsdf_merge
 Merge BSDF with another BSDF of the same type (optional method) More...
 
#define bsdf_interior
 Return volume closures describing the interior of the object. More...
 

Typedefs

typedef uint32_t AtBSDFLobeMask
 BSDF lobe bitmask.
 

Enumerations

enum  AtBSDFLobeFlags { AI_BSDF_LOBE_SINGULAR = 0x01 , AI_BSDF_LOBE_WAVELENGTH_SAMPLE = 0x02 , AI_BSDF_LOBE_EXIT_BACKGROUND = 0x04 , AI_BSDF_LOBE_EXIT_WHITE = 0x08 }
 BSDF Lobe flags. More...
 

Functions

Functions for implementing custom BSDFs
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. More...
 
AI_API const AtBSDFMethodsAiBSDFGetMethods (const AtBSDF *bsdf)
 Get BSDF methods. More...
 
AI_API AI_DEVICE void * AiBSDFGetData (const AtBSDF *bsdf)
 Get BSDF data memory to store BSDF parameters. More...
 
AI_API const AtBSDFLobeInfoAiBSDFGetLobes (const AtBSDF *bsdf)
 Get BSDF lobes, available after the BSDF has been initialized. More...
 
AI_API int AiBSDFGetNumLobes (const AtBSDF *bsdf)
 Get the number of BSDF lobes, available after the BSDF has been initialized. More...
 
AI_API AI_DEVICE AtRGB AiBSDFGetWeight (const AtBSDF *bsdf)
 Get the BSDF weight. More...
 
AI_API AI_DEVICE void AiBSDFSetDirectIndirect (AtBSDF *bsdf, float weight_direct, float weight_indirect)
 Set the BSDF direct and indirect light contribution weights. More...
 
AI_API AI_DEVICE void AiBSDFGetDirectIndirect (const AtBSDF *bsdf, float &weight_direct, float &weight_indirect)
 Get the BSDF direct and indirect light contribution weights. More...
 
AI_API AI_DEVICE void AiBSDFInitLobes (AtBSDF *bsdf, const AtBSDFLobeInfo *lobes, int num_lobes)
 Initialize BSDF lobes. More...
 
AI_API AI_DEVICE void AiBSDFInitNormal (AtBSDF *bsdf, const AtVector &N, bool bounding)
 Initialize BSDF normal. More...
 
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. More...
 
AI_API AI_DEVICE float AiBSDFMinRoughness (const AtShaderGlobals *sg)
 Estimate a minimum roughness for specular BSDFs, to reduce noise from caustics. More...
 
Thin-film modifier
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. More...
 
Hair BSDFs
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. More...
 
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. More...
 
Sheen/Fuzz BRDFs
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. More...
 
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. More...
 
BSDF integration
AI_API void AiBSDFIntegrate (AtShaderGlobals *sg, AtRGB *direct, AtRGB *indirect, AtBSDF *bsdf)
 Returns the direct and indirect radiance reflected by the provided BSDF. More...
 
AI_API AI_DEVICE AtRGB AiBSDFAlbedo (const AtShaderGlobals *sg, AtBSDF *bsdf)
 Returns BSDF albedo for incident direction sg->Rd, i.e. More...
 

Microfacet BSDFs

#define AI_MICROFACET_BECKMANN   0x00
 Beckmann distribution.
 
#define AI_MICROFACET_GGX   0x01
 GGX distribution.
 
AI_API AI_DEVICE AtBSDF * AiMicrofacetBSDF_private (const AtShaderGlobals *sg, const AtMicrofacetBSDFParams &params)
 Create microfacet reflection BSDF. More...
 
AI_DEVICE AtBSDF * AiMicrofacetBSDF (const AtShaderGlobals *sg, const AtMicrofacetBSDFParams &params)
 
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. More...
 
AI_API AI_DEVICE AtBSDF * AiMicrofacetRefractionBSDF_private (const AtShaderGlobals *sg, const AtMicrofacetRefractionBSDFParams &params)
 Create microfacet refraction BSDF. More...
 
AI_DEVICE AtBSDF * AiMicrofacetRefractionBSDF (const AtShaderGlobals *sg, const AtMicrofacetRefractionBSDFParams &params)
 
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. More...
 
AI_API AI_DEVICE AtBSDF * AiMicrofacetThinWallRefractionBSDF_private (const AtShaderGlobals *sg, const AtMicrofacetThinWallRefractionBSDFParams &params)
 Create thin-walled microfacet refraction BSDF. More...
 
AI_DEVICE AtBSDF * AiMicrofacetThinWallRefractionBSDF (const AtShaderGlobals *sg, const AtMicrofacetThinWallRefractionBSDFParams &params)
 
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. More...
 

Diffuse BRDF

enum  AtOrenNayarModel : unsigned char { QUALITATIVE , ENERGY_PRESERVING }
 Oren-Nayar model selection enum. More...
 
AI_API AI_DEVICE AtBSDF * AiOrenNayarBSDF_private (const AtShaderGlobals *sg, const AtOrenNayarBSDFParams &params)
 Create Oren-Nayar BSDF. More...
 
AI_DEVICE AtBSDF * AiOrenNayarBSDF (const AtShaderGlobals *sg, const AtOrenNayarBSDFParams &params)
 
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. More...
 

Metal BRDF

enum  AtMetalFresnelMode { GULBRANDSEN , F82_TINT }
 Metal Fresnel mode selection enum. More...
 
AI_API AI_DEVICE AtBSDF * AiMetalBSDF_private (const AtShaderGlobals *sg, const AtMetalBSDFParams &params)
 Create microfacet BSDF with conductive Fresnel, for metals. More...
 
AI_DEVICE AtBSDF * AiMetalBSDF (const AtShaderGlobals *sg, const AtMetalBSDFParams &params)
 
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. More...
 

Detailed Description

Various BSDF functions available to shader writers.


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