beastapi/beastlightsource.h Source File

beastlightsource.h
Go to the documentation of this file.
1 /*
2 Copyright 2014 Autodesk, Inc. All rights reserved.
3 Use of this software is subject to the terms of the Autodesk license agreement
4 provided at the time of installation or download, or which otherwise
5 accompanies this software in either electronic or hard copy form.
6 */
7 
8 
12 #ifndef BEASTLIGHTSOURCE_H
13 #define BEASTLIGHTSOURCE_H
14 
15 #include "beastapitypes.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif // __cplusplus
20 
24 typedef enum {
29 
34 
39 
44 
49 
54 
59 
60 } ILBLightType;
61 
65 typedef enum {
76 
81 
83 
87 typedef enum {
92 
97 
103 
107 typedef enum {
112 
117 
122 
126  ILB_LS_VISIBLE_FOR_GI = 0x00000008,
127 
128 } ILBLightStats;
129 
133 typedef enum {
147 
153 typedef uint32 ILBLightStatsMask;
154 
164 ILB_DLL_FUNCTION ILBStatus ILBCreatePointLight(ILBSceneHandle scene,
165  ILBConstString name,
166  const ILBMatrix4x4* transform,
167  const ILBLinearRGB* intensity,
168  ILBLightHandle* light);
169 
181 ILB_DLL_FUNCTION ILBStatus ILBCreateSpotLight(ILBSceneHandle scene,
182  ILBConstString name,
183  const ILBMatrix4x4* transform,
184  const ILBLinearRGB* intensity,
185  ILBLightHandle* light);
186 
198 ILB_DLL_FUNCTION ILBStatus ILBCreateDirectionalLight(ILBSceneHandle scene,
199  ILBConstString name,
200  const ILBMatrix4x4* transform,
201  const ILBLinearRGB* intensity,
202  ILBLightHandle* light);
203 
218 ILB_DLL_FUNCTION ILBStatus ILBCreateAreaLight(ILBSceneHandle scene,
219  ILBConstString name,
220  const ILBMatrix4x4* transform,
221  const ILBLinearRGB* intensity,
222  ILBLightHandle* light);
223 
238 ILB_DLL_FUNCTION ILBStatus ILBCreateWindowLight(ILBSceneHandle scene,
239  ILBConstString name,
240  const ILBMatrix4x4* transform,
241  const ILBLinearRGB* intensity,
242  ILBLightHandle* light);
243 
257 ILB_DLL_FUNCTION ILBStatus ILBCreateSkyLight(ILBSceneHandle scene,
258  ILBConstString name,
259  const ILBMatrix4x4* transform,
260  const ILBLinearRGB* intensity,
261  ILBLightHandle* light);
262 
275 ILB_DLL_FUNCTION ILBStatus ILBCreateAmbientLight(ILBSceneHandle scene,
276  ILBConstString name,
277  const ILBMatrix4x4* transform,
278  const ILBLinearRGB* intensity,
279  ILBLightHandle* light);
280 
287 ILB_DLL_FUNCTION ILBStatus ILBSetLightTransform(ILBLightHandle light,
288  const ILBMatrix4x4* transform);
289 
290 
297 ILB_DLL_FUNCTION ILBStatus ILBSetLightColor(ILBLightHandle light,
298  const ILBLinearRGB* color);
299 
306 ILB_DLL_FUNCTION ILBStatus ILBSetLightIntensity(ILBLightHandle light, float intensity);
307 
315 ILB_DLL_FUNCTION ILBStatus ILBSetCastShadows(ILBLightHandle light, ILBBool castShadows);
316 
325 ILB_DLL_FUNCTION ILBStatus ILBSetShadowRadius(ILBLightHandle light, float radius);
326 
335 ILB_DLL_FUNCTION ILBStatus ILBSetShadowAngle(ILBLightHandle light, float angleRadians);
336 
344 ILB_DLL_FUNCTION ILBStatus ILBSetShadowSamples(ILBLightHandle light, int32 samples);
345 
355 ILB_DLL_FUNCTION ILBStatus ILBAddLightLightLinks(ILBLightHandle light,
356  ILBLightLinkMode mode,
357  const ILBInstanceHandle* instances,
358  int32 count);
359 
378 ILB_DLL_FUNCTION ILBStatus ILBSetFalloff(ILBLightHandle light,
379  ILBFalloffType type,
380  float exponent,
381  float cutoff,
382  ILBBool clampToOne);
383 
394 ILB_DLL_FUNCTION ILBStatus ILBSetLightMaxRangeFalloff(ILBLightHandle light,
395  float cutoff,
396  float exponent);
397 
411 ILB_DLL_FUNCTION ILBStatus ILBSetLightExponentFalloff(ILBLightHandle light,
412  float cutoff,
413  float exponent,
414  ILBBool clampToOne);
415 
432  float cutoff,
433  float constant,
434  float linear,
435  float quadratic,
436  ILBBool clampToOne);
437 
457 ILB_DLL_FUNCTION ILBStatus ILBSetSpotlightCone(ILBLightHandle light,
458  float angleRadians,
459  float penumbraAngleRadians,
460  float penumbraExponent);
461 
472 ILB_DLL_FUNCTION ILBStatus ILBSetClippingPlanes(ILBLightHandle light, float nearDistance, float farDistance);
473 
481 ILB_DLL_FUNCTION ILBStatus ILBSetIntensityScale(ILBLightHandle light,
482  float directScale,
483  float indirectScale);
484 
492 ILB_DLL_FUNCTION ILBStatus ILBSetLightStats(ILBLightHandle light,
493  ILBLightStatsMask stats,
494  ILBLightStatOperation operation);
495 
507 ILB_DLL_FUNCTION ILBStatus ILBSetLightRampEntry(ILBLightHandle light,
508  float position,
509  const ILBLinearRGB* value);
510 
519  ILBTextureHandle texture);
520 
529 ILB_DLL_FUNCTION ILBStatus ILBSetLightDisplayName(ILBLightHandle light,
530  ILBConstString displayName);
531 
540 ILB_DLL_FUNCTION ILBStatus ILBSetSkyLightVolumeType(ILBLightHandle light,
541  ILBLightVolumeType type);
542 
550 ILB_DLL_FUNCTION ILBStatus ILBSetSkyLightTexture(ILBLightHandle light,
551  ILBTextureHandle texture);
552 
561  float filter);
562 
570 ILB_DLL_FUNCTION ILBStatus ILBSetLightVolumeType(ILBLightHandle light,
571  ILBLightVolumeType type);
572 
581 ILB_DLL_FUNCTION ILBStatus ILBChangeLightType(ILBLightHandle light,
582  ILBLightType newType,
583  ILBLightHandle* newHandle);
584 
592 ILB_DLL_FUNCTION ILBStatus ILBGetLightType(ILBLightHandle light,
593  ILBLightType* type);
594 
602 ILB_DLL_FUNCTION ILBStatus ILBGetLightTransform(ILBLightHandle light,
603  ILBMatrix4x4* transform);
604 
612 ILB_DLL_FUNCTION ILBStatus ILBGetLightName(ILBLightHandle light,
613  ILBStringHandle* name);
614 
623 ILB_DLL_FUNCTION ILBStatus ILBGetLightDisplayName(ILBLightHandle light,
624  ILBStringHandle* displayName);
625 
633 ILB_DLL_FUNCTION ILBStatus ILBGetLightColor(ILBLightHandle light,
634  ILBLinearRGB* color);
635 
643 ILB_DLL_FUNCTION ILBStatus ILBGetLightIntensity(ILBLightHandle light,
644  float* intensity);
645 
653 ILB_DLL_FUNCTION ILBStatus ILBGetLightCastShadows(ILBLightHandle light,
654  ILBBool* castShadows);
655 
663 ILB_DLL_FUNCTION ILBStatus ILBGetLightShadowSamples(ILBLightHandle light,
664  int32* shadowSamples);
665 
673 ILB_DLL_FUNCTION ILBStatus ILBGetLightFalloffType(ILBLightHandle light,
674  ILBFalloffType* type);
675 
684 ILB_DLL_FUNCTION ILBStatus ILBGetLightMaxRangeFalloff(ILBLightHandle light,
685  float* cutoff,
686  float* exponent);
687 
699 ILB_DLL_FUNCTION ILBStatus ILBGetLightExponentFalloff(ILBLightHandle light,
700  float* cutoff,
701  float* exponent,
702  ILBBool* clamp);
703 
718  float* cutoff,
719  float* constant,
720  float* linear,
721  float* quadratic,
722  ILBBool* clamp);
723 
732 ILB_DLL_FUNCTION ILBStatus ILBGetLightIntensityScale(ILBLightHandle light,
733  float* directScale,
734  float* indirectScale);
735 
745 ILB_DLL_FUNCTION ILBStatus ILBGetLightStats(ILBLightHandle light,
746  ILBLightStatsMask stats,
747  ILBLightStatsMask* result);
748 
766 ILB_DLL_FUNCTION ILBStatus ILBGetSpotlightCone(ILBLightHandle light,
767  float* angleRadians,
768  float* penumbraAngleRadians,
769  float* penumbraExponent);
770 
781 ILB_DLL_FUNCTION ILBStatus ILBGetClippingPlanes(ILBLightHandle light, float* nearDistance, float* farDistance);
782 
791 ILB_DLL_FUNCTION ILBStatus ILBGetShadowRadius(ILBLightHandle light, float* radius);
792 
801 ILB_DLL_FUNCTION ILBStatus ILBGetShadowAngle(ILBLightHandle light, float* angleRadians);
802 
813 
822 ILB_DLL_FUNCTION ILBStatus ILBGetSkyLightTexture(ILBLightHandle light, ILBTextureHandle* texture);
823 
832 ILB_DLL_FUNCTION ILBStatus ILBGetSkyLightTextureFilter(ILBLightHandle light, float* filter);
833 
843 
851 ILB_DLL_FUNCTION ILBStatus ILBDeleteLightSource(ILBLightHandle light);
852 
853 #ifdef __cplusplus
854 }
855 #endif // __cplusplus
856 
857 
858 #endif // BEASTLIGHTSOURCE_H
ILBStatus ILBSetLightIntensity(ILBLightHandle light, float intensity)
Sets light intensity for a light source.
ILBStatus ILBGetSkyLightTextureFilter(ILBLightHandle light, float *filter)
Gets texture filter size from a sky light.
ILBStatus ILBSetSpotlightCone(ILBLightHandle light, float angleRadians, float penumbraAngleRadians, float penumbraExponent)
Sets the cone angle for a spotlight.
ILBStatus ILBSetSkyLightVolumeType(ILBLightHandle light, ILBLightVolumeType type)
Sets light volume type for a sky light.
ILBStatus ILBGetLightFalloffType(ILBLightHandle light, ILBFalloffType *type)
Returns the falloff type from a light source.
This header is the base for getting platform consistent types for the Beast API.
ILBStatus ILBCreateWindowLight(ILBSceneHandle scene, ILBConstString name, const ILBMatrix4x4 *transform, const ILBLinearRGB *intensity, ILBLightHandle *light)
Add a window light to the scene It points in negative Y direction by default, use the matrix to chang...
ILBStatus ILBCreatePointLight(ILBSceneHandle scene, ILBConstString name, const ILBMatrix4x4 *transform, const ILBLinearRGB *intensity, ILBLightHandle *light)
Add a point light to the scene.
Computes falloff as (max((maxRange - distance), 0) / maxRange) ^ exponent .
Definition: beastlightsource.h:75
const ILBCharType * ILBConstString
Beast api const string type.
Definition: beastapitypes.h:245
ILBStatus ILBGetClippingPlanes(ILBLightHandle light, float *nearDistance, float *farDistance)
Gets distance to spotlight clipping planes.
ILBStatus ILBSetLightExponentFalloff(ILBLightHandle light, float cutoff, float exponent, ILBBool clampToOne)
Sets the falloff to type "Exponent" for a light source.
ILBStatus ILBAddLightLightLinks(ILBLightHandle light, ILBLightLinkMode mode, const ILBInstanceHandle *instances, int32 count)
Adds a light centric light link list.
ILBStatus ILBGetLightDisplayName(ILBLightHandle light, ILBStringHandle *displayName)
Gets the display name of a light source.
ILBStatus ILBSetShadowAngle(ILBLightHandle light, float angleRadians)
Sets the angle covered of the sky for a directional light or window light for shadow casting purposes...
Sky light.
Definition: beastlightsource.h:53
ILBStatus ILBSetLightVolumeType(ILBLightHandle light, ILBLightVolumeType type)
Sets light volume type for a light source.
ILBStatus ILBGetShadowRadius(ILBLightHandle light, float *radius)
Gets a radius for the light source as a shadow caster.
ILBStatus ILBSetLightProjectedTexture(ILBLightHandle light, ILBTextureHandle texture)
Sets a projected texture for a light source (gobo).
OpenGL-type fall off.
Definition: beastlightsource.h:80
ILBStatus ILBGetLightName(ILBLightHandle light, ILBStringHandle *name)
Gets the name of a light source.
Spot light.
Definition: beastlightsource.h:43
ILBStatus ILBGetLightType(ILBLightHandle light, ILBLightType *type)
Gets the type of a light source.
ILBStatus ILBCreateSpotLight(ILBSceneHandle scene, ILBConstString name, const ILBMatrix4x4 *transform, const ILBLinearRGB *intensity, ILBLightHandle *light)
Add a spot light to the scene.
ILBStatus ILBGetLightIntensity(ILBLightHandle light, float *intensity)
Gets light intensity for a light source.
Directional light.
Definition: beastlightsource.h:28
Sets the light stats supplied to false.
Definition: beastlightsource.h:137
ILBStatus ILBGetLightTransform(ILBLightHandle light, ILBMatrix4x4 *transform)
Gets the transform of a light source.
ILBStatus ILBCreateAreaLight(ILBSceneHandle scene, ILBConstString name, const ILBMatrix4x4 *transform, const ILBLinearRGB *intensity, ILBLightHandle *light)
Add an area light to the scene It points in negative Y direction by default, use the matrix to change...
Sets the light stats to the value of the light mask.
Definition: beastlightsource.h:145
ILBStatus ILBGetSkyLightVolumeType(ILBLightHandle light, ILBLightVolumeType *type)
Gets light volume type for a sky light.
ILBLightType
Describes light types.
Definition: beastlightsource.h:24
Matrix for transformations.
Definition: beastapitypes.h:383
A sphere volume.
Definition: beastlightsource.h:96
ILBStatus ILBGetLightExponentFalloff(ILBLightHandle light, float *cutoff, float *exponent, ILBBool *clamp)
Returns the falloff parameters from a light source with Exponent falloff.
ILBLightVolumeType
Describes different light volumes for light sources.
Definition: beastlightsource.h:87
ILBStatus ILBGetLightColor(ILBLightHandle light, ILBLinearRGB *color)
Gets the color of a light source.
Computes falloff as (1.0f / distance) ^ exponent Note that an exponent of 0 gives no falloff...
Definition: beastlightsource.h:70
Handle for Beast instance Intentionally hidden implementation.
Definition: beastapitypes.h:422
ILBStatus ILBSetClippingPlanes(ILBLightHandle light, float nearDistance, float farDistance)
Sets distance to spotlight clipping planes.
ILBStatus ILBSetLightDisplayName(ILBLightHandle light, ILBConstString displayName)
Sets the display name for the light source.
ILBStatus ILBGetLightVolumeType(ILBLightHandle light, ILBLightVolumeType *type)
Gets light volume type for a light source.
ILBStatus ILBSetShadowSamples(ILBLightHandle light, int32 samples)
Sets the maximum number of shadow samples for the light source.
ILBStatus ILBCreateDirectionalLight(ILBSceneHandle scene, ILBConstString name, const ILBMatrix4x4 *transform, const ILBLinearRGB *intensity, ILBLightHandle *light)
Add a directional light to the scene It points in negative Y direction by default, use the matrix to change its direction.
ILBLightStats
Status bit masks for light sources.
Definition: beastlightsource.h:107
Handle for Beast textures Intentionally hidden implementation.
Definition: beastapitypes.h:450
Point light.
Definition: beastlightsource.h:33
ILBStatus ILBSetLightColor(ILBLightHandle light, const ILBLinearRGB *color)
Sets the color for a light source.
ILBStatus ILBChangeLightType(ILBLightHandle light, ILBLightType newType, ILBLightHandle *newHandle)
Changes the type of a light source.
ILBLightLinkMode
Enum defining if a light link is inclusive or exclusive.
Definition: beastapitypes.h:540
ILBStatus ILBGetLightIntensityScale(ILBLightHandle light, float *directScale, float *indirectScale)
Gets scale for direct and indirect light intensity for a light source.
ILBStatus ILBGetLightMaxRangeFalloff(ILBLightHandle light, float *cutoff, float *exponent)
Returns the falloff parameters from a light source with MaxRange falloff.
ILBStatus ILBGetLightCastShadows(ILBLightHandle light, ILBBool *castShadows)
Returns whether a light source cast shadows.
ILBStatus ILBSetSkyLightTexture(ILBLightHandle light, ILBTextureHandle texture)
Sets a texture for a sky light.
Controls if the light source should be visible for global illumination rays.
Definition: beastlightsource.h:126
ILBStatus ILBSetCastShadows(ILBLightHandle light, ILBBool castShadows)
Flags whether the light cast shadows or not.
Area light.
Definition: beastlightsource.h:38
Handle for Beast light sources Intentionally hidden implementation.
Definition: beastapitypes.h:436
ILBStatus ILBCreateSkyLight(ILBSceneHandle scene, ILBConstString name, const ILBMatrix4x4 *transform, const ILBLinearRGB *intensity, ILBLightHandle *light)
Add a sky light to the scene It illuminates the whole scene by default, but this can be altered by se...
ILBStatus ILBSetLightPolynomialFalloff(ILBLightHandle light, float cutoff, float constant, float linear, float quadratic, ILBBool clampToOne)
Sets the falloff to type "Polynomial" for a light source.
Ambient light.
Definition: beastlightsource.h:58
Controls if the light source should be visible for camera rays.
Definition: beastlightsource.h:111
ILBStatus ILBGetShadowAngle(ILBLightHandle light, float *angleRadians)
Gets the angle covered of the sky for a directional light or window light for shadow casting purposes...
Window light.
Definition: beastlightsource.h:48
Color definition All colors are expressed in linear space as opposed to gamma corrected.
Definition: beastapitypes.h:338
uint32 ILBLightStatsMask
Type representing multiple light stats.
Definition: beastlightsource.h:153
Sets the light stats supplied to true.
Definition: beastlightsource.h:141
ILBStatus ILBSetIntensityScale(ILBLightHandle light, float directScale, float indirectScale)
Sets scale for direct and indirect light intensity for a light source.
ILBStatus ILBGetLightStats(ILBLightHandle light, ILBLightStatsMask stats, ILBLightStatsMask *result)
Query light stats for a light source.
int32 ILBBool
Bool type with a well defined size to avoid compatibility-problems.
Definition: beastapitypes.h:284
A cube volume.
Definition: beastlightsource.h:101
ILBStatus ILBSetFalloff(ILBLightHandle light, ILBFalloffType type, float exponent, float cutoff, ILBBool clampToOne)
Sets the falloff for a light source.
ILBStatus ILBGetLightShadowSamples(ILBLightHandle light, int32 *shadowSamples)
Returns the number of shadow samples a light source will use.
ILBStatus ILBSetShadowRadius(ILBLightHandle light, float radius)
Sets a radius for the light source as a shadow caster.
Controls if the light source should be visible for refraction rays.
Definition: beastlightsource.h:121
ILBStatus ILBSetLightRampEntry(ILBLightHandle light, float position, const ILBLinearRGB *value)
Adds a light ramp entry for falloff calculation.
ILBStatus ILBSetSkyLightTextureFilter(ILBLightHandle light, float filter)
Sets texture filter size for a sky light.
ILBFalloffType
Describes different falloff for light sources.
Definition: beastlightsource.h:65
Handle for Beast scenes Intentionally hidden implementation.
Definition: beastapitypes.h:408
ILBLightStatOperation
Selects if the light stats should be enabled or disabled.
Definition: beastlightsource.h:133
ILBStatus
Status codes for Beast API calls.
Definition: beastapitypes.h:153
ILBStatus ILBGetLightPolynomialFalloff(ILBLightHandle light, float *cutoff, float *constant, float *linear, float *quadratic, ILBBool *clamp)
Returns the falloff parameters from a light source with Polynomial falloff.
ILBStatus ILBSetLightStats(ILBLightHandle light, ILBLightStatsMask stats, ILBLightStatOperation operation)
Sets light status bits for a light source.
ILBStatus ILBCreateAmbientLight(ILBSceneHandle scene, ILBConstString name, const ILBMatrix4x4 *transform, const ILBLinearRGB *intensity, ILBLightHandle *light)
Add an ambient light to the scene.
Specified the whole 3D space.
Definition: beastlightsource.h:91
ILBStatus ILBGetSkyLightTexture(ILBLightHandle light, ILBTextureHandle *texture)
Gets a texture from a sky light.
ILBStatus ILBDeleteLightSource(ILBLightHandle light)
Deletes a light source from a scene.
ILBStatus ILBSetLightTransform(ILBLightHandle light, const ILBMatrix4x4 *transform)
Sets the transform for a light source.
Handle for Beast strings Intentionally hidden implementation.
Definition: beastapitypes.h:471
ILBStatus ILBSetLightMaxRangeFalloff(ILBLightHandle light, float cutoff, float exponent)
Sets the falloff to type "Max Range" for a light source.
Controls if the light source should be visible for reflection rays.
Definition: beastlightsource.h:116
ILBStatus ILBGetSpotlightCone(ILBLightHandle light, float *angleRadians, float *penumbraAngleRadians, float *penumbraExponent)
Gets the cone angle for a spotlight.