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"

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

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...
 
Microfacet distributions
#define AI_MICROFACET_BECKMANN   0x00
 Beckmann distribution.
 
#define AI_MICROFACET_GGX   0x01
 GGX distribution.
 

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 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...
 
Built-in BSDFs
AI_API AI_DEVICE AtBSDF * AiOrenNayarBSDF (const AtShaderGlobals *sg, const AtRGB &weight, const AtVector &N, float r=0.0f, bool transmission=false, const AtString label=AtString())
 Create Oren-Nayar BSDF. More...
 
AI_API AI_DEVICE AtBSDF * AiMicrofacetBSDF (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, const AtString label=AtString())
 Create microfacet reflection BSDF. More...
 
AI_API AI_DEVICE AtBSDF * AiMicrofacetBSDF_private (const AtShaderGlobals *sg, const AtRGB &weight, int distribution, const AtVector &N, const AtVector *U, float ior, float rx, float ry, uint8_t exit_type, const AtString label, int32_t dielectric_importance)
 Create microfacet reflection BSDF. More...
 
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=NULL, uint8_t exit_type=0, const AtString label=AtString())
 Create microfacet refraction BSDF. More...
 
AI_API AI_DEVICE AtBSDF * AiMicrofacetRefractionBSDF_private (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, AtClosureList interior, uint8_t exit_type, const AtString label, int32_t dielectric_importance)
 Create microfacet refraction BSDF. More...
 
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...
 
AI_API AI_DEVICE void AiMicrofacetSetThinFilm (AtBSDF *bsdf, float thickness, float eta)
 Set the thickness and refractive index of a thin film layered on top of a microfacet surface. More...
 
AI_API AI_DEVICE AtBSDF * AiMetalBSDF (const AtShaderGlobals *sg, const AtRGB &weight, int distribution, const AtVector &N, const AtVector *U, const AtRGB &n, const AtRGB &k, float rx, float ry, const AtString label=AtString())
 Create microfacet BSDF with conductive Fresnel, for metals. More...
 
AI_API AI_DEVICE AtBSDF * AidEonBSDF (const AtShaderGlobals *sg, const AtRGB &absorption, const AtRGB weights[3], const AtVector &tangent, const float roughness, 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...
 
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...
 
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...
 

Detailed Description

Various BSDF functions available to shader writers.


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