NTrace
GPU ray tracing framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
CPURenderer.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2009-2010 NVIDIA Corporation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 #include "Renderer.hpp"
19 
20 namespace FW
21 {
22 //------------------------------------------------------------------------
23 
24 class CPURenderer : public Renderer
25 {
26 public:
27  CPURenderer (Environment* env);
28  virtual ~CPURenderer (void);
29 
30 
31  virtual void setParams (const Params& params);
32  virtual void setMessageWindow (Window* window) { m_window = window; }
33  virtual BVHLayout getLayout (void) { return m_layout; }
34 
35  virtual bool nextBatch (void);
36  virtual F32 traceBatch (RayStats* stats = NULL); // returns launch time
37  virtual void updateResult (void); // for current batch
38 
39  virtual int getTotalNumRays (void); // for selected ray type, excluding degenerates
40 
41  Vec4f getPseudoColor(F32 value, F32 minVal, F32 maxVal);
42  Vec4f getDistanceColor(F32 value, F32 minVal, F32 maxVal);
43 
44 private:
45  CPURenderer (const CPURenderer&); // forbidden
46  CPURenderer& operator= (const CPURenderer&); // forbidden
47 
48 private:
49  BVHLayout m_layout;
50  Buffer m_visibility;
51 
52 /*public:
53  CPURenderer (void);
54  virtual ~CPURenderer (void);
55 
56  virtual BVHLayout getLayout (void) { return m_layout; }
57  void setLayout (BVHLayout layout) { m_layout = layout; }
58 
59  virtual bool nextBatch (void);
60  virtual F32 traceBatch (RayStats* stats = NULL); // returns launch time
61  virtual void updateResult (void); // for current batch
62 
63  virtual S32 incrementNumRays (void); // for selected ray type, excluding degenerates
64 
65 protected:
66  virtual Buffer& getVisibleTriangles (S32 triangleCount, bool setValue, S32 initValue = 0); // gets the bit array of triangle visibility. If sizes do not match it is initialized
67 
68 private:
69  CPURenderer (const CPURenderer&); // forbidden
70  CPURenderer& operator= (const CPURenderer&); // forbidden
71 
72  Vec4f getPseudoColor (F32 value, F32 minVal, F32 maxVal);
73  Vec4f getDistanceColor (F32 value, F32 minVal, F32 maxVal);
74 
75 private:
76  BVHLayout m_layout;
77  Buffer m_visibility;*/
78 };
79 
80 //------------------------------------------------------------------------
81 }
#define NULL
Definition: Defs.hpp:39
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value CUfunction int CUtexref hTexRef CUfunction int int grid_height CUevent unsigned int Flags CUevent hEvent CUevent hEvent CUstream unsigned int Flags CUstream hStream GLuint bufferobj unsigned int CUdevice dev CUdeviceptr unsigned int CUmodule const char name CUdeviceptr unsigned int bytesize CUdeviceptr dptr void unsigned int bytesize void CUdeviceptr unsigned int ByteCount CUarray unsigned int CUdeviceptr unsigned int ByteCount CUarray unsigned int const void unsigned int ByteCount CUarray unsigned int CUarray unsigned int unsigned int ByteCount void CUarray unsigned int unsigned int CUstream hStream const CUDA_MEMCPY2D pCopy CUdeviceptr const void unsigned int CUstream hStream const CUDA_MEMCPY2D CUstream hStream CUdeviceptr unsigned char unsigned int N CUdeviceptr unsigned int unsigned int N CUdeviceptr unsigned int unsigned short unsigned int unsigned int Height CUarray const CUDA_ARRAY_DESCRIPTOR pAllocateArray CUarray const CUDA_ARRAY3D_DESCRIPTOR pAllocateArray unsigned int CUtexref CUdeviceptr unsigned int bytes CUcontext unsigned int CUdevice device GLenum texture GLenum GLuint buffer GLenum GLuint renderbuffer GLenum GLsizeiptr const GLvoid GLenum usage GLuint shader GLenum type GLsizei const GLuint framebuffers GLsizei const GLuint renderbuffers GLuint v GLuint v GLenum GLenum GLenum GLuint GLint level GLsizei GLuint framebuffers GLuint const GLchar name GLenum GLintptr GLsizeiptr GLvoid data GLuint GLenum GLint param GLuint GLenum GLint param GLhandleARB programObj GLenum GLenum GLsizei GLsizei height GLenum GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid pixels GLint GLsizei const GLfloat value GLint GLfloat GLfloat v1 GLint GLfloat GLfloat GLfloat v2 GLint GLsizei const GLfloat value GLint GLsizei GLboolean const GLfloat value GLuint program GLuint GLfloat GLfloat GLfloat z GLuint GLint GLenum GLboolean GLsizei const GLvoid pointer GLuint GLuint const GLchar name GLenum GLsizei GLenum GLsizei GLsizei height GLenum GLuint renderbuffer GLenum GLenum GLint * params
Definition: DLLImports.inl:373
virtual bool nextBatch(void)
Definition: CPURenderer.cpp:46
F32 traceBatch(void)
Definition: Renderer.cpp:364
CPURenderer(Environment *env)
Definition: CPURenderer.cpp:23
virtual int getTotalNumRays(void)
Structure holding ray statistics. Also provides print to the console. These statistics are used in a ...
Definition: BVH.hpp:45
virtual BVHLayout getLayout(void)
Definition: CPURenderer.hpp:33
float F32
Definition: Defs.hpp:89
Vec4f getPseudoColor(F32 value, F32 minVal, F32 maxVal)
virtual void updateResult(void)
virtual void setParams(const Params &params)
Definition: CPURenderer.cpp:39
CUdevice int ordinal char int CUdevice dev CUdevprop CUdevice dev CUcontext ctx CUcontext ctx CUcontext pctx CUmodule const void image CUmodule const void fatCubin CUfunction CUmodule const char name void p CUfunction unsigned int bytes CUtexref pTexRef CUtexref CUarray unsigned int Flags CUtexref int CUaddress_mode am CUtexref unsigned int Flags CUaddress_mode CUtexref int dim CUarray_format int CUtexref hTexRef CUfunction unsigned int numbytes CUfunction int float value
Definition: DLLImports.inl:84
virtual ~CPURenderer(void)
Definition: CPURenderer.cpp:33
virtual void setMessageWindow(Window *window)
Definition: CPURenderer.hpp:32
Vec4f getDistanceColor(F32 value, F32 minVal, F32 maxVal)
Window * m_window
Definition: Renderer.hpp:133