-
Notifications
You must be signed in to change notification settings - Fork 102
/
GLSL_NV_ray_tracing_motion_blur.txt
144 lines (92 loc) · 4.37 KB
/
GLSL_NV_ray_tracing_motion_blur.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
Name
NV_ray_tracing_motion_blur
Name Strings
GL_NV_ray_tracing_motion_blur
Contact
Eric Werness (ewerness 'at' nvidia.com), NVIDIA
Ashwin Lele (alele 'at' nvidia.com), NVIDIA
Contributors
Daniel Koch, NVIDIA
Status
Complete
Version
Last Modified Date: 2023-04-06
Revision: 2
Dependencies
This extension can be applied to OpenGL GLSL versions 4.60
(#version 460) and higher.
This extension is written against revision 5 of the OpenGL Shading Language
version 4.60, dated September 4, 2017.
This extension requires GLSL_EXT_ray_tracing and interacts with
GLSL_NV_ray_tracing.
Overview
This extension extends the GLSL support added for ray tracing in
GLSL_EXT_ray_tracing extension to expose a new overloaded variant of built-in
function call for recursive ray traversal 'traceRayMotionNV' and a new built-in
variable 'gl_CurrentRayTimeNV' which can be used to calculate shading
based on ray geometry intersection at a particular point in time.
Mapping to SPIR-V
-----------------
For informational purposes (non-normative), the following is an
expected way for an implementation to map GLSL constructs to SPIR-V
constructs:
gl_CurrentRayTimeNV -> CurrentRayTimeNV decorated OpVariable
traceRayMotionNV -> OpTraceRayMotionNV instruction
Modifications to the OpenGL Shading Language Specification, Version 4.60
Including the following line in a shader can be used to control the
language features described in this extension:
#extension GL_NV_ray_tracing_motion_blur : <behavior>
where <behavior> is as specified in section 3.3.
New preprocessor #defines are added:
#define GL_NV_ray_tracing_motion_blur 1
Additions to Chapter 7 of the OpenGL Shading Language Specification
(Built-in Variables)
Modify Section 7.1, Built-in Languages Variables
(Add to the list of builtin variables)
In the intersection, any-hit, closest-hit and miss shading languages,
following additional built-in variables are declared as follows
in float gl_CurrentRayTimeNV;
Add the following description for gl_CurrentRayTimeNV:
The input variable gl_CurrentRayTimeNV is available in the intersection,
any-hit, closest-hit and miss languages and provides the time parameter
as passed to the parent 'traceRayMotionNV' call. Result is undefined if
parent call was 'traceNV' or 'traceRayEXT'.
Additions to Chapter 8 of the OpenGL Shading Language Specification
(Built-in Functions)
(Modify Section 8.19, Ray Tracing Functions)
(Add following built-in)
Syntax:
void traceRayMotionNV(accelerationStructureEXT topLevel,
uint rayFlags,
uint cullMask,
uint sbtRecordOffset,
uint sbtRecordStride,
uint missIndex,
vec3 origin,
float Tmin,
vec3 direction,
float Tmax,
float currentTime,
int payload);
This function is only available in the ray generation, closest hit, and
miss shaders.
'traceRayMotionNV' operates the same as 'traceRayEXT', with the exception of
<currentTime> parameter.
The <currentTime> parameter is an additional parameter provided to
traversal call when compared with 'traceRayEXT'. It can be queried in
downstream stages to implement time-dependent behavior (like geometry transformations)
and is used to intersect with motion geometry at the corresponding time.
Interactions with GLSL_NV_ray_tracing
'accelerationStructureNV' and 'accelerationStructureEXT' are aliases and
use same SPIR-V opcodes so they can be used interchangeably for 'traceRayMotionNV'
'rayPayloadNV' and 'rayPayloadEXT' storage classes are aliases and so are
'rayPayloadInNV' and 'rayPayloadInEXT' so variables decorated with location with
these storage classes can be used interchangeably as compile-time constant
argument for the 'payload' parameter for 'traceRayMotionNV'.
Issues
TBD
Revision History
Rev. Date Author Changes
---- ----------- ------ -------------------------------------------
2 2023-04-06 ewerness Fix misnamed builtin in overview
1 2021-07-01 alele Internal revisions.