fluka raytracer 04/09

18
Fluka Raytracer Implementing a Raytracer inside FLUKA David Siñuela Pastor <[email protected]>

Upload: siu

Post on 30-Jun-2015

1.314 views

Category:

Technology


0 download

DESCRIPTION

Presentation of the FLUKA Raytracer. It is finished now ;)

TRANSCRIPT

Page 1: FLUKA Raytracer 04/09

Fluka Raytracer

Implementing a Raytracer inside FLUKA

David Siñuela Pastor<[email protected]>

Page 2: FLUKA Raytracer 04/09

Fluka Raytracer - Outline

● Why?● Alternative solutions● How raytracing works● Implementation in FLUKA● Problem solving● Samples● Time schedule● Future improvements

Page 3: FLUKA Raytracer 04/09

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

Page 4: FLUKA Raytracer 04/09

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

Page 5: FLUKA Raytracer 04/09

Fluka Raytracer – AlternativesSpeed Correction Dependencies Features

OpenGL viewport in Flair

●Initial conversion &syncrhonization●Realtime visualization

Lots of inaccuracies

●Opengl libraries●External math. libraries

●Hardware?

✔Realtime✔ Interactive✔User friendly

External RT.With PovRay

Internal FLUKA RT.

Page 6: FLUKA Raytracer 04/09

Fluka Raytracer – AlternativesSpeed Correction Dependencies Features

OpenGL viewport in Flair

●Initial conversion &syncrhonization●Realtime visualization

Lots of inaccuracies

●Opengl libraries●External math. libraries

●Hardware?

✔Realtime✔ Interactive✔User friendly

External RT.With PovRay

●Slow Some inaccuracies

●PovRay ✔PovRay is a well-known raytracer

✔Optimized✔Community

Internal FLUKA RT.

Page 7: FLUKA Raytracer 04/09

Fluka Raytracer – AlternativesSpeed Correction Dependencies Features

OpenGL viewport in Flair

●Initial conversion &syncrhonization●Realtime visualization

Lots of inaccuracies

●Opengl libraries●External math. libraries

●Hardware?

✔Realtime✔ Interactive✔User friendly

External RT.With PovRay

●Slow Some inaccuracies

●PovRay ✔PovRay is a well-known raytracer

✔Optimized✔Community

Internal FLUKA RT.

●Slow Same geometry as the simulation

●No external needs*image conversion

✔Accuracy✔Lattices✔Built-in

Page 8: FLUKA Raytracer 04/09

Fluka Raytracer – How it works?

General raytracing algorithm(Image by Wikipedia)

Page 9: FLUKA Raytracer 04/09

Fluka Raytracer – Implementation

● Input cards● CAMERA● LIGHT● MATERIAL PROPERTIES

● FLUKA functions used● GEOREG: Region number● GEOFAR: Intersection detection & distance● GEONOR: Compute normals

Page 10: FLUKA Raytracer 04/09

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

Page 11: FLUKA Raytracer 04/09

Fluka Raytracer – Samples

Page 12: FLUKA Raytracer 04/09

Fluka Raytracer – Samples

Sample input fileFeatures:● 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

Page 13: FLUKA Raytracer 04/09

ITER GeometryGeometry by Elias Lebbos

Page 14: FLUKA Raytracer 04/09

ITER Geometry – Adaptative sampling heuristic for detail detectionGeometry by Elias Lebbos

Page 15: FLUKA Raytracer 04/09

ITER Geometry –Detail with shadowsGeometry by Elias Lebbos

Page 16: FLUKA Raytracer 04/09

Fluka Raytracer – Schedule

● Currently converting from C to FORTRAN● We can have a working code in about 1 or 2

months

Page 17: FLUKA Raytracer 04/09

Fluka Raytracer – Future improvements

● Textures (procedural or images)● Implement spotlights● Performance optimizations● Orthogonal projection● Show USRBIN data as texture● Plane cut of the scene?

Page 18: FLUKA Raytracer 04/09

Fluka Raytracer

Thank youDavid Siñuela Pastor <[email protected]>