Data Structures
ai_shader_lights.h File Reference

Shader utilities for sampling direct lighting from light sources. More...

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

Go to the source code of this file.

Data Structures

struct  AtLightSample
 Light sample data structure. More...
 

Functions

Light Loop Methods

This is the API for looping over light source samples.

AI_API void AiLightsPrepare (AtShaderGlobals *sg)
 Initialize light loop. More...
 
AI_API bool AiLightsGetSample (AtShaderGlobals *sg, AtLightSample &sample)
 Get a sample within a light loop. More...
 
AI_API uint32_t AiLightsTrace (AtShaderGlobals *sg, const AtVector &dir, uint8_t ray_type, AtLightSample *&hits)
 Intersect all visible lights.
 
AI_API uint8_t AiLightsTraceRayTypes (AtShaderGlobals *sg)
 Returns bitmask of ray types for which AiLightsTrace can be used.
 
AI_API void AiLightsResetCache (AtShaderGlobals *sg)
 Reset the light cache before running another light loop. More...
 
AI_API AtRGB AiLightsIntegrateShadowMatte (AtShaderGlobals *sg, AtBSDF *bsdf=NULL)
 Get the shadow or occlusion value for the current shading point and the active set of lights using the specified BSDF. More...
 
Light Getter Methods

These getters are to avoid slow AiNodeGet*() calls to access light parameters. Only the most common attributes are exposed for now.

AI_API AI_PURE AtRGB AiLightGetColor (const AtNode *node)
 Fast getter method for parameter color.
 
AI_API AI_PURE float AiLightGetIntensity (const AtNode *node)
 Fast getter method for parameter intensity.
 
AI_API AI_PURE float AiLightGetDiffuse (const AtNode *node)
 Fast getter method for the light's diffuse shading multiplier.
 
AI_API AI_PURE float AiLightGetSpecular (const AtNode *node)
 Fast getter method for the light's specular reflection shading multiplier.
 
AI_API AI_PURE float AiLightGetTransmission (const AtNode *node)
 Fast getter method for the light's specular transmission shading multiplier.
 
AI_API AI_PURE float AiLightGetSSS (const AtNode *node)
 Fast getter method for the light's SSS shading multiplier.
 
AI_API AI_PURE float AiLightGetVolume (const AtNode *node)
 Fast getter method for the light's volume shading multiplier.
 
AI_API AI_PURE float AiLightGetInfluence (const AtShaderGlobals *sg, const AtNode *node, uint8_t ray_type)
 Get light shading multiplier depending on the shading context and ray type.
 
Light IES Format Parser

Not a shader specific call, this is called by plugins or host DCCs to parse IES files

AI_API bool AiLightIESLoad (const AtString filename, const unsigned int width, const unsigned int height, float *max_intensity, float *data)
 Loads an IES profile and returns a lat long array of intensity values. More...
 

Detailed Description

Shader utilities for sampling direct lighting from light sources.


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