Tachyon (current)  Current Main Branch
Data Structures | Macros | Enumerations | Functions
TachyonOptiXShaders.h File Reference

Tachyon ray tracing engine core routines and data structures compiled to PTX for runtime JIT to build complete ray tracing pipelines. More...

Go to the source code of this file.

Data Structures

struct  rt_texture
 structure containing Tachyon texture (only used on host side) More...
 
struct  rt_material
 structure containing Tachyon material properties More...
 
struct  rt_directional_light
 
struct  rt_positional_light
 
struct  ConeArraySBT
 
struct  CurveArraySBT
 
struct  CylinderArraySBT
 
struct  QuadMeshSBT
 
struct  RingArraySBT
 
struct  SphereArraySBT
 
struct  TriMeshSBT
 
struct  GeomSBTHG
 
struct  HGRecordGroup
 Store all hitgroup records for a given geometry together for simpler dynamic updates. More...
 
struct  tachyonLaunchParams
 Tachyon OptiX global launch parameter structure containing the active camera, framebuffer, materials, and any global scene parameters required for shading. More...
 

Macros

#define TACHYON_USE_GEOMFLAGS   1
 
#define RT_DEFAULT_MAX   1e27f
 
#define RT_CUSTPRIM   0
 
#define RT_TRI_BUILTIN   OPTIX_HIT_KIND_TRIANGLE_FRONT_FACE
 
#define M_PI   3.14159265358979323846
 
#define M_PIf   3.14159265358979323846f
 
#define UINT32_RAND_MAX   4294967296.0f
 
#define UINT32_RAND_MAX_INV   2.3283064365e-10f
 
#define SQUARES_RNG_KEY1   0x1235d7fcb4dfec21
 
#define SQUARES_RNG_KEY2   0x418627e323f457a1
 
#define SQUARES_RNG_KEY3   0x83fc79d43614975f
 
#define SQUARES_RNG_KEY4   0xc62f73498cb654e3
 

Enumerations

enum  RtShadowMode { RT_SHADOWS_OFF =0, RT_SHADOWS_ON =1, RT_SHADOWS_ON_REVERSE =2 }
 
enum  RtDenoiserMode { RT_DENOISER_OFF =0, RT_DENOISER_ON =1 }
 
enum  RtTonemapMode {
  RT_TONEMAP_CLAMP =0, RT_TONEMAP_ACES, RT_TONEMAP_REINHARD, RT_TONEMAP_REINHARD_EXT,
  RT_TONEMAP_REINHARD_EXT_L, RT_TONEMAP_COUNT
}
 
enum  RayType { RT_RAY_TYPE_RADIANCE =0, RT_RAY_TYPE_SHADOW =1, RT_RAY_TYPE_COUNT }
 
enum  RtHitKind {
  RT_HIT_HWTRIANGLE =1, RT_HIT_CONE, RT_HIT_CYLINDER, RT_HIT_QUAD,
  RT_HIT_RING, RT_HIT_SPHERE, RT_HIT_CURVE
}
 
enum  RtMergedPrimKind {
  RT_PRM_CONE = RT_CUSTPRIM | RT_HIT_CONE, RT_PRM_CYLINDER = RT_CUSTPRIM | RT_HIT_CYLINDER, RT_PRM_QUAD = RT_CUSTPRIM | RT_HIT_QUAD, RT_PRM_RING = RT_CUSTPRIM | RT_HIT_RING,
  RT_PRM_SPHERE = RT_CUSTPRIM | RT_HIT_SPHERE, RT_PRM_TRIANGLE
}
 
enum  RtCustPrim {
  RT_CUST_PRIM_CONE =0, RT_CUST_PRIM_CYLINDER, RT_CUST_PRIM_QUAD, RT_CUST_PRIM_RING,
  RT_CUST_PRIM_SPHERE, RT_CUST_PRIM_COUNT
}
 
enum  RtColorSpace { RT_COLORSPACE_LINEAR =0, RT_COLORSPACE_sRGB =1, RT_COLORSPACE_COUNT }
 
enum  RtTexFlags { RT_TEX_NONE =0, RT_TEX_COLORSPACE_LINEAR = 0, RT_TEX_COLORSPACE_sRGB = 0x1, RT_TEX_ALPHA = 0x2 }
 
enum  RtMatFlags { RT_MAT_NONE = 0, RT_MAT_ALPHA = 0x1, RT_MAT_TEXALPHA = 0x2 }
 

Functions

struct __align__ (OPTIX_SBT_RECORD_ALIGNMENT) HGRecord
 SBT record for a hitgroup program. More...
 
__host__ __device__ float2 operator+ (const float2 &a, const float2 &b)
 
__host__ __device__ float2 operator+ (const float2 &a, const float s)
 
__host__ __device__ float2 operator- (const float2 &a, const float2 &b)
 
__host__ __device__ float2 operator- (const float2 &a, const float s)
 
__host__ __device__ float2 operator- (const float s, const float2 &a)
 
__host__ __device__ float2 operator* (const float2 &a, const float2 &b)
 
__host__ __device__ float2 operator* (const float s, const float2 &a)
 
__host__ __device__ float2 operator* (const float2 &a, const float s)
 
__host__ __device__ void operator*= (float2 &a, const float s)
 
__host__ __device__ float2 operator/ (const float s, const float2 &a)
 
__host__ __device__ float3 make_float3 (const float s)
 
__host__ __device__ float3 make_float3 (const float4 &a)
 
__host__ __device__ float3 operator+ (float3 a, float3 b)
 
__host__ __device__ float3 operator- (const float3 &a, const float3 &b)
 
__host__ __device__ float3 operator- (const float3 &a)
 
__host__ __device__ void operator+= (float3 &a, const float3 &b)
 
__host__ __device__ float3 operator+ (const float3 &a, const float &b)
 
__host__ __device__ float3 operator* (const float3 &a, const float3 &b)
 
__host__ __device__ float3 operator* (float s, const float3 &a)
 
__host__ __device__ float3 operator* (const float3 &a, const float s)
 
__host__ __device__ void operator*= (float3 &a, const float s)
 
__host__ __device__ void operator*= (float3 &a, const float3 &b)
 
__host__ __device__ float3 operator/ (const float3 &a, const float3 &b)
 
__host__ __device__ float4 make_float4 (const float3 &a, const float &b)
 
__host__ __device__ float4 make_float4 (const float a)
 
__host__ __device__ void operator+= (float4 &a, const float4 &b)
 
__host__ __device__ float4 operator* (const float4 &a, const float s)
 
__host__ __device__ void operator*= (float4 &a, const float &b)
 
__host__ __device__ float3 operator* (char4 a, const float s)
 
__host__ __device__ float3 operator* (uchar4 a, const float s)
 
__host__ __device__ float3 fabsf (const float3 &a)
 
__host__ __device__ float3 fmaxf (const float3 &a, const float3 &b)
 
__host__ __device__ float fmaxf (const float3 &a)
 
__host__ __device__ float dot (const float3 &a, const float3 &b)
 
__host__ __device__ float dot (const float4 &a, const float4 &b)
 
__host__ __device__ float length (const float3 &v)
 
__host__ __device__ float3 normalize (const float3 &v)
 Normalize input vector to unit length. More...
 
__host__ __device__ float3 normalize_len (const float3 v, float &l)
 Normalize input vector to unit length, and return its original length. More...
 
__host__ __device__ float3 normalize_invlen (const float3 v, float &invlen)
 Normalize input vector to unit length, and return the reciprocal of its original length. More...
 
__host__ __device__ float3 cross (const float3 &a, const float3 &b)
 calculate the cross product between vectors a and b. More...
 
__host__ __device__ float3 reflect (const float3 &i, const float3 &n)
 calculate reflection direction from incident direction i, and surface normal n. More...
 
__host__ __device__ float3 faceforward (const float3 &n, const float3 &i, const float3 &nref)
 Ensure that an interpolated surface normal n faces in the same direction as dictated by a geometric normal nref, as seen from incident vector i. More...
 
static __host__ __device__ __inline__ uint32_t qnd_rng (uint32_t &idum)
 
static __host__ __device__ __inline__ uint32_t msws_rng (uint64_t &x, uint64_t &w)
 
template<unsigned int ROUNDS>
static __host__ __device__ __inline__ uint32_t squares_rng (uint64_t counter, uint64_t key)
 
template<unsigned int ROUNDS>
static __host__ __device__ __inline__ unsigned int tea (uint32_t val0, uint32_t val1)
 
static __device__ __inline__ float goldenratioseq1d (int n)
 
static __device__ __inline__ void goldenratioseq1d_incr (float &x)
 
static __device__ __inline__ void goldenratioseq2d (int n, float2 &xy)
 
static __device__ __inline__ void goldenratioseq2d_incr (float2 &xy)
 
static __device__ __inline__ void goldenratioseq3d (int n, float3 &xyz)
 
static __device__ __inline__ void goldenratioseq3d_incr (float3 &xyz)
 
static __device__ __inline__ void goldenratioseq4d (int n, float2 &xy1, float2 &xy2)
 
static __device__ __inline__ void goldenratioseq4d_incr (float2 &xy1, float2 &xy2)
 
static __device__ __inline__ void jitter_offset2f (unsigned int &pval, float2 &xy)
 
static __device__ __inline__ void jitter_disc2f (unsigned int &pval, float2 &xy, float radius)
 
static __device__ __inline__ void jitter_offset2f_qrn (float2 qrnxy, float2 &xy)
 
static __device__ __inline__ void jitter_disc2f_qrn (float2 &qrnxy, float2 &xy, float radius)
 
template<int UNORM>
static __host__ __device__ __inline__ float2 OctEncode (float3 n)
 
template<int UNORM>
static __host__ __device__ __inline__ float3 OctDecode (float2 projected)
 
static __host__ __device__ __inline__ uint convfloat2uint32 (float2 f2)
 
static __host__ __device__ __inline__ float2 convuint32float2 (uint packed)
 
static __host__ __device__ __inline__ uint packNormal (const float3 &normal)
 
static __host__ __device__ __inline__ float3 unpackNormal (uint packed)
 
static __forceinline__ __device__ float4 sRGB_to_linear (const float4 &rgba)
 
static __forceinline__ __device__ float4 linear_to_sRGB (const float4 &lin)
 
static __forceinline__ __device__ float4 sRGB_to_linear_approx (const float4 &rgba)
 
static __forceinline__ __device__ float4 linear_to_sRGB_approx (const float4 &linear)
 
static __forceinline__ __device__ float4 sRGB_to_linear_approx_20 (const float4 &rgba)
 
static __forceinline__ __device__ float4 linear_to_sRGB_approx_20 (const float4 &linear)
 
static __device__ __inline__ float luminance (float3 c)
 
static __device__ __inline__ float3 rescale_luminance (float3 c, float newluminance)
 
static __device__ __inline__ float3 ACES_TMO (float3 c)
 
static __device__ __inline__ float3 reinhard_TMO (float3 c)
 
static __device__ __inline__ float3 reinhard_extended_TMO (float3 c, float maxwhite)
 
static __device__ __inline__ float3 reinhard_extended_luminance_TMO (float3 c, float maxL)
 

Detailed Description

Tachyon ray tracing engine core routines and data structures compiled to PTX for runtime JIT to build complete ray tracing pipelines.

Key data structures defined here are shared both by the compiled PTX core ray tracing routines, and by the host code that assembles the complete ray tracing pipeline and launches the pipeline kernels. Written for NVIDIA OptiX 7 and later.

Definition in file TachyonOptiXShaders.h.

Macro Definition Documentation

◆ M_PI

#define M_PI   3.14159265358979323846

Definition at line 479 of file TachyonOptiXShaders.h.

Referenced by HSItoRGB(), parametric_grid_verts(), and pq_torus_knot().

◆ M_PIf

#define M_PIf   3.14159265358979323846f

◆ RT_CUSTPRIM

#define RT_CUSTPRIM   0

Definition at line 165 of file TachyonOptiXShaders.h.

◆ RT_DEFAULT_MAX

#define RT_DEFAULT_MAX   1e27f

◆ RT_TRI_BUILTIN

#define RT_TRI_BUILTIN   OPTIX_HIT_KIND_TRIANGLE_FRONT_FACE

Definition at line 166 of file TachyonOptiXShaders.h.

◆ SQUARES_RNG_KEY1

#define SQUARES_RNG_KEY1   0x1235d7fcb4dfec21

◆ SQUARES_RNG_KEY2

#define SQUARES_RNG_KEY2   0x418627e323f457a1

Definition at line 823 of file TachyonOptiXShaders.h.

◆ SQUARES_RNG_KEY3

#define SQUARES_RNG_KEY3   0x83fc79d43614975f

Definition at line 824 of file TachyonOptiXShaders.h.

◆ SQUARES_RNG_KEY4

#define SQUARES_RNG_KEY4   0xc62f73498cb654e3

Definition at line 825 of file TachyonOptiXShaders.h.

◆ TACHYON_USE_GEOMFLAGS

#define TACHYON_USE_GEOMFLAGS   1

Definition at line 101 of file TachyonOptiXShaders.h.

◆ UINT32_RAND_MAX

#define UINT32_RAND_MAX   4294967296.0f

Definition at line 739 of file TachyonOptiXShaders.h.

◆ UINT32_RAND_MAX_INV

#define UINT32_RAND_MAX_INV   2.3283064365e-10f

Enumeration Type Documentation

◆ RayType

enum RayType
Enumerator
RT_RAY_TYPE_RADIANCE 

normal radiance rays

RT_RAY_TYPE_SHADOW 

shadow probe/AO rays

RT_RAY_TYPE_COUNT 

total count of ray types

Definition at line 138 of file TachyonOptiXShaders.h.

◆ RtColorSpace

Enumerator
RT_COLORSPACE_LINEAR 

linear rgba, gamma 1.0

RT_COLORSPACE_sRGB 

Adobe sRGB (gamma 2.2)

RT_COLORSPACE_COUNT 

total count of available colorspaces

Definition at line 208 of file TachyonOptiXShaders.h.

◆ RtCustPrim

enum RtCustPrim
Enumerator
RT_CUST_PRIM_CONE 

cone SBT index multiplier

RT_CUST_PRIM_CYLINDER 

cylinder SBT index multiplier

RT_CUST_PRIM_QUAD 

quad SBT index multiplier

RT_CUST_PRIM_RING 

ring SBT index multiplier

RT_CUST_PRIM_SPHERE 

sphere SBT index multiplier

RT_CUST_PRIM_COUNT 

total count of SBT geometric multipliers

Definition at line 199 of file TachyonOptiXShaders.h.

◆ RtDenoiserMode

Enumerator
RT_DENOISER_OFF 

denoiser disabled

RT_DENOISER_ON 

denosier on, std. impl.

Definition at line 124 of file TachyonOptiXShaders.h.

◆ RtHitKind

enum RtHitKind
Enumerator
RT_HIT_HWTRIANGLE 

RTX triangle.

RT_HIT_CONE 

custom prim cone

RT_HIT_CYLINDER 

custom prim cyliner

RT_HIT_QUAD 

custom prim quadrilateral

RT_HIT_RING 

custom prim ring

RT_HIT_SPHERE 

custom prim sphere

RT_HIT_CURVE 

OptiX 7.x built-in curve prims.

Definition at line 147 of file TachyonOptiXShaders.h.

◆ RtMatFlags

enum RtMatFlags
Enumerator
RT_MAT_NONE 

default behavior

RT_MAT_ALPHA 

enable alpha transparency

RT_MAT_TEXALPHA 

enable tex cutout transparency

Definition at line 221 of file TachyonOptiXShaders.h.

◆ RtMergedPrimKind

Enumerator
RT_PRM_CONE 

custom prim cone

RT_PRM_CYLINDER 

custom prim cylinder

RT_PRM_QUAD 

custom prim quadrilateral

RT_PRM_RING 

custom prim ring

RT_PRM_SPHERE 

custom prim sphere

RT_PRM_TRIANGLE 

Definition at line 169 of file TachyonOptiXShaders.h.

◆ RtShadowMode

Enumerator
RT_SHADOWS_OFF 

shadows disabled

RT_SHADOWS_ON 

shadows on, std. impl.

RT_SHADOWS_ON_REVERSE 

any-hit traversal reversal

Definition at line 118 of file TachyonOptiXShaders.h.

◆ RtTexFlags

enum RtTexFlags
Enumerator
RT_TEX_NONE 

default behavior

RT_TEX_COLORSPACE_LINEAR 

linear rgba, gamma 1.0

RT_TEX_COLORSPACE_sRGB 

Adobe sRGB (gamma 2.2)

RT_TEX_ALPHA 

enable cutout/transparency

Definition at line 214 of file TachyonOptiXShaders.h.

◆ RtTonemapMode

Enumerator
RT_TONEMAP_CLAMP 

only clamp the color values [0,1]

RT_TONEMAP_ACES 

ACES style approximation.

RT_TONEMAP_REINHARD 

Reinhard style, color.

RT_TONEMAP_REINHARD_EXT 

"Extended" Reinhard style, color

RT_TONEMAP_REINHARD_EXT_L 

"Extended" Reinhard style, luminance

RT_TONEMAP_COUNT 

total count of ray types

Definition at line 129 of file TachyonOptiXShaders.h.

Function Documentation

◆ __align__()

struct __align__ ( OPTIX_SBT_RECORD_ALIGNMENT  )

SBT record for a hitgroup program.

SBT record for a miss program.

SBT record for a raygen program.

SBT record for an exception program.

Definition at line 353 of file TachyonOptiXShaders.h.

◆ ACES_TMO()

static __device__ __inline__ float3 ACES_TMO ( float3  c)
static

Definition at line 1555 of file TachyonOptiXShaders.h.

References make_float3().

◆ convfloat2uint32()

static __host__ __device__ __inline__ uint convfloat2uint32 ( float2  f2)
static

Definition at line 1308 of file TachyonOptiXShaders.h.

Referenced by packNormal().

◆ convuint32float2()

static __host__ __device__ __inline__ float2 convuint32float2 ( uint  packed)
static

Definition at line 1315 of file TachyonOptiXShaders.h.

Referenced by unpackNormal().

◆ cross()

__host__ __device__ float3 cross ( const float3 &  a,
const float3 &  b 
)
inline

◆ dot() [1/2]

__host__ __device__ float dot ( const float3 &  a,
const float3 &  b 
)
inline

◆ dot() [2/2]

__host__ __device__ float dot ( const float4 &  a,
const float4 &  b 
)
inline

Definition at line 653 of file TachyonOptiXShaders.h.

◆ fabsf()

__host__ __device__ float3 fabsf ( const float3 &  a)
inline

◆ faceforward()

__host__ __device__ float3 faceforward ( const float3 &  n,
const float3 &  i,
const float3 &  nref 
)
inline

Ensure that an interpolated surface normal n faces in the same direction as dictated by a geometric normal nref, as seen from incident vector i.

Definition at line 724 of file TachyonOptiXShaders.h.

References dot().

Referenced by calc_ffworld_normal().

◆ fmaxf() [1/2]

__host__ __device__ float3 fmaxf ( const float3 &  a,
const float3 &  b 
)
inline

Definition at line 641 of file TachyonOptiXShaders.h.

References make_float3().

Referenced by fmaxf(), and main().

◆ fmaxf() [2/2]

__host__ __device__ float fmaxf ( const float3 &  a)
inline

Definition at line 645 of file TachyonOptiXShaders.h.

References fmaxf().

◆ goldenratioseq1d()

static __device__ __inline__ float goldenratioseq1d ( int  n)
static

Definition at line 908 of file TachyonOptiXShaders.h.

◆ goldenratioseq1d_incr()

static __device__ __inline__ void goldenratioseq1d_incr ( float &  x)
static

Definition at line 920 of file TachyonOptiXShaders.h.

◆ goldenratioseq2d()

static __device__ __inline__ void goldenratioseq2d ( int  n,
float2 &  xy 
)
static

Definition at line 930 of file TachyonOptiXShaders.h.

◆ goldenratioseq2d_incr()

static __device__ __inline__ void goldenratioseq2d_incr ( float2 &  xy)
static

Definition at line 947 of file TachyonOptiXShaders.h.

Referenced by jitter_disc2f_qrn().

◆ goldenratioseq3d()

static __device__ __inline__ void goldenratioseq3d ( int  n,
float3 &  xyz 
)
static

Definition at line 963 of file TachyonOptiXShaders.h.

◆ goldenratioseq3d_incr()

static __device__ __inline__ void goldenratioseq3d_incr ( float3 &  xyz)
static

Definition at line 984 of file TachyonOptiXShaders.h.

◆ goldenratioseq4d()

static __device__ __inline__ void goldenratioseq4d ( int  n,
float2 &  xy1,
float2 &  xy2 
)
static

Definition at line 1004 of file TachyonOptiXShaders.h.

◆ goldenratioseq4d_incr()

static __device__ __inline__ void goldenratioseq4d_incr ( float2 &  xy1,
float2 &  xy2 
)
static

Definition at line 1029 of file TachyonOptiXShaders.h.

◆ jitter_disc2f()

static __device__ __inline__ void jitter_disc2f ( unsigned int &  pval,
float2 &  xy,
float  radius 
)
static

◆ jitter_disc2f_qrn()

static __device__ __inline__ void jitter_disc2f_qrn ( float2 &  qrnxy,
float2 &  xy,
float  radius 
)
static

Definition at line 1101 of file TachyonOptiXShaders.h.

References goldenratioseq2d_incr(), and M_PIf.

◆ jitter_offset2f()

static __device__ __inline__ void jitter_offset2f ( unsigned int &  pval,
float2 &  xy 
)
static

◆ jitter_offset2f_qrn()

static __device__ __inline__ void jitter_offset2f_qrn ( float2  qrnxy,
float2 &  xy 
)
static

Definition at line 1093 of file TachyonOptiXShaders.h.

◆ length()

__host__ __device__ float length ( const float3 &  v)
inline

◆ linear_to_sRGB()

static __forceinline__ __device__ float4 linear_to_sRGB ( const float4 &  lin)
static

Definition at line 1428 of file TachyonOptiXShaders.h.

Referenced by accumulate_color().

◆ linear_to_sRGB_approx()

static __forceinline__ __device__ float4 linear_to_sRGB_approx ( const float4 &  linear)
static

Definition at line 1474 of file TachyonOptiXShaders.h.

References make_float3(), and make_float4().

◆ linear_to_sRGB_approx_20()

static __forceinline__ __device__ float4 linear_to_sRGB_approx_20 ( const float4 &  linear)
static

Definition at line 1500 of file TachyonOptiXShaders.h.

References make_float3(), and make_float4().

Referenced by accumulate_color().

◆ luminance()

static __device__ __inline__ float luminance ( float3  c)
static

Definition at line 1534 of file TachyonOptiXShaders.h.

References dot(), and make_float3().

Referenced by reinhard_extended_luminance_TMO(), and rescale_luminance().

◆ make_float3() [1/2]

__host__ __device__ float3 make_float3 ( const float  s)
inline

◆ make_float3() [2/2]

__host__ __device__ float3 make_float3 ( const float4 &  a)
inline

Definition at line 549 of file TachyonOptiXShaders.h.

References make_float3().

◆ make_float4() [1/2]

__host__ __device__ float4 make_float4 ( const float3 &  a,
const float &  b 
)
inline

◆ make_float4() [2/2]

__host__ __device__ float4 make_float4 ( const float  a)
inline

Definition at line 605 of file TachyonOptiXShaders.h.

References make_float4().

◆ msws_rng()

static __host__ __device__ __inline__ uint32_t msws_rng ( uint64_t &  x,
uint64_t &  w 
)
static

Definition at line 798 of file TachyonOptiXShaders.h.

◆ normalize()

__host__ __device__ float3 normalize ( const float3 &  v)
inline

◆ normalize_invlen()

__host__ __device__ float3 normalize_invlen ( const float3  v,
float &  invlen 
)
inline

Normalize input vector to unit length, and return the reciprocal of its original length.

Definition at line 691 of file TachyonOptiXShaders.h.

References dot().

◆ normalize_len()

__host__ __device__ float3 normalize_len ( const float3  v,
float &  l 
)
inline

Normalize input vector to unit length, and return its original length.

Definition at line 678 of file TachyonOptiXShaders.h.

References length().

Referenced by shader_template(), and sphere_intersect_hearn_baker().

◆ OctDecode()

template<int UNORM>
static __host__ __device__ __inline__ float3 OctDecode ( float2  projected)
static

Definition at line 1248 of file TachyonOptiXShaders.h.

References fabsf(), and make_float3().

◆ OctEncode()

template<int UNORM>
static __host__ __device__ __inline__ float2 OctEncode ( float3  n)
static

Definition at line 1216 of file TachyonOptiXShaders.h.

References fabsf().

◆ operator*() [1/9]

__host__ __device__ float2 operator* ( const float2 &  a,
const float2 &  b 
)
inline

Definition at line 520 of file TachyonOptiXShaders.h.

◆ operator*() [2/9]

__host__ __device__ float2 operator* ( const float  s,
const float2 &  a 
)
inline

Definition at line 524 of file TachyonOptiXShaders.h.

◆ operator*() [3/9]

__host__ __device__ float2 operator* ( const float2 &  a,
const float  s 
)
inline

Definition at line 528 of file TachyonOptiXShaders.h.

◆ operator*() [4/9]

__host__ __device__ float3 operator* ( const float3 &  a,
const float3 &  b 
)
inline

Definition at line 573 of file TachyonOptiXShaders.h.

References make_float3().

◆ operator*() [5/9]

__host__ __device__ float3 operator* ( float  s,
const float3 &  a 
)
inline

Definition at line 577 of file TachyonOptiXShaders.h.

References make_float3().

◆ operator*() [6/9]

__host__ __device__ float3 operator* ( const float3 &  a,
const float  s 
)
inline

Definition at line 581 of file TachyonOptiXShaders.h.

References make_float3().

◆ operator*() [7/9]

__host__ __device__ float4 operator* ( const float4 &  a,
const float  s 
)
inline

Definition at line 613 of file TachyonOptiXShaders.h.

References make_float4().

◆ operator*() [8/9]

__host__ __device__ float3 operator* ( char4  a,
const float  s 
)
inline

Definition at line 625 of file TachyonOptiXShaders.h.

References make_float3().

◆ operator*() [9/9]

__host__ __device__ float3 operator* ( uchar4  a,
const float  s 
)
inline

Definition at line 629 of file TachyonOptiXShaders.h.

References make_float3().

◆ operator*=() [1/4]

__host__ __device__ void operator*= ( float2 &  a,
const float  s 
)
inline

Definition at line 532 of file TachyonOptiXShaders.h.

◆ operator*=() [2/4]

__host__ __device__ void operator*= ( float3 &  a,
const float  s 
)
inline

Definition at line 585 of file TachyonOptiXShaders.h.

◆ operator*=() [3/4]

__host__ __device__ void operator*= ( float3 &  a,
const float3 &  b 
)
inline

Definition at line 589 of file TachyonOptiXShaders.h.

◆ operator*=() [4/4]

__host__ __device__ void operator*= ( float4 &  a,
const float &  b 
)
inline

Definition at line 617 of file TachyonOptiXShaders.h.

◆ operator+() [1/4]

__host__ __device__ float2 operator+ ( const float2 &  a,
const float2 &  b 
)
inline

Definition at line 500 of file TachyonOptiXShaders.h.

◆ operator+() [2/4]

__host__ __device__ float2 operator+ ( const float2 &  a,
const float  s 
)
inline

Definition at line 504 of file TachyonOptiXShaders.h.

◆ operator+() [3/4]

__host__ __device__ float3 operator+ ( float3  a,
float3  b 
)
inline

Definition at line 553 of file TachyonOptiXShaders.h.

References make_float3().

◆ operator+() [4/4]

__host__ __device__ float3 operator+ ( const float3 &  a,
const float &  b 
)
inline

Definition at line 569 of file TachyonOptiXShaders.h.

References make_float3().

◆ operator+=() [1/2]

__host__ __device__ void operator+= ( float3 &  a,
const float3 &  b 
)
inline

Definition at line 565 of file TachyonOptiXShaders.h.

◆ operator+=() [2/2]

__host__ __device__ void operator+= ( float4 &  a,
const float4 &  b 
)
inline

Definition at line 609 of file TachyonOptiXShaders.h.

◆ operator-() [1/5]

__host__ __device__ float2 operator- ( const float2 &  a,
const float2 &  b 
)
inline

Definition at line 508 of file TachyonOptiXShaders.h.

◆ operator-() [2/5]

__host__ __device__ float2 operator- ( const float2 &  a,
const float  s 
)
inline

Definition at line 512 of file TachyonOptiXShaders.h.

◆ operator-() [3/5]

__host__ __device__ float2 operator- ( const float  s,
const float2 &  a 
)
inline

Definition at line 516 of file TachyonOptiXShaders.h.

◆ operator-() [4/5]

__host__ __device__ float3 operator- ( const float3 &  a,
const float3 &  b 
)
inline

Definition at line 557 of file TachyonOptiXShaders.h.

References make_float3().

◆ operator-() [5/5]

__host__ __device__ float3 operator- ( const float3 &  a)
inline

Definition at line 561 of file TachyonOptiXShaders.h.

References make_float3().

◆ operator/() [1/2]

__host__ __device__ float2 operator/ ( const float  s,
const float2 &  a 
)
inline

Definition at line 536 of file TachyonOptiXShaders.h.

◆ operator/() [2/2]

__host__ __device__ float3 operator/ ( const float3 &  a,
const float3 &  b 
)
inline

Definition at line 593 of file TachyonOptiXShaders.h.

References make_float3().

◆ packNormal()

static __host__ __device__ __inline__ uint packNormal ( const float3 &  normal)
static

Definition at line 1332 of file TachyonOptiXShaders.h.

References convfloat2uint32().

◆ qnd_rng()

static __host__ __device__ __inline__ uint32_t qnd_rng ( uint32_t &  idum)
static

Definition at line 772 of file TachyonOptiXShaders.h.

Referenced by jitter_disc2f(), and jitter_offset2f().

◆ reflect()

__host__ __device__ float3 reflect ( const float3 &  i,
const float3 &  n 
)
inline

calculate reflection direction from incident direction i, and surface normal n.

Definition at line 717 of file TachyonOptiXShaders.h.

References dot().

Referenced by shader_template().

◆ reinhard_extended_luminance_TMO()

static __device__ __inline__ float3 reinhard_extended_luminance_TMO ( float3  c,
float  maxL 
)
static

Definition at line 1589 of file TachyonOptiXShaders.h.

References luminance(), and rescale_luminance().

◆ reinhard_extended_TMO()

static __device__ __inline__ float3 reinhard_extended_TMO ( float3  c,
float  maxwhite 
)
static

Definition at line 1578 of file TachyonOptiXShaders.h.

References make_float3().

◆ reinhard_TMO()

static __device__ __inline__ float3 reinhard_TMO ( float3  c)
static

Definition at line 1568 of file TachyonOptiXShaders.h.

References make_float3().

◆ rescale_luminance()

static __device__ __inline__ float3 rescale_luminance ( float3  c,
float  newluminance 
)
static

Definition at line 1543 of file TachyonOptiXShaders.h.

References luminance().

Referenced by reinhard_extended_luminance_TMO().

◆ squares_rng()

template<unsigned int ROUNDS>
static __host__ __device__ __inline__ uint32_t squares_rng ( uint64_t  counter,
uint64_t  key 
)
static

Definition at line 830 of file TachyonOptiXShaders.h.

◆ sRGB_to_linear()

static __forceinline__ __device__ float4 sRGB_to_linear ( const float4 &  rgba)
static

Definition at line 1398 of file TachyonOptiXShaders.h.

◆ sRGB_to_linear_approx()

static __forceinline__ __device__ float4 sRGB_to_linear_approx ( const float4 &  rgba)
static

Definition at line 1461 of file TachyonOptiXShaders.h.

References make_float3(), and make_float4().

◆ sRGB_to_linear_approx_20()

static __forceinline__ __device__ float4 sRGB_to_linear_approx_20 ( const float4 &  rgba)
static

Definition at line 1490 of file TachyonOptiXShaders.h.

References make_float3(), and make_float4().

◆ tea()

template<unsigned int ROUNDS>
static __host__ __device__ __inline__ unsigned int tea ( uint32_t  val0,
uint32_t  val1 
)
static

Definition at line 876 of file TachyonOptiXShaders.h.

◆ unpackNormal()

static __host__ __device__ __inline__ float3 unpackNormal ( uint  packed)
static

Definition at line 1337 of file TachyonOptiXShaders.h.

References convuint32float2().

Referenced by get_shadevars_trimesh().