Scene Info
Availability LightWave® 6.0
Component Layout
Header lwrender.h
The scene info global returns information about the current scene. This
information is read-only and reflects the state of the scene at the time
the global function is called. You can set these parameters using commands.
Beginning with LightWave® 9, certain portions of each scene camera's render settings
can be re-directed to use settings from a "global" camera. This global camera contains settings
for resolution, motion blur, and mask values that can be shared by one or more cameras in
the scene. The values reported in the Scene Info global for resolution and motion blur may
be the values contained by the global camera, if the selected camara has had its settings for
that area redirected (see the Camera Info global for information
about querying the state of these redirects). For example, if the global camera has a frame
size setting that is different than the selected camera's frame size, the values below for
frameWidth and frameHeight may be different for the same
camera depending upon the state of the "Use Global" flag for these settings.
Global Call
LWSceneInfo *sceneinfo;
sceneinfo = global( LWSCENEINFO_GLOBAL, GFUSE_TRANSIENT );
The global function returns a pointer to an LWSceneInfo.
typedef struct st_LWSceneInfo {
const char *name;
const char *filename;
int numPoints;
int numPolygons;
int renderType;
int renderOpts;
LWFrame frameStart;
LWFrame frameEnd;
LWFrame frameStep;
double framesPerSecond;
int frameWidth;
int frameHeight;
double pixelAspect;
int minSamplesPerPixel;
int maxSamplesPerPixel;
int limitedRegion[4];
int recursionDepth;
LWItemID (*renderCamera) (LWTime);
int numThreads;
const char *animFilename;
const char *RGBPrefix;
const char *alphaPrefix;
int antialiasing;
int enhancedAA;
int adaptiveSampling;
float adaptiveThreshold;
int filter;
int dblSidedAreaLights;
int loadInProgress;
int radiosityType;
int radiosityIndirectBounceCount;
int radiosityRaysPerEvaluation1;
int radiosityRaysPerEvaluation2;
double radiosityIntensity;
double radiosityAngularTolerance;
double radiosityMinimumPixelSpacing;
double radiosityMaximumPixelSpacing;
double radiosityMultiplier;
const char *radiosityFileName;
double radiosityMinimumPixelSpacing;
double causticsIntensity;
int causticsAccuracy;
int causticsSoftness;
int radiosityFlags;
double dynamicsRangeMin;
double dynamicsRangeMax;
double saturation;
int pixelFilterForceMT;
int has_multithreaded_filters;
int useZminmax;
double zmin;
double zmax;
int rendermode;
int calculateallnormals;
} LWSceneInfo;
-
name
-
User's name for the scene.
-
filename
-
Filename of the scene file.
- numPoints, numPolygons
-
Total number of points and polygons for all the objects in the scene.
- renderType
-
The render type, which can be one of the following.
LWRTYPE_WIRE
LWRTYPE_QUICK
LWRTYPE_REALISTIC
- renderOpts
-
This is a combination of bits for different rendering options. The bit
flags are
LWROPT_SHADOWTRACE
LWROPT_REFLECTTRACE
LWROPT_REFRACTTRACE
LWROPT_FIELDS
LWROPT_EVENFIELDS
LWROPT_MOTIONBLUR
LWROPT_DEPTHOFFIELD
LWROPT_LIMITEDREGION
LWROPT_PARTICLEBLUR
LWROPT_ENHANCEDAA
LWROPT_SAVEANIM
LWROPT_SAVERGB
LWROPT_SAVEALPHA
LWROPT_ZBUFFERAA
LWROPT_RTTRANSPARENCIES
LWROPT_RADIOSITY
LWROPT_CAUSTICS
LWROPT_OCCLUSION
LWROPT_RENDERLINES
LWROPT_INTERPOLATED
LWROPT_BLURBACKGROUND
LWROPT_USETRANSPARENCY
LWROPT_VOLUMETRICRADIOSITY
LWROPT_USEAMBIENT
LWROPT_DIRECTIONALRAYS
LWROPT_LIMITDYNAMICRANGE
LWROPT_CACHERADIOSITY
LWROPT_USEGRADIENTS
LWROPT_USEBEHINDTEST
LWROPT_CAUSTICSCACHE
LWROPT_EYECAMERA
LWROPT_UNPREMULTIPLIEDALPHA
LWROPT_EVENFIELDS is set only if field rendering is on and the
first line of the output image is from the field that comes first in time.
- frameStart, frameEnd
-
The numbers of the first and last frame defined for the scene. These are
the rendering limits, not to be confused with the limits set by the user
for previews (which you can get from the interface
info global).
- frameStep
-
The step size, in frames, during rendering (the user setting for the Frame
Step).
- framesPerSecond
-
Number of frames per playback second. This will ordinarily be 24 for film,
30 for NTSC video and 25 for PAL video. Note that this is the number of
frames, not fields.
- frameWidth, frameHeight
-
Rendered image size in pixels.
- pixelAspect
-
The aspect ratio of the pixels in the image, expressed as width/height.
Values greater than 1.0 mean short wide pixels and values less than 1.0
mean tall thin pixels.
- minSamplesPerPixel, maxSamplesPerPixel
-
Limits on the number of samples per pixel in the final image. Because of
different rendering techniques and adaptive sampling it is impossible to
compute a precise number of antialiasing samples at any pixel, but this
gives a range for the current rendering options.
- limitedRegion
-
The extents of the limited region area, in pixels. The extents are given
in the order x0, y0, x1, y1.
- recursionDepth
-
The maximum recursion depth for raytracing.
- camID = renderCamera( time )
-
Returns the item ID of the camera that will render the frame at the specified
time.
- numThreads
-
The number of threads of execution that will be used during rendering.
- animFilename
-
The name of the current animation file.
- RGBPrefix
-
The current RGB file saving prefix
- alphaPrefix
-
The current RGB file saving prefix
- antialiasing (rev.4+)
-
Current antialiasing setting, where zero (0) is off, or a value between 1 and 4
to indicate increasing antialiasing types.
LW8.2: current antialiasing setting 0=off, 1-lowest, increasing for higher
values (currently up to 4=extreme), 100 to 114; use PLD (with level 1
being 100 and level 15 being 114)
- enhancedAA (rev.4+)
-
Boolean value that indicates if Enhanced AA is enabled. 1=enabled, 0=disabled
- adaptiveSampling (rev.4+)
-
Boolean value that indicates if Adaptive Sampling is enabled. 1=enabled,
0=disabled
- adaptiveThreshold (rev.4+)
-
This contains the adaptive sampling threshold and is only valid when
adaptiveSampling is enabled.
- filter (rev.4+)
- Current Soft Filter setting. A value of zero (0) indicates no
filter, while a value of one (1) indicate Soft Filter is enabled.
LW8.2+:
bit 0:
- 0=no filter
- 1=soft filter
bits 1-5: indicate reconstruction filter:
- 1-3=box(std,sharp,soft)
- 4-6=Gaussian(std,sharp,soft)
- 7-9=Mitchell(std,sharp,soft)
- 10-12=Lanczos(std,sharp,soft)
- dblSidedAreaLights (rev.4+)
- Current setting for double sided area lights. on/off.
- loadInProgress (rev.5+)
- A value that indicates whether or not a scene load is currently in progress. Zero (0) means no
scene loading is taking place, 1 means a scene load (fresh) is occuring, and 2 means that load-from-scene
is bringing in new elements to the existing scene.
- radiosityType (rev.5+)
- This member can hold one of several values.
- LWRT_BackDrop
- Throws rays in random distribution, if miss, used backdrop color.
- LWRT_MonteCarlo
- Throws rays in a random distribution.
- LWRT_FinalGather
- Final Gather implementation.
- radiosityIndirectBounceCount (rev.5+)
- Number of radiosity bounces.
- radiosityRaysPerEvaluation1 (rev.5+)
- RPE, number of primary rays cast per evaluation point. These are the rays cast
by each primary evaluation point.
- radiosityRaysPerEvaluation2 (rev.5+)
- SBR, number of secondary rays cast per primary ray. These inform the primary
evaluation point with further shading details.
- radiosityIntensity (rev.5+)
- Scales the intensity of the radiosity solution.
- radiosityAngularTolerance (rev.5+)
- Defines the density of placement of radiosity samples for curved surfaces.
- radiosityMinimumPixelSpacing (rev.5+)
- Min.PS, minimum spacing of radiosity samples between output resolution pixels.
- radiosityMaximumPixelSpacing (rev.5+)
- Max.PS, maximum spacing of radiosity samples between output resolution pixels.
- radiosityMultiplier (rev.5+)
- Scales the output resolution of the camera internally to compute the GI at
lower/higher resolution.
- radiosityFileName (rev.5+)
- Location on the disk where the radiosity cache file is stored.
- causticsIntensity (rev.6+)
- Scales the intensity of the caustic illumination.
- causticsAccuracy (rev.6+)
- The accuracy of the caustic illumination.
- causticsSoftness (rev.6+)
- The softness of the caustic illumination.
- radiosityFlags (rev.6+)
- This is a combination of bits for different radiosity display flags. The bit
flags are
LWRDFLG_SHOW_NODES
LWRDFLG_SHOW_CELLS
LWRDFLG_SHOW_COLOR_CELLS
LWRDFLG_SHOW_SAMPLES
LWRDFLG_SHOW_MISSING_PREPROCESS_SAMPLES
LWRDFLG_SHOW_MISSING_RENDER_SAMPLES
LWRDFLG_SHOW_SECOND_BOUNCE
LWRDFLG_SHOW_BEHIND
LWRDFLG_USE_BUMPS
- dynamicsRangeMin (rev.6+)
- Dynamic range minimum value, typically 0.
- dynamicsRangeMax (rev.6+)
- Dynamic range maximum value, typically 1.
- saturation (rev.6+)
- Color saturation of the rendered frame.
- pixelFilterForceMT (rev.6+)
- Defaults to 0 to use the pixel filter flags to determine multi-threaded compatibility. Set to 1 to force pixel filters to render multi-threaded.
- has_multithreaded_filters (rev.6+)
- All active pixel filters are capable of multi-threading.
- useZminmax (rev.6+)
- The z buffer has been pre-normalized to the following minimum and maximum values.
- zmin (rev.6+)
- Pre-normalized minimum z value.
- zmax (rev.6+)
- Pre-normalized maximum z value.
- rendermode (rev.6+)
- Incicates which render mode the render was started in
lwrm_None
lwrm_SceneBake
lwrm_Scene
lwrm_FrameBake
lwrm_Frame
lwrm_Inspire
lwrm_SelectedObject
- calculateallnormals (rev.6+)
- This flag returns the state of the CalculateAllNormals command that forces the calculation of normals, in layout or while rendering.
- enableLenseFlares (rev.7+)
- This flag returns the state of the lense flare enable boolean.
- lenseFlareIntensity (rev.7+)
- This return the value of the lense flare intensity at the current time.
Example
This code fragment calculates the running time and frame aspect.
#include <lwserver.h>
#include <lwrender.h>
LWSceneInfo *lwsi;
double duration, frameAspect;
lwsi = global( LWSCENEINFO_GLOBAL, GFUSE_TRANSIENT );
if ( lwsi ) {
duration = ( lwsi->frameEnd - lwsi->frameStart + 1 )
/ lwsi->framesPerSecond;
frameAspect = lwsi->pixelAspect * lwsi->frameWidth
/ lwsi->frameHeight;
}
|