I built G4 11.0.2 enabling the RayTracerX visualization; here’s the configuration taken from the output of ccmake:
I guess it’s ok since GEANT4_USE_RAYTRACER_X11 is ON. The installed library seems to effectively contain the RayTracerX stuff:
$ nm /home/mori/software/install/GEANT4_11.0.2/lib/libG4RayTracer.so | grep RayTracerX
6:0000000000022390 T G4RayTracerXScannerWaitForNotify
42:0000000000013aa0 t _GLOBAL__sub_I_G4RayTracerX.cc
43:0000000000013b70 t _GLOBAL__sub_I_G4RayTracerXViewer.cc
169:0000000000021f30 T _ZN12G4RayTracerX12CreateViewerER15G4VSceneHandlerRK8G4String
170:0000000000012cbc t _ZN12G4RayTracerX12CreateViewerER15G4VSceneHandlerRK8G4String.cold
171:0000000000021ef0 T _ZN12G4RayTracerX18CreateSceneHandlerERK8G4String
172:0000000000012ca6 t _ZN12G4RayTracerX18CreateSceneHandlerERK8G4String.cold
173:0000000000022010 T _ZN12G4RayTracerXC1Ev
. . .
Could you try rebuilding your executable and check that the compile commands include the -DG4VIS_USE_RAYTRACERX flag please? If you’re using G4VisExecutive, that flag is needed to enable the use of RayTracerX. The flag should be added automatically by CMake etc, but it’s worth checking as the libraries are clearly built with RayTracerX support.
I didn’t have the vis_raytracer_x11 component specified in the optional components list of find_package, adding it and rebuilding my application the error vanished and the RayTracerX window shows as expected. Thanks @bmorgan !
my problem is that I’d like to render the detector with RayTracer(X) since OGL produces this kind of artifacts. These artifacts are not visible in the OGL image posted above, but become visible when incrteasing the zoom level to very high values.
“Garbage” was not relative to the OGL image but to the RayTracer one, which is a flat gray field. But I understand that it could be the outcome of the geometry being a tessellated solid imported from GDML, right? I didn’t imagine RayTracer had problems with that since I read that it “can render any geometry that Geant4 can handle” (see this presentation, slide 60).