2. Fluka Raytracer - Outline
● Why?
● Alternative solutions
● How raytracing works
● Implementation in FLUKA
● Problem solving
● Samples
● Time schedule
● Future improvements
3. Fluka Raytracer - Why?
● The current geometry is complex to visualize
● External visualization tools with separate
development
● FLUKA only plots 2 dimensional plane cuts
● Lack of interactivity
4. Fluka Raytracer – Alternative
Solutions
● OpenGL: Realtime viewport of the geometry
mesh in Flair
● Raytracing
● External: Using Povray as renderer
● Internal: Using the FLUKA geometry engine
5. Fluka Raytracer – Alternatives
Speed Correction Dependencies Features
OpenGL ●Initial conversion Lots of ● Opengl libraries ✔ Realtime
viewport in &syncrhonization inaccuracies ● External math. ✔ Interactive
Flair ●Realtime libraries ✔ User friendly
visualization ● Hardware?
External RT.
With PovRay
Internal
FLUKA RT.
6. Fluka Raytracer – Alternatives
Speed Correction Dependencies Features
OpenGL ●Initial conversion Lots of ● Opengl libraries ✔ Realtime
viewport in &syncrhonization inaccuracies ● External math. ✔ Interactive
Flair ●Realtime libraries ✔ User friendly
visualization ● Hardware?
External RT. Slow
● Some ● PovRay ✔ PovRay is a
With PovRay inaccuracies well-known
raytracer
✔ Optimized
✔ Community
Internal
FLUKA RT.
7. Fluka Raytracer – Alternatives
Speed Correction Dependencies Features
OpenGL ●Initial conversion Lots of ● Opengl libraries ✔ Realtime
viewport in &syncrhonization inaccuracies ● External math. ✔ Interactive
Flair ●Realtime libraries ✔ User friendly
visualization ● Hardware?
External RT. Slow
● Some ● PovRay ✔ PovRay is a
With PovRay inaccuracies well-known
raytracer
✔ Optimized
✔ Community
Internal Slow
● Same geometry ● No external needs ✔ Accuracy
FLUKA RT. as the simulation *image conversion ✔ Lattices
✔ Built-in
8. Fluka Raytracer – How it works?
General raytracing algorithm
(Image by Wikipedia)
9. Fluka Raytracer – Implementation
● Input cards
● CAMERA
● LIGHT
● MATERIAL PROPERTIES
● FLUKA functions used
● GEOREG: Region number
● GEOFAR: Intersection detection & distance
● GEONOR: Compute normals
10. Fluka Raytracer – Problem solving
● FORTRAN 77: doesn't allow recurrency
● Implementation of a binary tree in a fixed size array
– Maximum depth level in subrays
● Performance: Raytracing is slooow
● Use of FLUKA geometry engine (optimizations)
● Adaptative Sampling with heuristic
– Estimate the complexity of the scene on each point and
compare it to neightbours
● Caching as much as possible
12. Fluka Raytracer – Samples
Sample input file
Features:
● Camera model
● Material ambient, diffuse and specular colors
● Material transparency, reflectivity and fuzziness
● Index of refraction of materials
● Diffuse and specular illumination
● Shadow casting with transparent shadows
● Light colors
● Adaptative antialiasing