SCM Library
Spherical Cube Map rendering library
 All Classes Files Functions Variables Friends Pages
Public Member Functions | List of all members
scm_render Class Reference

An scm_render manages the rendering of background and foreground spheres. More...

#include <scm-render.hpp>

Public Member Functions

 scm_render (int, int)
 Create a new render manager. Initialize the necessary OpenGL state framebuffer object state. More...
 
 ~scm_render ()
 Finalize all OpenGL state.
 
void set_size (int, int)
 Set the size of the off-screen render targets. This entails the destruction and recreation of OpenGL framebuffer objects, so it should not be called every frame.
 
void set_blur (int)
 Set the motion blur degree. Higher degrees incur greater rendering loads. 8 is an effective value. Set 0 to disable motion blur completely.
 
void set_wire (bool)
 Set the wireframe option.
 
int get_blur () const
 
bool get_wire () const
 
void render (scm_sphere *, scm_scene *, scm_scene *, scm_scene *, scm_scene *, const double *, const double *, int, int, double)
 Render the foreground and background with optional blur and dissolve. More...
 
void render (scm_sphere *, scm_scene *, scm_scene *, const double *, const double *, int, int)
 Render the foreground and background spheres without blur or dissolve. More...
 

Detailed Description

An scm_render manages the rendering of background and foreground spheres.

In the simplest case, this entails merely invoking the scm_sphere's render function to draw geometry to the screen. However, the render manager also supports motion blur and dissolve transitions. These features require the sphere to be rendered first to an off-screen buffer which is then drawn to the screen as a single rectangle with the appropriate shader enabled.

The render manager also maintains the wireframe debug option, which would otherwise conflict with more sophisticated capabilities.

Constructor & Destructor Documentation

scm_render::scm_render ( int  w,
int  h 
)

Create a new render manager. Initialize the necessary OpenGL state framebuffer object state.

Motion blur is disabled (set to zero) by default.

Parameters
wWidth of the off-screen render targets (in pixels).
hHeight of the off-screen render targets (in pixels).

Member Function Documentation

void scm_render::render ( scm_sphere sphere,
scm_scene fore0,
scm_scene fore1,
scm_scene back0,
scm_scene back1,
const double *  P,
const double *  M,
int  channel,
int  frame,
double  t 
)

Render the foreground and background with optional blur and dissolve.

Parameters
sphereSphere geometry manager to perform the rendering
fore0Foreground scene at the beginning of a dissolve
fore1Foreground scene at the end of a dissolve
back0Background scene at the beginning of a dissolve
back1Background scene at the end of a dissolve
PProjection matrix in OpenGL column-major order
MModel-view matrix in OpenGL column-major order
channelChannel index
frameFrame number
tDissolve time between 0 and 1
void scm_render::render ( scm_sphere sphere,
scm_scene fore,
scm_scene back,
const double *  P,
const double *  M,
int  channel,
int  frame 
)

Render the foreground and background spheres without blur or dissolve.

This function is usually called by the previous function as needed to produce the desired effects. Calling it directly is a legitimate means of circumventing these options.

Parameters
sphereSphere geometry manager to perform the rendering
foreForeground scene
backBackground scene
PProjection matrix in OpenGL column-major order
MModel-view matrix in OpenGL column-major order
channelChannel index
frameFrame number

The documentation for this class was generated from the following files: