PathMapEffect Class Reference

Main class for the PRM computation and usage application. This class encapsulates all resources needed for computing PRMs and using them in the final rendering. PRM resources may be generated, saved to files, or restored. More...

List of all members.

Public Member Functions

 PathMapEffect (LPDIRECT3DDEVICE9 device)
 constructor: allocates all resources
 ~PathMapEffect (void)
 destructor: releases all resources
void render ()
 renders the scene using the currently selected method
void renderWithPRM ()
 renders the scene, usings the PRMs for indirect illumination
void showPRMTexture ()
 displays a part of a PRM texture
void move (float fElapsedTime)
 moves the virtual world objects (camera, light)
void savePathMaps ()
 store all precomputed data for the scene in folder prm
void loadPathMaps ()
 restore all precomputed data for the scene from folder prm

Static Public Member Functions

static void addUiParameters (Parameters *parameters)
 adds controls for the user-adjustable application parameters

Public Attributes

CFirstPersonCamera * camera
 camera
CFirstPersonCamera * lightCamera
 primary light source (can be moved just like the real camera, and can be used as the camera)

Private Member Functions

void loadMesh (LPCWSTR fileName)
 private method that loads a mesh and its textures
LPDIRECT3DTEXTURE9 loadTexture (LPCWSTR fileName)
 private method to load a texture
void releaseTextures ()
 release material texture resources
void releaseMeshes ()
 release mesh resources
void releaseEntities ()
 release entities
void renderFullScreen (float depth=0.0f)
void createPRMTextures ()
 allocates PRM resources for every entity
void sampleSurfaceRadion (Radion &starter)
 finds a random entry point (all entities considered with equal probability)
void sampleSurfaceRadionUniform (Radion &starter)
 finds a random entry point (all entities considered with probability proporstional to surface area)
void shootRadionBush (Radion &starter, std::vector< Radion > &bushRadions)
 shoot virtual light sources from original entry point and add them to the vector
int clusterRadions (Radion *partition, int psize, char axis)
 sort radions into initial, uniform length clusters
void clusterRadionsKMeans ()
 use K-means clustering to cluster radions
void precompute ()
 perform computaions: generate entry points, render PRMs
void uploadRadions ()
 fill 'radionsTexture' from 'bushStarters'
void fillRadionPosArray (void *pData)
 fill *pData (will point to locked 'starterVertexBuffer') from 'bushStarters'

Static Private Member Functions

static void sampleShootingDiffuseDirection (int depth, const Vector &normal, Vector &outDir)
 generates a random direction (cosine distribution) near a normal vector
static void sampleSphereDirection (Vector &outDir)
 generates a random direction an the unit sphere
static void drawFullScreenQuad (LPDIRECT3DDEVICE9 device, float depth=0.0f, float fLeftU=0.0f, float fTopV=0.0f, float fRightU=1.0f, float fBottomV=1.0f)
 render a full-screen quad

Private Attributes

LPDIRECT3DDEVICE9 device
 pointer to main DX device
LPD3DXEFFECT effect
 pointer to main DX effect
LPDIRECT3DSURFACE9 frameColorBuffer
LPDIRECT3DSURFACE9 frameDepthStencilBuffer
LPDIRECT3DTEXTURE9 depthMapTexture
 depth map texture
LPDIRECT3DSURFACE9 depthMapDepthStencilBuffer
 depth map texture's surface
LPDIRECT3DTEXTURE9 fakeTexture
 depth map dummy render texture
LPDIRECT3DSURFACE9 fakeSurface
 depth map dummy render surface
LPDIRECT3DSURFACE9 prmBlendingDepthStencilBuffer
 stencil buffer for rendering a virtual light source to the PRM
LPDIRECT3DVERTEXBUFFER9 starterVertexBuffer
 vertex buffer with entry point positions, for entry point visualization
LPDIRECT3DTEXTURE9 weightsTexture
 render target texture to which current entry point weights are computed
LPDIRECT3DSURFACE9 weightsSurface
 weights texture's surface
LPDIRECT3DTEXTURE9 sysMemWeightsTexture
 weights texture copy in system mem
LPDIRECT3DSURFACE9 sysMemWeightsSurface
 surface of weights texture copy in system mem
LPDIRECT3DTEXTURE9 radionTexture
 texture containing entry point data, input for weight computation
LPDIRECT3DSURFACE9 radionSurface
 entry point texture's surface
KDTreekdtree
 the kd-tree that contains the scene geometry in raytraceable format
PathMapEffect::Method method
 clever enum for supported final rendering methods
std::vector< RenderMesh * > renderMeshes
 vector of loaded meshes
std::vector< LPDIRECT3DTEXTURE9 > materialTextures
 vector of loaded textures (textures specified in mesh's material will be loaded here)
LPDIRECT3DTEXTURE9 emptyTexture
 for materials with no texture we will render with this texture
std::vector< Entity > entities
 vector of virtual world objects
float weights [NCLUSTERS]
 the array of averaged cluster weights
unsigned int clusterLenghts [NCLUSTERS]
 array thet contasins the number of entry points in every cluster (entry points are stored continously [bushStarters, starterVertexBuffer])
float sumSurfaceArea
 summed surface area of all entities
std::vector< RadionbushStarters
 entry points

Static Private Attributes

static Parameters * parameters = NULL
 pointer to global user-adjustable application parameters object

Friends

struct Entity
 struct that represents a virtual world object: a mesh and a model-world transformation matrix

Classes

class  Method
 clever enum for supported final rendering methods More...
struct  RenderMesh
 struct containing all mesh related data. Will be filled from X files in PathMapEffect constructor More...


Detailed Description

Main class for the PRM computation and usage application. This class encapsulates all resources needed for computing PRMs and using them in the final rendering. PRM resources may be generated, saved to files, or restored.


Member Function Documentation

void PathMapEffect::renderFullScreen float  depth = 0.0f  )  [private]
 

renders a full screen quad, invoking the pixel shader for all pixels used for rendering the environment map to the background


Member Data Documentation

LPDIRECT3DSURFACE9 PathMapEffect::frameColorBuffer [private]
 

frame color buffer surface saved before render-to-texture, and restored as the render target for the final rendering to the screen

LPDIRECT3DSURFACE9 PathMapEffect::frameDepthStencilBuffer [private]
 

frame depth buffer surface saved before render-to-texture, and restored as the render target for the final rendering to the screen


The documentation for this class was generated from the following files:
Generated on Thu Apr 27 17:17:42 2006 for Path Map Module by  doxygen 1.4.6-NO