Light InfoAvailability LightWave 6.0 Component Layout, ModelerHeader lwrender.h The light info global returns functions for getting light-specific information about any of the lights in a scene. Use the Item Info global to get the light list and for generic item information. The information returned by these functions is read-only, but you can use commands to set many of the parameters. Global Call LWLightInfo *lightinfo; lightinfo = global( LWLIGHTINFO_GLOBAL, GFUSE_TRANSIENT );The global function returns a pointer to an LWLightInfo. typedef struct st_LWLightInfo { void (*ambient) (LWTime, LWDVector color); int (*type) (LWItemID); void (*color) (LWItemID, LWTime, LWDVector color); int (*shadowType) (LWItemID); void (*coneAngles) (LWItemID, LWTime, double *radius, double *edge); unsigned int (*flags) (LWItemID); double (*range) (LWItemID, LWTime); int (*falloff) (LWItemID); LWImageID (*projImage) (LWItemID); int (*shadMapSize) (LWItemID); double (*shadMapAngle)(LWItemID, LWTime); double (*shadMapFuzz) (LWItemID, LWTime); int (*quality) (LWItemID); void (*rawColor) (LWItemID, LWTime, LWDVector color); double (*intensity) (LWItemID, LWTime); void (*shadowColor) (LWItemID, LWTime, LWDVector color); } LWLightInfo;
lighttype = type( light ) LWLIGHT_DISTANT LWLIGHT_POINT LWLIGHT_SPOT LWLIGHT_LINEAR LWLIGHT_AREA shadowtype = shadowType( light ) LWLSHAD_OFF LWLSHAD_RAYTRACE LWLSHAD_MAP settings = flags( light ) LWLFL_LIMITED_RANGE LWLFL_NO_DIFFUSE LWLFL_NO_SPECULAR LWLFL_NO_CAUSTICS LWLFL_LENS_FLARE LWLFL_VOLUMETRIC LWLFL_NO_OPENGL LWLFL_FIT_CONE LWLFL_CACHE_SHAD_MAPThe FIT_CONE flag indicates that the shadow map angle is set to the light's spotlight cone angle. falloff_type = falloff( light )
image = projImage( light ) size = shadMapSize( light ) angle = shadMapAngle( light, time ) fuzziness = shadMapFuzz( light, time ) index = quality( light ) rawColor( light, time, rgb ) level = intensity( light, time ) shadowColor( light, time, rgb ) In LightWave 7.5, the shadowColor function was added. Example This code fragment collects information about the first light. #include <lwserver.h> #include <lwrender.h> LWItemInfo *iteminfo; LWLightInfo *ltinfo; LWItemID id; LWTime t = 3.0; /* seconds */ LWDVector color; double range, radius, edge; int lighttype, shadowtype; unsigned int flags; iteminfo = global( LWITEMINFO_GLOBAL, GFUSE_TRANSIENT ); ltinfo = global( LWLIGHTINFO_GLOBAL, GFUSE_TRANSIENT ); if ( iteminfo && ltinfo ) { id = iteminfo->first( LWI_LIGHT, NULL ); lighttype = ltinfo->type( id ); shadowtype = ltinfo->shadowType( id ); flags = ltinfo->flags( id ); ltinfo->color( id, t, color ); if ( type == LWLIGHT_SPOT ) ltinfo->coneAngles( id, &radius, &edge ); if ( flags & LWLFL_LIMITED_RANGE ) range = ltinfo->range( id ); } |