#include <Wrapper.h>
Inherited by CudaRenderBvh, CudaRenderGrid, and CudaRenderKd.
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. |
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.
virtual float CudaRenderer::render | ( | Camera & | camera, | |
SceneLights & | lights, | |||
RenderMode | mode | |||
) | [pure virtual] |
Raycast the image.
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.
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.
newPbo | New OpenGL PBO to used as buffer, -1 for render to memory |