NTrace
GPU ray tracing framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FW::Renderer Class Reference

#include <Renderer.hpp>

Inherited by FW::CPURenderer, and FW::CudaRenderer.

Classes

struct  Params
 

Public Types

enum  AccelStructType { tBVH = 0, tKDTree }
 
enum  RayType {
  RayType_Primary = 0, RayType_AO, RayType_Diffuse, RayType_Textured,
  RayType_PathTracing, RayType_Max
}
 

Public Member Functions

 Renderer (AccelStructType as, Environment *env)
 
 ~Renderer (void)
 
void setMesh (MeshBase *mesh)
 
void setBuildParams (const BVH::BuildParams &params)
 
void invalidateBVH (void)
 
void setParams (const Params &params)
 
void setMessageWindow (Window *window)
 
void setEnableRandom (bool enable)
 
CudaVirtualTracer & getCudaTracer (void)
 
Scene * getScene (void) const
 
CudaAS * getCudaBVH (void)
 
F32 renderFrame (GLContext *gl, const CameraControls &camera)
 
void beginFrame (GLContext *gl, const CameraControls &camera)
 
bool nextBatch (void)
 
F32 traceBatch (void)
 
void updateResult (void)
 
void displayResult (GLContext *gl)
 
int getTotalNumRays (void)
 
F32 calcNodeSAHCostKdtree (const Platform &platform, Buffer *nodes, Buffer *tri, S32 n, AABB bbox, S32 depth, S32 &maxDepth, S32 &sumDepth, S32 &numNodes, S32 &numLeaves, F32 &nodeArea, F32 &weightedLeafArea, F32 &test)
 
F32 calcLeafSAHCostCompact (const Platform &platform, Buffer *triIdx, S32 n, S32 &numLeaves)
 
F32 calcLeafSAHCostNum (const Platform &platform, S32 n, S32 &numLeaves)
 
CudaAS * getCudaKDTree (void)
 
void startBVHVis (void)
 
void endBVHVis (void)
 
void toggleBVHVis (void)
 

Protected Member Functions

 Renderer (const Renderer &)
 
Renderer & operator= (const Renderer &)
 

Protected Attributes

CudaCompiler m_compiler
 
String m_bvhCachePath
 
Platform m_platform
 
BVH::BuildParams m_buildParams
 
RayGen m_raygen
 
Random m_random
 
Params m_params
 
Window * m_window
 
bool m_enableRandom
 
MeshBase * m_mesh
 
Scene * m_scene
 
Image * m_image
 
F32 m_cameraFar
 
RayBuffer m_primaryRays
 
RayBuffer m_secondaryRays
 
bool m_newBatch
 
RayBuffer * m_batchRays
 
S32 m_batchStart
 
CudaAS * m_accelStruct
 
CudaVirtualTracer * m_cudaTracer
 
AccelStructType m_asType
 
Visualization * m_vis
 
bool m_showVis
 

Detailed Description

Definition at line 43 of file Renderer.hpp.

Member Enumeration Documentation

Enumerator
tBVH 
tKDTree 

Definition at line 46 of file Renderer.hpp.

Enumerator
RayType_Primary 
RayType_AO 
RayType_Diffuse 
RayType_Textured 
RayType_PathTracing 
RayType_Max 

Definition at line 52 of file Renderer.hpp.

Constructor & Destructor Documentation

Renderer::Renderer ( AccelStructType  as,
Environment *  env 
)

Definition at line 11 of file Renderer.cpp.

Renderer::~Renderer ( void  )

Definition at line 57 of file Renderer.cpp.

FW::Renderer::Renderer ( const Renderer &  )
protected

Member Function Documentation

void Renderer::beginFrame ( GLContext *  gl,
const CameraControls &  camera 
)

Definition at line 267 of file Renderer.cpp.

F32 Renderer::calcLeafSAHCostCompact ( const Platform &  platform,
Buffer *  triIdx,
S32  n,
S32 &  numLeaves 
)

Definition at line 528 of file Renderer.cpp.

F32 Renderer::calcLeafSAHCostNum ( const Platform &  platform,
S32  n,
S32 &  numLeaves 
)

Definition at line 543 of file Renderer.cpp.

F32 Renderer::calcNodeSAHCostKdtree ( const Platform &  platform,
Buffer *  nodes,
Buffer *  tri,
S32  n,
AABB  bbox,
S32  depth,
S32 &  maxDepth,
S32 &  sumDepth,
S32 &  numNodes,
S32 &  numLeaves,
F32 &  nodeArea,
F32 &  weightedLeafArea,
F32 &  test 
)

Definition at line 463 of file Renderer.cpp.

void Renderer::displayResult ( GLContext *  gl)

Definition at line 416 of file Renderer.cpp.

void Renderer::endBVHVis ( void  )

Definition at line 590 of file Renderer.cpp.

CudaAS * Renderer::getCudaBVH ( void  )

Definition at line 103 of file Renderer.cpp.

CudaAS * Renderer::getCudaKDTree ( void  )

Definition at line 190 of file Renderer.cpp.

CudaVirtualTracer& FW::Renderer::getCudaTracer ( void  )
inline

Definition at line 96 of file Renderer.hpp.

Scene* FW::Renderer::getScene ( void  ) const
inline

Definition at line 97 of file Renderer.hpp.

int Renderer::getTotalNumRays ( void  )

Definition at line 429 of file Renderer.cpp.

void FW::Renderer::invalidateBVH ( void  )
inline

Definition at line 90 of file Renderer.hpp.

bool Renderer::nextBatch ( void  )

Definition at line 313 of file Renderer.cpp.

Renderer& FW::Renderer::operator= ( const Renderer &  )
protected
F32 Renderer::renderFrame ( GLContext *  gl,
const CameraControls &  camera 
)

Definition at line 248 of file Renderer.cpp.

void FW::Renderer::setBuildParams ( const BVH::BuildParams &  params)
inline

Definition at line 89 of file Renderer.hpp.

void FW::Renderer::setEnableRandom ( bool  enable)
inline

Definition at line 94 of file Renderer.hpp.

void Renderer::setMesh ( MeshBase *  mesh)

Definition at line 68 of file Renderer.cpp.

void FW::Renderer::setMessageWindow ( Window *  window)
inline

Definition at line 93 of file Renderer.hpp.

void Renderer::setParams ( const Params &  params)

Definition at line 94 of file Renderer.cpp.

void Renderer::startBVHVis ( void  )

Definition at line 551 of file Renderer.cpp.

void FW::Renderer::toggleBVHVis ( void  )
inline

Definition at line 118 of file Renderer.hpp.

F32 Renderer::traceBatch ( void  )

Definition at line 364 of file Renderer.cpp.

void Renderer::updateResult ( void  )

Definition at line 373 of file Renderer.cpp.

Member Data Documentation

CudaAS* FW::Renderer::m_accelStruct
protected

Definition at line 148 of file Renderer.hpp.

AccelStructType FW::Renderer::m_asType
protected

Definition at line 151 of file Renderer.hpp.

RayBuffer* FW::Renderer::m_batchRays
protected

Definition at line 145 of file Renderer.hpp.

S32 FW::Renderer::m_batchStart
protected

Definition at line 146 of file Renderer.hpp.

BVH::BuildParams FW::Renderer::m_buildParams
protected

Definition at line 128 of file Renderer.hpp.

String FW::Renderer::m_bvhCachePath
protected

Definition at line 126 of file Renderer.hpp.

F32 FW::Renderer::m_cameraFar
protected

Definition at line 140 of file Renderer.hpp.

CudaCompiler FW::Renderer::m_compiler
protected

Definition at line 125 of file Renderer.hpp.

CudaVirtualTracer* FW::Renderer::m_cudaTracer
protected

Definition at line 149 of file Renderer.hpp.

bool FW::Renderer::m_enableRandom
protected

Definition at line 134 of file Renderer.hpp.

Image* FW::Renderer::m_image
protected

Definition at line 139 of file Renderer.hpp.

MeshBase* FW::Renderer::m_mesh
protected

Definition at line 136 of file Renderer.hpp.

bool FW::Renderer::m_newBatch
protected

Definition at line 144 of file Renderer.hpp.

Params FW::Renderer::m_params
protected

Definition at line 132 of file Renderer.hpp.

Platform FW::Renderer::m_platform
protected

Definition at line 127 of file Renderer.hpp.

RayBuffer FW::Renderer::m_primaryRays
protected

Definition at line 141 of file Renderer.hpp.

Random FW::Renderer::m_random
protected

Definition at line 130 of file Renderer.hpp.

RayGen FW::Renderer::m_raygen
protected

Definition at line 129 of file Renderer.hpp.

Scene* FW::Renderer::m_scene
protected

Definition at line 137 of file Renderer.hpp.

RayBuffer FW::Renderer::m_secondaryRays
protected

Definition at line 142 of file Renderer.hpp.

bool FW::Renderer::m_showVis
protected

Definition at line 153 of file Renderer.hpp.

Visualization* FW::Renderer::m_vis
protected

Definition at line 152 of file Renderer.hpp.

Window* FW::Renderer::m_window
protected

Definition at line 133 of file Renderer.hpp.


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