SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLOptixAccelStruct.h
Go to the documentation of this file.
1 /**
2  * \file SLOptixAccelStruct.h
3  * \authors Nic Dorner
4  * \date October 2019
5  * \authors Nic Dorner
6  * \copyright http://opensource.org/licenses/GPL-3.0
7  * \remarks Please use clangformat to format the code. See more code style on
8  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
9 */
10 
11 #ifdef SL_HAS_OPTIX
12 # ifndef SLOPTIXACCELSTRUCT_H
13 # define SLOPTIXACCELSTRUCT_H
14 # include <optix_types.h>
15 # include <SLOptixCudaBuffer.h>
16 
17 //------------------------------------------------------------------------------
18 class SLOptixAccelStruct
19 {
20 public:
21  SLOptixAccelStruct();
22  ~SLOptixAccelStruct();
23 
24  OptixTraversableHandle optixTraversableHandle() { return _handle; }
25 
26 protected:
27  void buildAccelerationStructure();
28  void updateAccelerationStructure();
29 
30  OptixBuildInput _buildInput = {};
31  OptixAccelBuildOptions _accelBuildOptions = {};
32  OptixAccelBufferSizes _accelBufferSizes = {};
33  OptixTraversableHandle _handle = 0; //!< Handle for generated geometry acceleration structure
34  SLOptixCudaBuffer<void>* _buffer;
35 };
36 //------------------------------------------------------------------------------
37 # endif // SLOPTIXACCELSTRUCT_H
38 #endif // SL_HAS_OPTIX