NTrace
GPU ray tracing framework
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
RayGenKernels.hpp
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2009-2011, NVIDIA Corporation
3
* All rights reserved.
4
*
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions are met:
7
* * Redistributions of source code must retain the above copyright
8
* notice, this list of conditions and the following disclaimer.
9
* * Redistributions in binary form must reproduce the above copyright
10
* notice, this list of conditions and the following disclaimer in the
11
* documentation and/or other materials provided with the distribution.
12
* * Neither the name of NVIDIA Corporation nor the
13
* names of its contributors may be used to endorse or promote products
14
* derived from this software without specific prior written permission.
15
*
16
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
20
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
*/
27
28
#pragma once
29
#include "
base/DLLImports.hpp
"
30
#include "
base/Math.hpp
"
31
#include "
Util.hpp
"
32
33
namespace
FW
34
{
35
//------------------------------------------------------------------------
36
37
struct
RayGenPrimaryInput
38
{
39
Vec3f
origin
;
40
Mat4f
nscreenToWorld
;
41
S32
w
;
42
S32
h
;
43
F32
maxDist
;
44
CUdeviceptr
rays
;
// Ray*
45
CUdeviceptr
idToSlot
;
// S32*
46
CUdeviceptr
slotToID
;
// S32*
47
CUdeviceptr
indexToPixel
;
// const S32*
48
};
49
50
//------------------------------------------------------------------------
51
52
struct
RayGenAOInput
53
{
54
S32
firstInputSlot
;
55
S32
numInputRays
;
56
S32
numSamples
;
57
F32
maxDist
;
58
U32
randomSeed
;
59
CUdeviceptr
inRays
;
// const Ray*
60
CUdeviceptr
inResults
;
// const RayResult*
61
CUdeviceptr
outRays
;
// Ray*
62
CUdeviceptr
outIDToSlot
;
// S32*
63
CUdeviceptr
outSlotToID
;
// S32*
64
CUdeviceptr
normals
;
// const Vec3f*
65
};
66
67
//------------------------------------------------------------------------
68
69
struct
RayGenShadowInput
70
{
71
S32
firstInputSlot
;
72
S32
numInputRays
;
73
S32
numSamples
;
74
F32
lightPositionX
;
75
F32
lightPositionY
;
76
F32
lightPositionZ
;
77
F32
lightRadius
;
78
U32
randomSeed
;
79
CUdeviceptr
inRays
;
// const Ray*
80
CUdeviceptr
inResults
;
// const RayResult*
81
CUdeviceptr
outRays
;
// Ray*
82
CUdeviceptr
outIDToSlot
;
// S32*
83
CUdeviceptr
outSlotToID
;
// S32*
84
};
85
86
//------------------------------------------------------------------------
87
88
#if FW_CUDA
89
extern
"C"
90
{
91
92
__constant__ int4 c_RayGenPrimaryInput[(
sizeof
(
RayGenPrimaryInput
) +
sizeof
(int4) - 1) /
sizeof
(int4)];
93
__global__
void
rayGenPrimaryKernel(
void
);
94
95
__constant__
RayGenAOInput
c_RayGenAOInput;
96
__global__
void
rayGenAOKernel(
void
);
97
98
__constant__
RayGenShadowInput
c_RayGenShadowInput;
99
__global__
void
rayGenShadowKernel(
void
);
100
101
}
102
#endif
103
104
//------------------------------------------------------------------------
105
}
FW::RayGenAOInput::numInputRays
S32 numInputRays
Definition:
RayGenKernels.hpp:55
FW::RayGenShadowInput
Definition:
RayGenKernels.hpp:69
FW::RayGenPrimaryInput::origin
Vec3f origin
Definition:
RayGenKernels.hpp:39
FW::RayGenPrimaryInput
Definition:
RayGenKernels.hpp:37
FW::RayGenShadowInput::outRays
CUdeviceptr outRays
Definition:
RayGenKernels.hpp:81
FW::RayGenPrimaryInput::rays
CUdeviceptr rays
Definition:
RayGenKernels.hpp:44
FW::RayGenShadowInput::outIDToSlot
CUdeviceptr outIDToSlot
Definition:
RayGenKernels.hpp:82
FW::RayGenShadowInput::numSamples
S32 numSamples
Definition:
RayGenKernels.hpp:73
FW::RayGenAOInput::maxDist
F32 maxDist
Definition:
RayGenKernels.hpp:57
FW::RayGenShadowInput::lightPositionX
F32 lightPositionX
Definition:
RayGenKernels.hpp:74
FW::RayGenShadowInput::inResults
CUdeviceptr inResults
Definition:
RayGenKernels.hpp:80
FW::RayGenPrimaryInput::indexToPixel
CUdeviceptr indexToPixel
Definition:
RayGenKernels.hpp:47
FW::RayGenPrimaryInput::idToSlot
CUdeviceptr idToSlot
Definition:
RayGenKernels.hpp:45
FW::RayGenAOInput::inResults
CUdeviceptr inResults
Definition:
RayGenKernels.hpp:60
FW::RayGenShadowInput::inRays
CUdeviceptr inRays
Definition:
RayGenKernels.hpp:79
FW::RayGenPrimaryInput::nscreenToWorld
Mat4f nscreenToWorld
Definition:
RayGenKernels.hpp:40
FW::RayGenShadowInput::firstInputSlot
S32 firstInputSlot
Definition:
RayGenKernels.hpp:71
FW::F32
float F32
Definition:
Defs.hpp:89
FW::RayGenAOInput::firstInputSlot
S32 firstInputSlot
Definition:
RayGenKernels.hpp:54
FW::RayGenAOInput::outRays
CUdeviceptr outRays
Definition:
RayGenKernels.hpp:61
FW::RayGenAOInput::inRays
CUdeviceptr inRays
Definition:
RayGenKernels.hpp:59
FW::RayGenPrimaryInput::h
S32 h
Definition:
RayGenKernels.hpp:42
FW::S32
signed int S32
Definition:
Defs.hpp:88
FW::RayGenAOInput::numSamples
S32 numSamples
Definition:
RayGenKernels.hpp:56
FW::RayGenAOInput::randomSeed
U32 randomSeed
Definition:
RayGenKernels.hpp:58
FW::Mat4f
Definition:
Math.hpp:676
Math.hpp
FW::U32
unsigned int U32
Definition:
Defs.hpp:85
FW::RayGenPrimaryInput::slotToID
CUdeviceptr slotToID
Definition:
RayGenKernels.hpp:46
FW::RayGenAOInput
Definition:
RayGenKernels.hpp:52
FW::Vec3f
Definition:
Math.hpp:324
FW::RayGenShadowInput::lightPositionZ
F32 lightPositionZ
Definition:
RayGenKernels.hpp:76
Util.hpp
DLLImports.hpp
FW::RayGenPrimaryInput::maxDist
F32 maxDist
Definition:
RayGenKernels.hpp:43
FW::RayGenAOInput::outSlotToID
CUdeviceptr outSlotToID
Definition:
RayGenKernels.hpp:63
FW::RayGenShadowInput::randomSeed
U32 randomSeed
Definition:
RayGenKernels.hpp:78
FW::RayGenShadowInput::lightRadius
F32 lightRadius
Definition:
RayGenKernels.hpp:77
FW::RayGenShadowInput::numInputRays
S32 numInputRays
Definition:
RayGenKernels.hpp:72
FW::RayGenShadowInput::outSlotToID
CUdeviceptr outSlotToID
Definition:
RayGenKernels.hpp:83
FW::RayGenAOInput::normals
CUdeviceptr normals
Definition:
RayGenKernels.hpp:64
FW::RayGenAOInput::outIDToSlot
CUdeviceptr outIDToSlot
Definition:
RayGenKernels.hpp:62
FW::RayGenShadowInput::lightPositionY
F32 lightPositionY
Definition:
RayGenKernels.hpp:75
FW::RayGenPrimaryInput::w
S32 w
Definition:
RayGenKernels.hpp:41
src
rt
ray
RayGenKernels.hpp
Generated on Wed Dec 10 2014 14:36:54 for NTrace by
1.8.6