Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:02

0001 #pragma once
0002 
0003 /**
0004 Params.h
0005 ===========
0006 
0007 * CPU side params instanciated in CSGOptiX::CSGOptiX and populated by CSGOptiX::init methods
0008 
0009 **/
0010 
0011 #include <optix.h>
0012 // TODO: avoid need for optix.h just for OptixTraversableHandle which is "unsigned long long" typedef
0013 
0014 #include <vector_types.h>
0015 
0016 #ifndef __CUDACC__
0017 #include <glm/glm.hpp>
0018 #include <string>
0019 #endif
0020 
0021 struct CSGNode ;
0022 struct qat4 ;
0023 struct quad4 ;
0024 struct quad6 ;
0025 struct qsim ;
0026 struct sevent ;
0027 
0028 
0029 struct Params
0030 {
0031     // render/simtrace/simulate switch
0032     int32_t    raygenmode ;
0033 
0034     // geometry : from Foundry
0035     // notice no CSGPrim here as that is just a sequence of CSGNode handled by
0036     CSGNode*   node ;
0037     float4*    plan ;
0038     qat4*      tran ;
0039     qat4*      itra ;
0040 
0041 #if OPTIX_VERSION < 70000
0042     void*                   handle ;
0043 #else
0044     OptixTraversableHandle  handle ;
0045 #endif
0046 
0047     // frame rendering
0048     uchar4*    pixels ;
0049     float4*    isect ;
0050     quad4*     fphoton ;
0051 
0052     // render control
0053     uint32_t   width;
0054     uint32_t   height;
0055     uint32_t   depth;
0056     uint32_t   cameratype ;
0057 
0058     int32_t    traceyflip ;
0059     int32_t    rendertype ;
0060     int32_t    origin_x;
0061     int32_t    origin_y;
0062 
0063     float3     eye;
0064     float3     U ;
0065     float3     V ;
0066     float3     W ;
0067     float3     WNORM ;
0068     float      tmin ;
0069 
0070     float      tmin0 ;
0071     unsigned   PropagateEpsilon0Mask ;   // default from SEventConfig TO,CK,SI,SC,RE
0072     float      PropagateRefineDistance ;
0073     bool       PropagateRefine ;
0074 
0075     float      tmax ;
0076     float4     ZPROJ ;
0077 
0078     unsigned   vizmask ;
0079 
0080     float4     center_extent ;
0081     uint4      cegs ;
0082 
0083     // simulation
0084     qsim*        sim ;
0085     sevent*      evt ;         // HMM: inside sim too ?
0086     int  event_index ;
0087     unsigned long long  photon_slot_offset ;   // for multi-launch to match single-launch
0088     float max_time ;           // ns
0089 
0090 
0091     // debug dumping : set from PIDXYZ envvar by CSGOptiX::initPIDXYZ default -1:-1:-1
0092     uint3     pidxyz ;
0093 
0094 
0095 #ifndef __CUDACC__
0096     static Params* d_param ;
0097 
0098     Params(int raygenmode, unsigned width, unsigned height, unsigned depth);
0099     void device_alloc();
0100     void upload();
0101 
0102     std::string desc() const ;
0103     std::string detail() const ;
0104 
0105     void setView(const glm::vec3& eye_,
0106                  const glm::vec3& U_,
0107                  const glm::vec3& V_,
0108                  const glm::vec3& W_,
0109                  const glm::vec3& WNORM_ );
0110 
0111     void setCamera(float tmin_, float tmax_, unsigned cameratype_, int traceyflip_, int rendertype_, const glm::vec4& ZPROJ_ ) ;
0112     void setRaygenMode(int raygenmode_ );
0113     void setSize(unsigned width_, unsigned height_, unsigned depth_ );
0114     void setVizmask(unsigned vizmask_);
0115 
0116     void setCenterExtent(float x, float y, float z, float w);  // used for "simulation" planar rendering
0117     void setPIDXYZ(unsigned x, unsigned y, unsigned z);
0118     void set_photon_slot_offset(unsigned long long _photon_slot_offset);
0119 
0120 #endif
0121 
0122 };
0123