Volumetric EvaluationAvailability LightWaveŽ 8.3 There are two globals available necessary to evaluate volumetrics in Layout: VRayFuncs and VolumetricEvaluationFuncs. The first handles volumetrics in general, and the latter handles Layout's implementation of them as plugins. Volumetrics are processing by generating rays to be fired into the scene. The volumetric plugins react to these rays and break the ray into ray segments. Each segments is assigned a color intensity and opacity for each color channel (red, green, blue). Once all the segments are specified, the ray is 'flattened', which is a process of converting the segments into a final opacity and intensity for each color channel for the original ray. The globals provided facilitate that process by allowing one to generate these rays and have the existing voluemtric plugins within Layout to process them. VRayFuncs The VRayFuncs global generate these rays and have the existing voluemtric plugins within Layout to process them. The process to follow is:
Global Call LWVRayFuncs *vrayfuncs; vrayfuncs = global( LWVRAYFUNCS_GLOBAL, GFUSE_TRANSIENT ); The global function returns a pointer to an LWVRayFuncs. typedef struct st_LWVRayFuncs { LWVolumeAccess* (*New) (void); LWError (*Destroy) (LWVolumeAccess *ray); void (*Init) (LWVolumeAccess *ray, double o[3], double dir[3], double nearClip, double farClip, int evalFlag, int hres, double hfov, double incMultiplier, LWIlluminateFunc *illuminate); void (*SetRenderFuncs) (LWVolumeAccess *ray, LWIlluminateFunc *illuminate, LWRayTraceFunc *rayTrace, LWRayCastFunc *rayCast, LWRayShadeFunc *rayShade, LWRayTraceModeFunc *rayTraceMode, LWIlluminateSampleFunc *illuminateSample, LWRandomFloatFunc *randomFloat ); double (*Flatten) (LWVolumeAccess *ray, double color[3], double opa[3]); } LWVRayFuncs; Global Call LWVolumetricEvaluationFuncs *volevalfuncs; volevalfuncs = global( LWVOLUMETRICEVALUATIONFUNCS_GLOBAL, GFUSE_TRANSIENT ); The global function returns a pointer to an LWVolumetricEvaluationFuncs. typedef struct st_LWVolumetricEvaluationFuncs { void (*init) (unsigned int slot, int LWINIT_context); void (*newtime) (unsigned int slot); double (*evaluate) (unsigned int slot, LWVolumeAccess *ray, unsigned short LWVOLF_raytype); void (*cleanup) (unsigned int slot); } LWVolumetricEvaluationFuncs; Example In order to get a volumetric plugin to evaluate outside of a render context:
|