Lux::Camera Class Reference
[End-user classes for constructing a basic scenery]

Camera class. More...

#include <3D/Camera.hpp>

List of all members.

Public Types

Standard Antialiasing modes
Random Antialiasing modes
These modes provide slight random shifts on each ray within some pixel area, therefore any aliasing substructure which might still survive the regular antialising modes (e.g.

if the regular subpixel raster falls together with a small periodic texture) are whiped out. These modes have the same speed as the corresponding standard antialising modes (the random generator calls are neglectable).

Subpixel modes
Megapixel modes - modes which render more than one pixel at once

Public Member Functions

Public Attributes

Static Public Attributes

Private Member Functions

Classes


Detailed Description

Examples:

3.cpp, glass.cpp, k.cpp, k4.cpp, lsystem.cpp, main.cpp, meer.cpp, negobjs.cpp, nradial.cpp, sky.cpp, torus.cpp, vtrans.cpp, and wolke.cpp.


Member Enumeration Documentation

These settings determine the quality and speed of the generated image. The two-character code at the description of each mode gives the quality shortcut description as given on the command line.

Note:
On the source code level, more specific modes may be created by setting the Camera parameters Camera::Contrastlimit and Camera::Pixellimit .
Todo:
In a GUI, allow setting of Contrastlimit and Pixellimit .
Enumerator:
none  NA - No antialiasing: one ray per pixel, this is the standard and default mode.
per_pixel4  A4 - 4 rays per pixel
per_pixel9  A9 - 9 rays per pixel
per_pixel16  AA - 16 rays per pixel
random1  R1 - The position of the single ray is randomly shifted within its pixel.

Note that this mode provides some antialiasing effect at the speed of no antialiasing.

random4  R4 - Four rays are randomly distributed within one pixel
random9  R9 - Nine rays are randomly distributed within one pixel
random16  RN - 16 rays are randomly distributed within one pixel
dynamic  DA - Dynamic antialiasing This is praktically the best mode! Antialiasing is performed only where it is necessary, e.g.

at edges of objects, depending on the contrast of neighbouring pixels. Normally this gives nearly about the speed of the no antialiasing mode but with the same quality as the 16-rays antialiasing mode.

extreme_dynamic  XD - Extreme Dynamic Same as the Dynamic Antialiasing mode, but antialiasing might be as much as 25 rays per pixel! Practically, this difference can't be seen in usual images.

Nethertheless this mode is very effective for semisphere raytraced images.

adaptive  AP - Adaptive Antialiasing.

Same in the manner as the preview mode in the sense that it starts with 32x32 Megapixel rastering, but each Megapixel is subdivided to subpixel size, doing dynamic antialiasing where necessary. Theoretically, this mode can generate image quality like 16-time antialiasing at the speed of nearly the preview mode. Praktically, depending on the scene, this mode may loose some small objects (objects which lay within some low-contrast Megapixels).

fast_adaptive  FA - Fast Adaptive.

Same as Adaptive Antialiasing, but Megapixel subdividing is stopped when pixel size is reached, i.e. subpixel antialiasing is not done. Fading mode in timelike tracing (motion `blurr').

preview  PV - Preview mode This is almost the fastest mode available! The whole image is constructed by 32x32 Pixel subimages, each of them is interpolated by use of the edge point colors.

If the contrast between the edge points is very high, the subimage (the so called Megapixel) is subdivided into smaller Megapixels until some limit is reached. This mode produces very unsharp images and will loose some detail - but it can be up to 1024 (32*32) times faster than the normal raytracing mode and is perfect for a first overview of a scene!

megapixel  MP - Megapixel mode.

Ok, this mode is even faster than the PV mode, but it is not really useful, as it just renders the entire image in a 32x32 subsampling and interpolates the pixels. It is not really of practical use, it is just fast, it is only here for getting a very rough preview for complex scenes which are even too slow for the preview mode.


Constructor & Destructor Documentation

Lux::Camera::Camera ( const vector3 Position,
const vector3 Viewpoint = vector3(0,0,0),
const vector3 Up = vector3(0,0,1) 
)

Parameters:
Position,: the observer's position
Viewpoint,: the observer's view point, i.e. the point where he looks, by default the origin (0,0,0)
Up,: the `up' direction which specifies which direction is `up' for the observer. By default this is the zenith at (0,0,1), which might be appropriate for most circumstances. However, this default will definitely not work if the view direction is also towards the zenith. In such cases, where the view direction and the `up' direction are specified to be identical, the rendering process will be aborted with a runtime error message.

Lux::Camera::Camera ( const vector3 Standpunkt,
const Astro::altazimuth viewdir 
) [inline]

specifying two direction angles, horizontally (azimuthal angle, counted south-east-north-west) and vertically (altitude angle, zero when looking horizontally, 90 degrees when looking straight in the sky's zenith). By using this construction method, the `up' direction can be computed automatically for all view directions.


Member Function Documentation

RedshiftedColor Lux::Camera::BeamIntensity ( double  time,
double  dt,
Scene Welt,
const Gerade3 g,
double  pixelangle,
rgb_real Transmittance,
double &  lambda,
vector3 final_direction,
double  PA 
) const [private]

Parameters:
PA Stereographic parallax angle (zero for symmetric rendering), e.g. DefaultStereoParallax

rgb_real Lux::Camera::PixelIntensity ( double  time,
const PixelTraceParameter &  PTP,
rgb_real Transmittance,
double &  lambda,
vector3 final_direction,
double  dt 
) [private]

Parameters:
PA Stereo parallax, see class Lens, e.g. DefaultStereoParallax.

void Lux::Camera::now ( Scene Welt,
double  time 
) [private, virtual]

the Camera might move its position and must refocus its objectiv etc.

double Lux::Camera::PixelTime ( double  t,
double  x,
double  y 
) [private, virtual]

Parameters:
t The current time
x The normalized horizontal pixel coordinate in the range [0,1)
y The normalized vertical pixel coordinate in the range [0,1)
Returns:
The time to use for the specific pixel
Note:
Base class returns nothing interesting,

void Lux::Camera::GetParameters ( const Namespace::Chapter Params  ) 

Intensity map function

Camera::lookat which point to look at, alternatively use viewdir or azimuth parameters

Camera::viewdir (alternative) direction of view, use instead of lookat parameter

Examples:
nradial.cpp.

void Lux::Camera::use ( Objektiv L  )  [inline]

This is required before the camera can be used to create images; the camera itself just holds the observer parameters, but the Lens contains the various projections, like the view angle (using a wide angle lens, or telephoto lens with large magnification) and the projection type, e.g. a fisheye lens.

Parameters:
L the Lens
Examples:
3.cpp, k.cpp, k4.cpp, main.cpp, negobjs.cpp, nradial.cpp, sky.cpp, and torus.cpp.

void Lux::Camera::rewind (  )  [inline]

When doing animations, the frame number is incremented for each rendered image. The frame number is inserted into the file name if that contains an printf formatting sequence for integers, like `d'. `Rewinding' resets this image counter, which is overwise unique to each camera. Note that this might result in double exposures as in the real world, if over exposures is supported by the used Film Device.

int Lux::Camera::Frame_no (  )  const [inline]

See rewind() for more information on frame numbers.

bool Lux::Camera::expose ( Scene Scenery,
Frame frame,
double  t,
const StereoParameters SP 
)

Parameters:
pa Stereographic parallax in radians, e.g. DefaultStereoParallax. To create two stereographic images, call expose() with pa=+DefaultStereoParallax and pa=-DefaultStereoParallax.

bool Lux::Camera::expose ( Scene Scenery,
double  t,
const StereoParameters SP,
antialiasing  quality = none,
antialiasing  motion_quality = none 
)

The entire frame is exposed.

Parameters:
pa Stereographic parallax in radians, e.g. DefaultStereoParallax. To create two stereographic images, call expose() with pa=+DefaultStereoParallax and pa=-DefaultStereoParallax.

bool Lux::Camera::expose ( Scene Scenery,
double  t,
int  x1,
int  y1,
int  x2,
int  y2,
const StereoParameters SP,
antialiasing  quality = none,
antialiasing  motion_quality = none,
int  first_x1 = -1 
)

A subsection of the frame is exposed.

Parameters:
quality The spacelike antialiasing quality
motion_quality The timelike antialiasing quality, i.e. motion blur for moving objects.
pa Stereographic parallax in radians, e.g. DefaultStereoParallax. To create two stereographic images, call expose() with pa=+DefaultStereoParallax and pa=-DefaultStereoParallax.

bool Lux::Camera::autoexpose ( Scene Welt,
double  t,
const Namespace::Chapter Params 
)

Parameters:
Welt The Scene to render
argc,argv The command line Internally, a frame is generated according to the command line parameters, where a bunch of predefined standard options is evaluated. Beside this, the functionality is the same as for autoexpose(Scene&,Frame&).
Supported command line arguments:
Parameters:
--nodes-per-frame=5 How many processes to fork per frame. The number of nodes to use per frame. Note that stripe-parallel raytracing is only supported for parallel output devices, like targa files. It does *NOT* work for most graphic devices and and the current implementation of the jpeg driver.
--stereo Eye separation parameter when rendering in stereo mode. Stereo output is only supported on F5 Movies.
Note:
When rendering numbered frames (the filename contains an printf compatible format description like 03d), the number is taken from Frame_no().
See also:
rewind() Expose a frame according to the parameters given in the Namespace::Chapter describing a Camera.
Parameters:
Welt The Scene to render
Params A chapter for Camera parameters, e.g. as constructed by Namespace params; params.construct(argc,argv); autoexpose(...,..., params["Camera::"); Internally, a single frame is generated according to the command line parameters, where a bunch of predefined standard options is evaluated. Beside this, the functionality is the same as for autoexpose(Scene&,Frame&).
Supported command line arguments:
Parameters:
--nodes-per-frame=5 How many processes to fork per frame. The number of nodes to use per frame. Note that stripe-parallel raytracing is only supported for parallel output devices, like targa files. It does *NOT* work for most graphic devices and and the current implementation of the jpeg driver.
--stereo Eye separation parameter when rendering in stereo mode. Stereo output is only supported on F5 Movies.
Note:
When rendering numbered frames (the filename contains an printf compatible format description like 03d), the number is taken from Frame_no().
See also:
rewind()

void Lux::Camera::action ( Scene Welt,
const Namespace::Chapter Params,
double  t0 = 0.0,
double  t1 = 1.0,
int  N = 1,
double  itime = -1 
)

This is the mostly automated high-level function. In a parallel raytracing environment, the `--parallel --nodes=5' command line option may be specified to render 5 (e.g.) images in parallel.

Parameters:
World,: The Scene which shall be rendered
t0 (optional): animation start time (0.0 per default, can be overridden by the command line argument --t0=0.0)
t1 (optional): animation end time (1.0 per default, can be overridden by the command line argument --t1=1.0)
N (optional): number of frames (1 per default, can be overridden by the command line argument --frames=1)
integration_time (optional): for motion blur, time smoothing fraction if not specified, this is computed by the animation parameters, and there shouldn't be a reason to change this parameter under normal circumstances. Corresponding command line option is dt=0.5.
Supported command line arguments: These parameters may also be given as explicit parameters to Camera::action() (by default one frame is generated with initial time 0.0, finish time 1.0 with an shutter time of 1).

Parameters:
--t0 The animation's start time
--t1 The animation's end time
--frames The number of frames to generate; please note that the file name must contain a `05d' (or similar) formatting component to have different filenames generated for each frame.
--parallel Flag to enable frame-parallel raytracing
--nodes How many nodes to use maximally for frame parallel raytracing. Note that this number will be multiplicated with the number of nodes per frame (--nodes-per-frame parameter ) during an animation raytrace!
--initial_frame_number For animation sequences: The number of the first frame of a sequence. Note that each newly constructed Camera starts with a frame numbering zero. After rendering a sequence, the Frame_no() function gives the number of rendered images for this sequences. When rendering additional images with the same Camera, this sequence number is incremented and additional images are appended to the sequences. The rewind() function may be used to reset the Frame counter, or direct assignment to the frame_no member variable can be used to set a specific count. The --initial_frame_number allows a command line setting of the frame_no when calling the action() function.
--restart_frame The frame number within an animation sequence where to restart. Useful for continuing rendering animations. However, using this setting is normally not required, because each image rendering may be continued by each one itself. This option is thus only of use if frames from a previous rendering are not available on the same machine.
dt The integration time - shutter time of each exposure. Note that the shutter time does NOT influence the image brightness. If the given shutter time is negative, it will be set to the time slice of each frame. If set to zero, no motion blur will be performed.
Examples:
3.cpp, k.cpp, k4.cpp, main.cpp, nradial.cpp, and torus.cpp.

void Lux::Camera::action ( Scene Welt,
const Namespace::Chapter Params,
int &  argc,
const char *  argv[],
double  t0 = 0.0,
double  t1 = 1.0,
int  N = 1,
double  itime = -1 
)

Parameters:
argc,: command line argument argc from main()
argv,: command line argument argv from main()

bool Lux::Camera::readPath ( const char *  filename  ) 

It reads cameraposition(time) and Blickpunkt(time) upvec(time) from a ascii file with the following format:

1 23.234 234.23443 234.34 -456.546 -435.345 -3.4356 34.342 34.3434 234.343

The time var is assoc. as follows: abs(time) gives the FrameNr.

Returns:
false if some error occured.
Note:
The field of view is not handled by the camera. A time-dependent view angle must be done via a time-dependent lens.


Member Data Documentation

Todo:
rename to english

Please let it point to some dynamic child object of Camera::Interruptor, if other things shall happen than what is done in the base class. A previously existing object, which is pointed to by this data member, must be deleted prior to assigning a new one. The interruptor object is deleted by the Camera's destructor. If none exists at expose() time, the Camera will create one by its own. Set the ProgressInterruptor to NULL after eventual deletion of an external Interruptor object.


Generated on Wed Jun 17 20:00:26 2009 for Light++ by  doxygen 1.5.6