This application allows displaying real-time CSG Scene loaded from .json
file. The user can rotate/move the camera to see the scene from different angles and change the direction of a directional light.
CSG (Constructive Solid Geometry) allows a modeler to create a complex surface or object by using Boolean operators (union, intersection and difference) to combine simpler objects (wikipedia).
The CSG raycasting algorithm has been implemented using CUDA and is based on the Spatially Efficient Tree Layout for GPU Ray-tracing of Constructive Solid Geometry Scenes paper by D.Y. Ulyanov, D.K. Bogolepov and V.E. Turlapov.
CSG off | CSG on |
---|---|
![]() |
![]() |
The application |
---|
![]() |
- The json file format is a little bit akward for now, since it is array representation of a binary tree.
- There is only sphere support implemented.
- There is no editor.
- To control the direction of light incidence, use the Polar/Azim angle parameters accessible in the Controls window,
- To enter camera mode, hold down the right mouse button,
- In camera mode, you can adjust its direction using the mouse,
- In camera mode, you can change its position in space using the
W
,S
,A
,D
,Q
, andE
keys, - To load sample trees, use the Load Scene button,
- Sample .json files are located in the res folder.
You need NVIDIA CUDA GPU to run the application. This application has been tested on the following GPU's:
GPU | Memory | Compute Capability |
---|---|---|
NVIDIA GTX 1650Ti | 4GB | 7.5 |
NVIDIA GTX 1060 | 3GB | 6.1 |
NVIDIA GTX 1070 | 8GB | 6.1 |
In order to compile the project you need to download and install NVIDIA CUDA Toolkit and CMake first.
- Clone the repository to the desired location
git clone https://github.com/migoox/boids-simulation
, - Navigate to the cloned directory and run
cmake .
, - Run
make
.
- Clone the repository to the desired location
git clone https://github.com/migoox/boids-simulation
, - Navigate to the cloned directory and run
cmake .
, - Open
boids_simulation.sln
using Visual Studio, - Set
boids_simulation
as the Startup Project (right click onboids_simulation
and chooseSet as Startup Project
), - Compile using Debug/Release mode.