Opticks replaces Geant4 optical photon simulation with an equivalent implementation that benefits from state-of-the-art GPU ray tracing from NVIDIA OptiX. All optically relevant aspects of Geant4 context must be translated+copied to GPU:
- geometry : solids, structure, material+surface properties
- generation : Cerenkov + Scintillation (using Gensteps from Geant4)
- propagation : Rayleigh scattering, absorption, reemission, boundary
- transformative performance benefits >1000x Geant4
Fast Render => Fast Simulation (same ray tracing bottleneck)
- Optimization : vary included geometry, measure render times
- look for bottleneck geometries
#!/bin/bash # logging control export X4PhysicalVolume=INFO export GMeshLib=INFO # alt geometry mode export RichTbLHCbR1SphMirror_mode=1 export RichTbLHCbR1FlatMirror_mode=1 TimeTest
cd ~/opticks git pull oo # update builds opticks (not OptiX 7 build)
cd ~/opticks/CSG_GGeo # OR "cg" shortcut ./run.sh
cd ~/opticks/CSGOptiX oo # update opticks build opticks-build7 # OR "b7" shortcut (builds only CSGOptiX) ;: will need to set some envvars to find OptiX7 install
All following renders use cxr_view.sh script and CSGOptiXRenderTest binary
NVIDIA OptiX 7 build and run:
cd ~/opticks/CSGOptiX ;: OR "cx" shortcut function opticks-build7 ;: OR "b7" shortcut function MOI=WorldBox ./cxr_view.sh ;: creates .jpg and .json files
OptiX launch time at bottom left of render image and in sidecar .json
EYE, LOOK, TMIN are in units of the extent of target geometry
EYE=1,-2.2,0 MOI=RichTbR1MagShBox ./cxr_view.sh
EYE=0,1,0 MOI=RichTbR1MagShBox TMIN=0.5 ./cxr_view.sh
circular "window" is due to TMIN=0.5 sphere cutting, in perspective projection
EYE=0,-1,0 MOI=RichTbR1MagShBox TMIN=0.5 ./cxr_view.sh
Vertical black line artifact (appears when view precisely from -Y)
EYE=0,-2.2,0 MOI=RichTbR1MagShBox ./cxr_view.sh
EYE=1,0,0 MOI=RichTbR1MagShBox ./cxr_view.sh
TMIN=0.4 default cuts into the boxes
EYE=1,0,0 LOOK=0,0.1,0.1 MOI=WorldBox CAM=1 ZOOM=10 TMIN=0.96 ./cxr_view.sh
CAM=1 TMIN=0.96 plane cutaway of side of box (plane as CAM=1 orthographic)
MOI=R1PmtMasterBox EYE=10,20,0 ./cxr_view.sh