NVIDIA OptiX 7.7 nvidia_logo_transpbg.gif Up
optix_device.h
Go to the documentation of this file.
1/*
2* Copyright (c) 2021 NVIDIA Corporation. All rights reserved.
3*
4* NVIDIA Corporation and its licensors retain all intellectual property and proprietary
5* rights in and to this software, related documentation and any modifications thereto.
6* Any use, reproduction, disclosure or distribution of this software and related
7* documentation without an express license agreement from NVIDIA Corporation is strictly
8* prohibited.
9*
10* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
11* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
12* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
13* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
14* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
15* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
16* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
17* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
18* SUCH DAMAGES
19*/
20
26
27#ifndef OPTIX_OPTIX_DEVICE_H
28#define OPTIX_OPTIX_DEVICE_H
29
30#if defined( __cplusplus ) && ( __cplusplus < 201103L ) && !defined( _WIN32 )
31#error Device code for OptiX requires at least C++11. Consider adding "--std c++11" to the nvcc command-line.
32#endif
33
34#include "optix_types.h"
35
38
58template <typename... Payload>
59static __forceinline__ __device__ void optixTrace( OptixTraversableHandle handle,
60 float3 rayOrigin,
61 float3 rayDirection,
62 float tmin,
63 float tmax,
64 float rayTime,
65 OptixVisibilityMask visibilityMask,
66 unsigned int rayFlags,
67 unsigned int SBToffset,
68 unsigned int SBTstride,
69 unsigned int missSBTIndex,
70 Payload&... payload );
71
72
88template <typename... Payload>
89static __forceinline__ __device__ void optixTrace( OptixPayloadTypeID type,
91 float3 rayOrigin,
92 float3 rayDirection,
93 float tmin,
94 float tmax,
95 float rayTime,
96 OptixVisibilityMask visibilityMask,
97 unsigned int rayFlags,
98 unsigned int SBToffset,
99 unsigned int SBTstride,
100 unsigned int missSBTIndex,
101 Payload&... payload );
102
103
105static __forceinline__ __device__ void optixSetPayload_0( unsigned int p );
107static __forceinline__ __device__ void optixSetPayload_1( unsigned int p );
109static __forceinline__ __device__ void optixSetPayload_2( unsigned int p );
111static __forceinline__ __device__ void optixSetPayload_3( unsigned int p );
113static __forceinline__ __device__ void optixSetPayload_4( unsigned int p );
115static __forceinline__ __device__ void optixSetPayload_5( unsigned int p );
117static __forceinline__ __device__ void optixSetPayload_6( unsigned int p );
119static __forceinline__ __device__ void optixSetPayload_7( unsigned int p );
120
122static __forceinline__ __device__ void optixSetPayload_8( unsigned int p );
124static __forceinline__ __device__ void optixSetPayload_9( unsigned int p );
126static __forceinline__ __device__ void optixSetPayload_10( unsigned int p );
128static __forceinline__ __device__ void optixSetPayload_11( unsigned int p );
130static __forceinline__ __device__ void optixSetPayload_12( unsigned int p );
132static __forceinline__ __device__ void optixSetPayload_13( unsigned int p );
134static __forceinline__ __device__ void optixSetPayload_14( unsigned int p );
136static __forceinline__ __device__ void optixSetPayload_15( unsigned int p );
138static __forceinline__ __device__ void optixSetPayload_16( unsigned int p );
140static __forceinline__ __device__ void optixSetPayload_17( unsigned int p );
142static __forceinline__ __device__ void optixSetPayload_18( unsigned int p );
144static __forceinline__ __device__ void optixSetPayload_19( unsigned int p );
146static __forceinline__ __device__ void optixSetPayload_20( unsigned int p );
148static __forceinline__ __device__ void optixSetPayload_21( unsigned int p );
150static __forceinline__ __device__ void optixSetPayload_22( unsigned int p );
152static __forceinline__ __device__ void optixSetPayload_23( unsigned int p );
154static __forceinline__ __device__ void optixSetPayload_24( unsigned int p );
156static __forceinline__ __device__ void optixSetPayload_25( unsigned int p );
158static __forceinline__ __device__ void optixSetPayload_26( unsigned int p );
160static __forceinline__ __device__ void optixSetPayload_27( unsigned int p );
162static __forceinline__ __device__ void optixSetPayload_28( unsigned int p );
164static __forceinline__ __device__ void optixSetPayload_29( unsigned int p );
166static __forceinline__ __device__ void optixSetPayload_30( unsigned int p );
168static __forceinline__ __device__ void optixSetPayload_31( unsigned int p );
169
171static __forceinline__ __device__ unsigned int optixGetPayload_0();
173static __forceinline__ __device__ unsigned int optixGetPayload_1();
175static __forceinline__ __device__ unsigned int optixGetPayload_2();
177static __forceinline__ __device__ unsigned int optixGetPayload_3();
179static __forceinline__ __device__ unsigned int optixGetPayload_4();
181static __forceinline__ __device__ unsigned int optixGetPayload_5();
183static __forceinline__ __device__ unsigned int optixGetPayload_6();
185static __forceinline__ __device__ unsigned int optixGetPayload_7();
186
188static __forceinline__ __device__ unsigned int optixGetPayload_8();
190static __forceinline__ __device__ unsigned int optixGetPayload_9();
192static __forceinline__ __device__ unsigned int optixGetPayload_10();
194static __forceinline__ __device__ unsigned int optixGetPayload_11();
196static __forceinline__ __device__ unsigned int optixGetPayload_12();
198static __forceinline__ __device__ unsigned int optixGetPayload_13();
200static __forceinline__ __device__ unsigned int optixGetPayload_14();
202static __forceinline__ __device__ unsigned int optixGetPayload_15();
204static __forceinline__ __device__ unsigned int optixGetPayload_16();
206static __forceinline__ __device__ unsigned int optixGetPayload_17();
208static __forceinline__ __device__ unsigned int optixGetPayload_18();
210static __forceinline__ __device__ unsigned int optixGetPayload_19();
212static __forceinline__ __device__ unsigned int optixGetPayload_20();
214static __forceinline__ __device__ unsigned int optixGetPayload_21();
216static __forceinline__ __device__ unsigned int optixGetPayload_22();
218static __forceinline__ __device__ unsigned int optixGetPayload_23();
220static __forceinline__ __device__ unsigned int optixGetPayload_24();
222static __forceinline__ __device__ unsigned int optixGetPayload_25();
224static __forceinline__ __device__ unsigned int optixGetPayload_26();
226static __forceinline__ __device__ unsigned int optixGetPayload_27();
228static __forceinline__ __device__ unsigned int optixGetPayload_28();
230static __forceinline__ __device__ unsigned int optixGetPayload_29();
232static __forceinline__ __device__ unsigned int optixGetPayload_30();
234static __forceinline__ __device__ unsigned int optixGetPayload_31();
235
242static __forceinline__ __device__ void optixSetPayloadTypes( unsigned int typeMask );
243
245static __forceinline__ __device__ unsigned int optixUndefinedValue();
246
252static __forceinline__ __device__ float3 optixGetWorldRayOrigin();
253
259static __forceinline__ __device__ float3 optixGetWorldRayDirection();
260
264static __forceinline__ __device__ float3 optixGetObjectRayOrigin();
265
269static __forceinline__ __device__ float3 optixGetObjectRayDirection();
270
274static __forceinline__ __device__ float optixGetRayTmin();
275
280static __forceinline__ __device__ float optixGetRayTmax();
281
286static __forceinline__ __device__ float optixGetRayTime();
287
291static __forceinline__ __device__ unsigned int optixGetRayFlags();
292
296static __forceinline__ __device__ unsigned int optixGetRayVisibilityMask();
297
301static __forceinline__ __device__ OptixTraversableHandle optixGetInstanceTraversableFromIAS( OptixTraversableHandle ias, unsigned int instIdx );
302
309static __forceinline__ __device__ void optixGetTriangleVertexData( OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float3 data[3]);
310
313static __forceinline__ __device__ void optixGetMicroTriangleVertexData( float3 data[3] );
315static __forceinline__ __device__ void optixGetMicroTriangleBarycentricsData( float2 data[3] );
316
324static __forceinline__ __device__ void optixGetLinearCurveVertexData( OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float4 data[2] );
325
333static __forceinline__ __device__ void optixGetQuadraticBSplineVertexData( OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float4 data[3] );
334
342static __forceinline__ __device__ void optixGetCubicBSplineVertexData( OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float4 data[4] );
343
351static __forceinline__ __device__ void optixGetCatmullRomVertexData( OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float4 data[4] );
352
360static __forceinline__ __device__ void optixGetCubicBezierVertexData( OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float4 data[4] );
361
369static __forceinline__ __device__ void optixGetRibbonVertexData( OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float4 data[3] );
370
372static __forceinline__ __device__ float3 optixGetRibbonNormal( OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float2 ribbonParameters );
373
380static __forceinline__ __device__ void optixGetSphereData( OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float4 data[1] );
381
384static __forceinline__ __device__ OptixTraversableHandle optixGetGASTraversableHandle();
385
387static __forceinline__ __device__ float optixGetGASMotionTimeBegin( OptixTraversableHandle gas );
388
390static __forceinline__ __device__ float optixGetGASMotionTimeEnd( OptixTraversableHandle gas );
391
393static __forceinline__ __device__ unsigned int optixGetGASMotionStepCount( OptixTraversableHandle gas );
394
398static __forceinline__ __device__ void optixGetWorldToObjectTransformMatrix( float m[12] );
399
403static __forceinline__ __device__ void optixGetObjectToWorldTransformMatrix( float m[12] );
404
409static __forceinline__ __device__ float3 optixTransformPointFromWorldToObjectSpace( float3 point );
410
415static __forceinline__ __device__ float3 optixTransformVectorFromWorldToObjectSpace( float3 vec );
416
421static __forceinline__ __device__ float3 optixTransformNormalFromWorldToObjectSpace( float3 normal );
422
427static __forceinline__ __device__ float3 optixTransformPointFromObjectToWorldSpace( float3 point );
428
433static __forceinline__ __device__ float3 optixTransformVectorFromObjectToWorldSpace( float3 vec );
434
439static __forceinline__ __device__ float3 optixTransformNormalFromObjectToWorldSpace( float3 normal );
440
444static __forceinline__ __device__ unsigned int optixGetTransformListSize();
445
449static __forceinline__ __device__ OptixTraversableHandle optixGetTransformListHandle( unsigned int index );
450
451
454
458static __forceinline__ __device__ const OptixStaticTransform* optixGetStaticTransformFromHandle( OptixTraversableHandle handle );
459
464
469
473static __forceinline__ __device__ unsigned int optixGetInstanceIdFromHandle( OptixTraversableHandle handle );
474
479
483static __forceinline__ __device__ const float4* optixGetInstanceTransformFromHandle( OptixTraversableHandle handle );
484
488static __forceinline__ __device__ const float4* optixGetInstanceInverseTransformFromHandle( OptixTraversableHandle handle );
489
506static __forceinline__ __device__ bool optixReportIntersection( float hitT, unsigned int hitKind );
507
511static __forceinline__ __device__ bool optixReportIntersection( float hitT, unsigned int hitKind, unsigned int a0 );
512
516static __forceinline__ __device__ bool optixReportIntersection( float hitT, unsigned int hitKind, unsigned int a0, unsigned int a1 );
517
521static __forceinline__ __device__ bool optixReportIntersection( float hitT, unsigned int hitKind, unsigned int a0, unsigned int a1, unsigned int a2 );
522
526static __forceinline__ __device__ bool optixReportIntersection( float hitT,
527 unsigned int hitKind,
528 unsigned int a0,
529 unsigned int a1,
530 unsigned int a2,
531 unsigned int a3 );
532
536static __forceinline__ __device__ bool optixReportIntersection( float hitT,
537 unsigned int hitKind,
538 unsigned int a0,
539 unsigned int a1,
540 unsigned int a2,
541 unsigned int a3,
542 unsigned int a4 );
543
547static __forceinline__ __device__ bool optixReportIntersection( float hitT,
548 unsigned int hitKind,
549 unsigned int a0,
550 unsigned int a1,
551 unsigned int a2,
552 unsigned int a3,
553 unsigned int a4,
554 unsigned int a5 );
555
559static __forceinline__ __device__ bool optixReportIntersection( float hitT,
560 unsigned int hitKind,
561 unsigned int a0,
562 unsigned int a1,
563 unsigned int a2,
564 unsigned int a3,
565 unsigned int a4,
566 unsigned int a5,
567 unsigned int a6 );
568
572static __forceinline__ __device__ bool optixReportIntersection( float hitT,
573 unsigned int hitKind,
574 unsigned int a0,
575 unsigned int a1,
576 unsigned int a2,
577 unsigned int a3,
578 unsigned int a4,
579 unsigned int a5,
580 unsigned int a6,
581 unsigned int a7 );
582
584static __forceinline__ __device__ unsigned int optixGetAttribute_0();
586static __forceinline__ __device__ unsigned int optixGetAttribute_1();
588static __forceinline__ __device__ unsigned int optixGetAttribute_2();
590static __forceinline__ __device__ unsigned int optixGetAttribute_3();
592static __forceinline__ __device__ unsigned int optixGetAttribute_4();
594static __forceinline__ __device__ unsigned int optixGetAttribute_5();
596static __forceinline__ __device__ unsigned int optixGetAttribute_6();
598static __forceinline__ __device__ unsigned int optixGetAttribute_7();
599
603static __forceinline__ __device__ void optixTerminateRay();
604
608static __forceinline__ __device__ void optixIgnoreIntersection();
609
610
622static __forceinline__ __device__ unsigned int optixGetPrimitiveIndex();
623
629static __forceinline__ __device__ unsigned int optixGetSbtGASIndex();
630
631
639static __forceinline__ __device__ unsigned int optixGetInstanceId();
640
646static __forceinline__ __device__ unsigned int optixGetInstanceIndex();
647
656static __forceinline__ __device__ unsigned int optixGetHitKind();
657
659static __forceinline__ __device__ OptixPrimitiveType optixGetPrimitiveType( unsigned int hitKind );
660
662static __forceinline__ __device__ bool optixIsFrontFaceHit( unsigned int hitKind );
663
665static __forceinline__ __device__ bool optixIsBackFaceHit( unsigned int hitKind );
666
668static __forceinline__ __device__ OptixPrimitiveType optixGetPrimitiveType();
669
671static __forceinline__ __device__ bool optixIsFrontFaceHit();
672
674static __forceinline__ __device__ bool optixIsBackFaceHit();
675
677static __forceinline__ __device__ bool optixIsTriangleHit();
678
680static __forceinline__ __device__ bool optixIsTriangleFrontFaceHit();
681
683static __forceinline__ __device__ bool optixIsTriangleBackFaceHit();
684
686static __forceinline__ __device__ bool optixIsDisplacedMicromeshTriangleHit();
687
689static __forceinline__ __device__ bool optixIsDisplacedMicromeshTriangleFrontFaceHit();
690
692static __forceinline__ __device__ bool optixIsDisplacedMicromeshTriangleBackFaceHit();
693
698static __forceinline__ __device__ float2 optixGetTriangleBarycentrics();
699
702static __forceinline__ __device__ float optixGetCurveParameter();
703
706static __forceinline__ __device__ float2 optixGetRibbonParameters();
707
711static __forceinline__ __device__ uint3 optixGetLaunchIndex();
712
714static __forceinline__ __device__ uint3 optixGetLaunchDimensions();
715
717static __forceinline__ __device__ CUdeviceptr optixGetSbtDataPointer();
718
730static __forceinline__ __device__ void optixThrowException( int exceptionCode );
731
735static __forceinline__ __device__ void optixThrowException( int exceptionCode, unsigned int exceptionDetail0 );
736
740static __forceinline__ __device__ void optixThrowException( int exceptionCode,
741 unsigned int exceptionDetail0,
742 unsigned int exceptionDetail1 );
743
747static __forceinline__ __device__ void optixThrowException( int exceptionCode,
748 unsigned int exceptionDetail0,
749 unsigned int exceptionDetail1,
750 unsigned int exceptionDetail2 );
751
755static __forceinline__ __device__ void optixThrowException( int exceptionCode,
756 unsigned int exceptionDetail0,
757 unsigned int exceptionDetail1,
758 unsigned int exceptionDetail2,
759 unsigned int exceptionDetail3 );
760
764static __forceinline__ __device__ void optixThrowException( int exceptionCode,
765 unsigned int exceptionDetail0,
766 unsigned int exceptionDetail1,
767 unsigned int exceptionDetail2,
768 unsigned int exceptionDetail3,
769 unsigned int exceptionDetail4 );
770
774static __forceinline__ __device__ void optixThrowException( int exceptionCode,
775 unsigned int exceptionDetail0,
776 unsigned int exceptionDetail1,
777 unsigned int exceptionDetail2,
778 unsigned int exceptionDetail3,
779 unsigned int exceptionDetail4,
780 unsigned int exceptionDetail5 );
781
785static __forceinline__ __device__ void optixThrowException( int exceptionCode,
786 unsigned int exceptionDetail0,
787 unsigned int exceptionDetail1,
788 unsigned int exceptionDetail2,
789 unsigned int exceptionDetail3,
790 unsigned int exceptionDetail4,
791 unsigned int exceptionDetail5,
792 unsigned int exceptionDetail6 );
793
797static __forceinline__ __device__ void optixThrowException( int exceptionCode,
798 unsigned int exceptionDetail0,
799 unsigned int exceptionDetail1,
800 unsigned int exceptionDetail2,
801 unsigned int exceptionDetail3,
802 unsigned int exceptionDetail4,
803 unsigned int exceptionDetail5,
804 unsigned int exceptionDetail6,
805 unsigned int exceptionDetail7 );
806
810static __forceinline__ __device__ int optixGetExceptionCode();
811
818static __forceinline__ __device__ unsigned int optixGetExceptionDetail_0();
819
823static __forceinline__ __device__ unsigned int optixGetExceptionDetail_1();
824
828static __forceinline__ __device__ unsigned int optixGetExceptionDetail_2();
829
833static __forceinline__ __device__ unsigned int optixGetExceptionDetail_3();
834
838static __forceinline__ __device__ unsigned int optixGetExceptionDetail_4();
839
843static __forceinline__ __device__ unsigned int optixGetExceptionDetail_5();
844
848static __forceinline__ __device__ unsigned int optixGetExceptionDetail_6();
849
853static __forceinline__ __device__ unsigned int optixGetExceptionDetail_7();
854
861
867static __forceinline__ __device__ int optixGetExceptionInvalidSbtOffset();
868
877static __forceinline__ __device__ OptixInvalidRayExceptionDetails optixGetExceptionInvalidRay();
878
891static __forceinline__ __device__ OptixParameterMismatchExceptionDetails optixGetExceptionParameterMismatch();
892
903static __forceinline__ __device__ char* optixGetExceptionLineInfo();
904
919template <typename ReturnT, typename... ArgTypes>
920static __forceinline__ __device__ ReturnT optixDirectCall( unsigned int sbtIndex, ArgTypes... args );
921
922
938template <typename ReturnT, typename... ArgTypes>
939static __forceinline__ __device__ ReturnT optixContinuationCall( unsigned int sbtIndex, ArgTypes... args );
940
941
1004static __forceinline__ __device__ uint4 optixTexFootprint2D( unsigned long long tex, unsigned int texInfo, float x, float y, unsigned int* singleMipLevel );
1005
1015static __forceinline__ __device__ uint4
1016optixTexFootprint2DLod( unsigned long long tex, unsigned int texInfo, float x, float y, float level, bool coarse, unsigned int* singleMipLevel );
1017
1030static __forceinline__ __device__ uint4 optixTexFootprint2DGrad( unsigned long long tex,
1031 unsigned int texInfo,
1032 float x,
1033 float y,
1034 float dPdx_x,
1035 float dPdx_y,
1036 float dPdy_x,
1037 float dPdy_y,
1038 bool coarse,
1039 unsigned int* singleMipLevel );
1040 // end group optix_device_api
1042
1043#define __OPTIX_INCLUDE_INTERNAL_HEADERS__
1044
1046
1047#endif // OPTIX_OPTIX_DEVICE_H
static __forceinline__ __device__ unsigned int optixGetExceptionDetail_7()
Returns the 32-bit exception detail at slot 7.
static __forceinline__ __device__ ReturnT optixContinuationCall(unsigned int sbtIndex, ArgTypes... args)
Creates a call to the continuation callable program at the specified SBT entry.
static __forceinline__ __device__ void optixThrowException(int exceptionCode)
Throws a user exception with the given exception code (overload without exception details).
static __forceinline__ __device__ unsigned int optixGetPayload_2()
Reads the 32-bit payload value at slot 2.
static __forceinline__ __device__ void optixSetPayload_16(unsigned int p)
Writes the 32-bit payload value at slot 16.
static __forceinline__ __device__ float3 optixTransformNormalFromWorldToObjectSpace(float3 normal)
Transforms the normal using world-to-object transformation matrix resulting from the current active t...
static __forceinline__ __device__ unsigned int optixGetPayload_25()
Reads the 32-bit payload value at slot 25.
static __forceinline__ __device__ unsigned int optixGetPayload_1()
Reads the 32-bit payload value at slot 1.
static __forceinline__ __device__ unsigned int optixGetPayload_15()
Reads the 32-bit payload value at slot 15.
static __forceinline__ __device__ OptixTraversableHandle optixGetGASTraversableHandle()
Returns the traversable handle for the Geometry Acceleration Structure (GAS) containing the current h...
static __forceinline__ __device__ uint3 optixGetLaunchDimensions()
Available in any program, it returns the dimensions of the current launch specified by optixLaunch on...
static __forceinline__ __device__ void optixSetPayload_11(unsigned int p)
Writes the 32-bit payload value at slot 11.
static __forceinline__ __device__ void optixSetPayload_8(unsigned int p)
Writes the 32-bit payload value at slot 8.
static __forceinline__ __device__ void optixSetPayload_5(unsigned int p)
Writes the 32-bit payload value at slot 5.
static __forceinline__ __device__ unsigned int optixGetPayload_9()
Reads the 32-bit payload value at slot 9.
static __forceinline__ __device__ void optixSetPayload_29(unsigned int p)
Writes the 32-bit payload value at slot 29.
static __forceinline__ __device__ void optixSetPayload_14(unsigned int p)
Writes the 32-bit payload value at slot 14.
static __forceinline__ __device__ unsigned int optixGetExceptionDetail_2()
Returns the 32-bit exception detail at slot 2.
static __forceinline__ __device__ const OptixStaticTransform * optixGetStaticTransformFromHandle(OptixTraversableHandle handle)
Returns a pointer to a OptixStaticTransform from its traversable handle.
static __forceinline__ __device__ void optixSetPayload_19(unsigned int p)
Writes the 32-bit payload value at slot 19.
static __forceinline__ __device__ float3 optixGetWorldRayDirection()
Returns the rayDirection passed into optixTrace.
static __forceinline__ __device__ float3 optixGetObjectRayOrigin()
Returns the current object space ray origin based on the current transform stack.
static __forceinline__ __device__ OptixParameterMismatchExceptionDetails optixGetExceptionParameterMismatch()
Returns information about an exception with code OPTIX_EXCEPTION_CODE_CALLABLE_PARAMETER_MISMATCH.
static __forceinline__ __device__ bool optixIsFrontFaceHit(unsigned int hitKind)
Function interpreting the result of optixGetHitKind().
static __forceinline__ __device__ unsigned int optixGetAttribute_4()
Returns the attribute at slot 4.
static __forceinline__ __device__ unsigned int optixGetPayload_4()
Reads the 32-bit payload value at slot 4.
static __forceinline__ __device__ void optixSetPayload_10(unsigned int p)
Writes the 32-bit payload value at slot 10.
static __forceinline__ __device__ unsigned int optixGetPayload_18()
Reads the 32-bit payload value at slot 18.
static __forceinline__ __device__ unsigned int optixGetAttribute_6()
Returns the attribute at slot 6.
static __forceinline__ __device__ unsigned int optixGetAttribute_3()
Returns the attribute at slot 3.
static __forceinline__ __device__ void optixSetPayload_20(unsigned int p)
Writes the 32-bit payload value at slot 20.
static __forceinline__ __device__ void optixSetPayload_4(unsigned int p)
Writes the 32-bit payload value at slot 4.
static __forceinline__ __device__ unsigned int optixGetPayload_5()
Reads the 32-bit payload value at slot 5.
static __forceinline__ __device__ unsigned int optixGetPayload_22()
Reads the 32-bit payload value at slot 22.
static __forceinline__ __device__ bool optixIsTriangleHit()
Convenience function interpreting the result of optixGetHitKind().
static __forceinline__ __device__ void optixGetCubicBSplineVertexData(OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float4 data[4])
Return the object space curve control vertex data of a cubic BSpline curve in a Geometry Acceleration...
static __forceinline__ __device__ unsigned int optixGetPayload_27()
Reads the 32-bit payload value at slot 27.
static __forceinline__ __device__ float optixGetGASMotionTimeEnd(OptixTraversableHandle gas)
Returns the motion end time of a GAS (see OptixMotionOptions)
static __forceinline__ __device__ uint4 optixTexFootprint2DGrad(unsigned long long tex, unsigned int texInfo, float x, float y, float dPdx_x, float dPdx_y, float dPdy_x, float dPdy_y, bool coarse, unsigned int *singleMipLevel)
optixTexFootprint2DGrad calculates the footprint of a corresponding 2D texture fetch (tex2DGrad)
static __forceinline__ __device__ void optixSetPayload_6(unsigned int p)
Writes the 32-bit payload value at slot 6.
static __forceinline__ __device__ unsigned int optixGetAttribute_1()
Returns the attribute at slot 1.
static __forceinline__ __device__ bool optixIsTriangleBackFaceHit()
Convenience function interpreting the result of optixGetHitKind().
static __forceinline__ __device__ unsigned int optixGetAttribute_5()
Returns the attribute at slot 5.
static __forceinline__ __device__ void optixGetRibbonVertexData(OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float4 data[3])
Return the object space curve control vertex data of a ribbon (flat quadratic BSpline) in a Geometry ...
static __forceinline__ __device__ void optixSetPayload_25(unsigned int p)
Writes the 32-bit payload value at slot 25.
static __forceinline__ __device__ unsigned int optixGetRayFlags()
Returns the rayFlags passed into optixTrace.
static __forceinline__ __device__ float3 optixTransformPointFromObjectToWorldSpace(float3 point)
Transforms the point using object-to-world transformation matrix resulting from the current active tr...
static __forceinline__ __device__ unsigned int optixGetPayload_26()
Reads the 32-bit payload value at slot 26.
static __forceinline__ __device__ void optixSetPayload_17(unsigned int p)
Writes the 32-bit payload value at slot 17.
static __forceinline__ __device__ void optixSetPayload_7(unsigned int p)
Writes the 32-bit payload value at slot 7.
static __forceinline__ __device__ ReturnT optixDirectCall(unsigned int sbtIndex, ArgTypes... args)
Creates a call to the direct callable program at the specified SBT entry.
static __forceinline__ __device__ unsigned int optixGetPayload_30()
Reads the 32-bit payload value at slot 30.
static __forceinline__ __device__ void optixSetPayload_28(unsigned int p)
Writes the 32-bit payload value at slot 28.
static __forceinline__ __device__ OptixPrimitiveType optixGetPrimitiveType(unsigned int hitKind)
Function interpreting the result of optixGetHitKind().
static __forceinline__ __device__ float3 optixTransformVectorFromObjectToWorldSpace(float3 vec)
Transforms the vector using object-to-world transformation matrix resulting from the current active t...
static __forceinline__ __device__ unsigned int optixGetInstanceId()
Returns the OptixInstance::instanceId of the instance within the top level acceleration structure ass...
static __forceinline__ __device__ char * optixGetExceptionLineInfo()
Returns a string that includes information about the source location that caused the current exceptio...
static __forceinline__ __device__ void optixSetPayload_27(unsigned int p)
Writes the 32-bit payload value at slot 27.
static __forceinline__ __device__ void optixSetPayload_2(unsigned int p)
Writes the 32-bit payload value at slot 2.
static __forceinline__ __device__ void optixGetCatmullRomVertexData(OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float4 data[4])
Return the object space curve control vertex data of a CatmullRom spline curve in a Geometry Accelera...
static __forceinline__ __device__ int optixGetExceptionCode()
Returns the exception code.
static __forceinline__ __device__ void optixSetPayload_12(unsigned int p)
Writes the 32-bit payload value at slot 12.
static __forceinline__ __device__ void optixGetObjectToWorldTransformMatrix(float m[12])
Returns the object-to-world transformation matrix resulting from the current active transformation li...
static __forceinline__ __device__ unsigned int optixGetPayload_24()
Reads the 32-bit payload value at slot 24.
static __forceinline__ __device__ unsigned int optixGetPayload_17()
Reads the 32-bit payload value at slot 17.
static __forceinline__ __device__ const OptixMatrixMotionTransform * optixGetMatrixMotionTransformFromHandle(OptixTraversableHandle handle)
Returns a pointer to a OptixMatrixMotionTransform from its traversable handle.
static __forceinline__ __device__ void optixGetSphereData(OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float4 data[1])
Return the object space sphere data, center point and radius, in a Geometry Acceleration Structure (G...
static __forceinline__ __device__ unsigned int optixGetPayload_13()
Reads the 32-bit payload value at slot 13.
static __forceinline__ __device__ uint4 optixTexFootprint2D(unsigned long long tex, unsigned int texInfo, float x, float y, unsigned int *singleMipLevel)
optixTexFootprint2D calculates the footprint of a corresponding 2D texture fetch (non-mipmapped).
static __forceinline__ __device__ void optixSetPayload_23(unsigned int p)
Writes the 32-bit payload value at slot 23.
static __forceinline__ __device__ unsigned int optixGetAttribute_0()
Returns the attribute at slot 0.
static __forceinline__ __device__ void optixSetPayloadTypes(unsigned int typeMask)
Specify the supported payload types for a program.
static __forceinline__ __device__ unsigned int optixGetPayload_10()
Reads the 32-bit payload value at slot 10.
static __forceinline__ __device__ void optixGetQuadraticBSplineVertexData(OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float4 data[3])
Return the object space curve control vertex data of a quadratic BSpline curve in a Geometry Accelera...
static __forceinline__ __device__ uint3 optixGetLaunchIndex()
Available in any program, it returns the current launch index within the launch dimensions specified ...
static __forceinline__ __device__ unsigned int optixGetPayload_31()
Reads the 32-bit payload value at slot 31.
static __forceinline__ __device__ void optixSetPayload_24(unsigned int p)
Writes the 32-bit payload value at slot 24.
static __forceinline__ __device__ void optixTerminateRay()
Record the hit, stops traversal, and proceeds to CH.
static __forceinline__ __device__ OptixTraversableHandle optixGetInstanceTraversableFromIAS(OptixTraversableHandle ias, unsigned int instIdx)
Return the traversable handle of a given instance in an Instance Acceleration Structure (IAS) To obta...
static __forceinline__ __device__ int optixGetExceptionInvalidSbtOffset()
Returns the invalid sbt offset for exceptions with exception code OPTIX_EXCEPTION_CODE_TRAVERSAL_INVA...
static __forceinline__ __device__ unsigned int optixGetExceptionDetail_6()
Returns the 32-bit exception detail at slot 6.
static __forceinline__ __device__ unsigned int optixGetAttribute_7()
Returns the attribute at slot 7.
static __forceinline__ __device__ unsigned int optixGetRayVisibilityMask()
Returns the visibilityMask passed into optixTrace.
static __forceinline__ __device__ void optixSetPayload_30(unsigned int p)
Writes the 32-bit payload value at slot 30.
static __forceinline__ __device__ unsigned int optixGetInstanceIdFromHandle(OptixTraversableHandle handle)
Returns instanceId from an OptixInstance traversable.
static __forceinline__ __device__ void optixGetLinearCurveVertexData(OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float4 data[2])
Return the object space curve control vertex data of a linear curve in a Geometry Acceleration Struct...
static __forceinline__ __device__ unsigned int optixGetPayload_3()
Reads the 32-bit payload value at slot 3.
static __forceinline__ __device__ bool optixReportIntersection(float hitT, unsigned int hitKind)
Reports an intersections (overload without attributes).
static __forceinline__ __device__ float optixGetGASMotionTimeBegin(OptixTraversableHandle gas)
Returns the motion begin time of a GAS (see OptixMotionOptions)
static __forceinline__ __device__ unsigned int optixGetPayload_23()
Reads the 32-bit payload value at slot 23.
static __forceinline__ __device__ unsigned int optixGetPayload_20()
Reads the 32-bit payload value at slot 20.
static __forceinline__ __device__ OptixTraversableHandle optixGetTransformListHandle(unsigned int index)
Returns the traversable handle for a transform on the current transform list.
static __forceinline__ __device__ unsigned int optixGetExceptionDetail_0()
Returns the 32-bit exception detail at slot 0.
static __forceinline__ __device__ unsigned int optixUndefinedValue()
Returns an undefined value.
static __forceinline__ __device__ float2 optixGetRibbonParameters()
Returns the ribbon parameters along directrix (length) and generator (width) of the current intersect...
static __forceinline__ __device__ void optixIgnoreIntersection()
Discards the hit, and returns control to the calling optixReportIntersection or built-in intersection...
static __forceinline__ __device__ OptixInvalidRayExceptionDetails optixGetExceptionInvalidRay()
Returns the invalid ray for exceptions with exception code OPTIX_EXCEPTION_CODE_INVALID_RAY....
static __forceinline__ __device__ float optixGetRayTmax()
In IS and CH returns the current smallest reported hitT or the tmax passed into optixTrace if no hit ...
static __forceinline__ __device__ float3 optixTransformNormalFromObjectToWorldSpace(float3 normal)
Transforms the normal using object-to-world transformation matrix resulting from the current active t...
static __forceinline__ __device__ void optixGetCubicBezierVertexData(OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float4 data[4])
Return the object space curve control vertex data of a cubic Bezier curve in a Geometry Acceleration ...
static __forceinline__ __device__ unsigned int optixGetExceptionDetail_1()
Returns the 32-bit exception detail at slot 1.
static __forceinline__ __device__ float2 optixGetTriangleBarycentrics()
Convenience function that returns the first two attributes as floats.
static __forceinline__ __device__ float3 optixGetObjectRayDirection()
Returns the current object space ray direction based on the current transform stack.
static __forceinline__ __device__ unsigned int optixGetPayload_6()
Reads the 32-bit payload value at slot 6.
static __forceinline__ __device__ void optixSetPayload_9(unsigned int p)
Writes the 32-bit payload value at slot 9.
static __forceinline__ __device__ void optixSetPayload_26(unsigned int p)
Writes the 32-bit payload value at slot 26.
static __forceinline__ __device__ unsigned int optixGetGASMotionStepCount(OptixTraversableHandle gas)
Returns the number of motion steps of a GAS (see OptixMotionOptions)
static __forceinline__ __device__ unsigned int optixGetPayload_11()
Reads the 32-bit payload value at slot 11.
static __forceinline__ __device__ void optixGetMicroTriangleVertexData(float3 data[3])
Return the object space micro triangle vertex positions of the current hit. The current hit must be a...
static __forceinline__ __device__ void optixGetWorldToObjectTransformMatrix(float m[12])
Returns the world-to-object transformation matrix resulting from the current active transformation li...
static __forceinline__ __device__ unsigned int optixGetInstanceIndex()
Returns the zero-based index of the instance within its instance acceleration structure associated wi...
static __forceinline__ __device__ bool optixIsDisplacedMicromeshTriangleFrontFaceHit()
Convenience function interpreting the result of optixGetHitKind().
static __forceinline__ __device__ float3 optixGetWorldRayOrigin()
Returns the rayOrigin passed into optixTrace.
static __forceinline__ __device__ void optixSetPayload_22(unsigned int p)
Writes the 32-bit payload value at slot 22.
static __forceinline__ __device__ void optixTrace(OptixTraversableHandle handle, float3 rayOrigin, float3 rayDirection, float tmin, float tmax, float rayTime, OptixVisibilityMask visibilityMask, unsigned int rayFlags, unsigned int SBToffset, unsigned int SBTstride, unsigned int missSBTIndex, Payload &... payload)
Initiates a ray tracing query starting with the given traversable.
static __forceinline__ __device__ uint4 optixTexFootprint2DLod(unsigned long long tex, unsigned int texInfo, float x, float y, float level, bool coarse, unsigned int *singleMipLevel)
optixTexFootprint2DLod calculates the footprint of a corresponding 2D texture fetch (tex2DLod)
static __forceinline__ __device__ unsigned int optixGetPrimitiveIndex()
For a given OptixBuildInputTriangleArray the number of primitives is defined as "(OptixBuildInputTria...
static __forceinline__ __device__ const float4 * optixGetInstanceTransformFromHandle(OptixTraversableHandle handle)
Returns object-to-world transform from an OptixInstance traversable.
static __forceinline__ __device__ void optixSetPayload_3(unsigned int p)
Writes the 32-bit payload value at slot 3.
static __forceinline__ __device__ bool optixIsBackFaceHit(unsigned int hitKind)
Function interpreting the result of optixGetHitKind().
static __forceinline__ __device__ unsigned int optixGetTransformListSize()
Returns the number of transforms on the current transform list.
static __forceinline__ __device__ void optixSetPayload_18(unsigned int p)
Writes the 32-bit payload value at slot 18.
static __forceinline__ __device__ bool optixIsDisplacedMicromeshTriangleHit()
Convenience function interpreting the result of optixGetHitKind().
static __forceinline__ __device__ unsigned int optixGetSbtGASIndex()
Returns the Sbt GAS index of the primitive associated with the current intersection.
static __forceinline__ __device__ void optixSetPayload_21(unsigned int p)
Writes the 32-bit payload value at slot 21.
static __forceinline__ __device__ bool optixIsDisplacedMicromeshTriangleBackFaceHit()
Convenience function interpreting the result of optixGetHitKind().
static __forceinline__ __device__ void optixSetPayload_0(unsigned int p)
Writes the 32-bit payload value at slot 0.
static __forceinline__ __device__ const OptixSRTMotionTransform * optixGetSRTMotionTransformFromHandle(OptixTraversableHandle handle)
Returns a pointer to a OptixSRTMotionTransform from its traversable handle.
static __forceinline__ __device__ unsigned int optixGetPayload_14()
Reads the 32-bit payload value at slot 14.
static __forceinline__ __device__ CUdeviceptr optixGetSbtDataPointer()
Returns the generic memory space pointer to the data region (past the header) of the currently active...
static __forceinline__ __device__ float3 optixGetRibbonNormal(OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float2 ribbonParameters)
Return ribbon normal at intersection reported by optixReportIntersection.
static __forceinline__ __device__ void optixGetMicroTriangleBarycentricsData(float2 data[3])
Returns the barycentrics of the vertices of the currently intersected micro triangle with respect to ...
static __forceinline__ __device__ void optixSetPayload_1(unsigned int p)
Writes the 32-bit payload value at slot 1.
static __forceinline__ __device__ void optixSetPayload_13(unsigned int p)
Writes the 32-bit payload value at slot 13.
static __forceinline__ __device__ unsigned int optixGetPayload_21()
Reads the 32-bit payload value at slot 21.
static __forceinline__ __device__ unsigned int optixGetPayload_8()
Reads the 32-bit payload value at slot 8.
static __forceinline__ __device__ float optixGetCurveParameter()
Returns the curve parameter associated with the current intersection when using OptixBuildInputCurveA...
static __forceinline__ __device__ unsigned int optixGetPayload_19()
Reads the 32-bit payload value at slot 19.
static __forceinline__ __device__ unsigned int optixGetExceptionDetail_4()
Returns the 32-bit exception detail at slot 4.
static __forceinline__ __device__ float3 optixTransformVectorFromWorldToObjectSpace(float3 vec)
Transforms the vector using world-to-object transformation matrix resulting from the current active t...
static __forceinline__ __device__ void optixSetPayload_15(unsigned int p)
Writes the 32-bit payload value at slot 15.
static __forceinline__ __device__ bool optixIsTriangleFrontFaceHit()
Convenience function interpreting the result of optixGetHitKind().
static __forceinline__ __device__ unsigned int optixGetPayload_0()
Reads the 32-bit payload value at slot 0.
static __forceinline__ __device__ float3 optixTransformPointFromWorldToObjectSpace(float3 point)
Transforms the point using world-to-object transformation matrix resulting from the current active tr...
static __forceinline__ __device__ OptixTraversableHandle optixGetExceptionInvalidTraversable()
Returns the invalid traversable handle for exceptions with exception code OPTIX_EXCEPTION_CODE_TRAVER...
static __forceinline__ __device__ unsigned int optixGetAttribute_2()
Returns the attribute at slot 2.
static __forceinline__ __device__ unsigned int optixGetHitKind()
Returns the 8 bit hit kind associated with the current hit.
static __forceinline__ __device__ unsigned int optixGetPayload_28()
Reads the 32-bit payload value at slot 28.
static __forceinline__ __device__ unsigned int optixGetPayload_7()
Reads the 32-bit payload value at slot 7.
static __forceinline__ __device__ void optixGetTriangleVertexData(OptixTraversableHandle gas, unsigned int primIdx, unsigned int sbtGASIndex, float time, float3 data[3])
Return the object space triangle vertex positions of a given triangle in a Geometry Acceleration Stru...
static __forceinline__ __device__ float optixGetRayTmin()
Returns the tmin passed into optixTrace.
static __forceinline__ __device__ float optixGetRayTime()
Returns the rayTime passed into optixTrace.
static __forceinline__ __device__ void optixSetPayload_31(unsigned int p)
Writes the 32-bit payload value at slot 31.
static __forceinline__ __device__ unsigned int optixGetPayload_16()
Reads the 32-bit payload value at slot 16.
static __forceinline__ __device__ OptixTransformType optixGetTransformTypeFromHandle(OptixTraversableHandle handle)
Returns the transform type of a traversable handle from a transform list.
static __forceinline__ __device__ const float4 * optixGetInstanceInverseTransformFromHandle(OptixTraversableHandle handle)
Returns world-to-object transform from an OptixInstance traversable.
static __forceinline__ __device__ unsigned int optixGetPayload_12()
Reads the 32-bit payload value at slot 12.
static __forceinline__ __device__ unsigned int optixGetExceptionDetail_5()
Returns the 32-bit exception detail at slot 5.
static __forceinline__ __device__ unsigned int optixGetPayload_29()
Reads the 32-bit payload value at slot 29.
static __forceinline__ __device__ OptixTraversableHandle optixGetInstanceChildFromHandle(OptixTraversableHandle handle)
Returns child traversable handle from an OptixInstance traversable.
static __forceinline__ __device__ unsigned int optixGetExceptionDetail_3()
Returns the 32-bit exception detail at slot 3.
OptixTransformType
Transform.
Definition: optix_types.h:1831
unsigned long long CUdeviceptr
CUDA device pointer.
Definition: optix_types.h:52
unsigned int OptixVisibilityMask
Visibility mask.
Definition: optix_types.h:80
unsigned long long OptixTraversableHandle
Traversable handle.
Definition: optix_types.h:77
OptixPrimitiveType
Builtin primitive types.
Definition: optix_types.h:708
OptixPayloadTypeID
Payload type identifiers.
Definition: optix_types.h:1958
OptiX public API.
OptiX public API header.
Represents a matrix motion transformation.
Definition: optix_types.h:1435
Represents an SRT motion transformation.
Definition: optix_types.h:1518
Static transform.
Definition: optix_types.h:1395