CudaRenderer Class Reference

Parent class for all other CUDA wrappers used to launch the raytracing. More...

#include <Wrapper.h>

Inherited by CudaRenderBvh, CudaRenderGrid, and CudaRenderKd.

List of all members.

Public Member Functions

 CudaRenderer (unsigned width, unsigned height, int pbo)
void resize (unsigned newWidth, unsigned newHeight)
 Set new size of the rendered image.
void setRenderTarget (unsigned newPbo=-1)
 Sets new render target.
unsigned int * getBuffer ()
 Return the pointer to host memory copy of the buffer.
virtual float render (Camera &camera, SceneLights &lights, RenderMode mode)=0
 Raycast the image.
float getRenderDistance ()

Protected Attributes

float3 minimum
 Minimum extent of the structure bounding box.
float3 maximum
 Maximum extent of the structure bounding box.
RenderTarget renderTarget
 The current rendergin target.
unsigned width
 Width of rendered image.
unsigned height
 Height of rendered image.
int pbo
 OpenGL buffer used to store renderer image when view on screen.
unsigned int * buffer
 Frame buffer for raytraced image in video card memory.
unsigned int * copy
 Host memory used as a copy of video card frame buffer.


Detailed Description

Parent class for all other CUDA wrappers used to launch the raytracing.

Wrapper class around cuda function call. It's purpose is to make the high level passing of acceleration structure to cuda function easier. The wrapper is supposed to be imutable in respect to the acceleration structure. Therefore the acceleration structure is assigned during object construction, wrapper takes ownership of the structure and it is deleted during wrapper destruction.


Member Function Documentation

virtual float CudaRenderer::render ( Camera camera,
SceneLights &  lights,
RenderMode  mode 
) [pure virtual]

Raycast the image.

Parameters:
camera The camera used to render the image.
lights The light in the scene.
mode The render mode(primary rays only,primary+shadow,primary+shadow+reflect).

Implemented in CudaRenderGrid.

void CudaRenderer::resize ( unsigned  newWidth,
unsigned  newHeight 
)

Set new size of the rendered image.

Parameters:
newWidth New width of the image.
newHeight New height of the image.

void CudaRenderer::setRenderTarget ( unsigned  newPbo = -1  ) 

Sets new render target.

Change the PBO used as buffer or switch to rendering to memory.

Parameters:
newPbo New OpenGL PBO to used as buffer, -1 for render to memory


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

Generated on Fri Jan 23 00:21:49 2009 for Raytracer by  doxygen 1.5.7.1