C++ NBody Fluid Simulation Experiment

Started by
3 comments, last by Finalspace 6 years, 9 months ago

Just for fun i have written a simple C++ 2D nbody fluid simulation in 4 different programming styles - just to see the differences in speed and maintainability.

Its like my "Fluid Sandbox" program i have written in the past, but 2D and without rigidbody interaction - maybe that will come later.

It would be great if you can compile and run it and check the results for yourself.

 

There is a built-in benchmark recording and rendering, so you can compare all 4 demos with your own system.

 

It was build in visual studio 2015/17 but it may compile on other compilers as well - because it uses simple syntax and default libraries, like glut, glew and opengl.

 

Feedback is welcome -> see the associated feedback thread.

 

You can find the project source here:

https://github.com/f1nalspace/nbodysimulation_experiment

 

Also if you just want to start it up, here is the executable:

http://root.xenorate.com/final/gamedev/nbodysimulation_experiment_v1.1.zip

 

Greetings,

Final

 

nbody_shot1.png

nbody_shot2.png

Advertisement

I implemented a real benchmarking functionality, including basic charting.

Source is updated.

Benchmarks supports tick-labels as well and uses simulation time instead of frametime for reference comparing.

I commited a intense update with a full rewrite of the rendering and font system.

I implemented a command-buffer like system, so rendering is independent from the graphics api now, which is great.

Also i use STB_truetype to load and calculate fonts, so i get much better looking fonts and can finally adjust the size as well.

 

But it seems i got a bug in regards using glDrawElements, crashing the rendering when glTexcoordPointer is used. Therefore i just draw the elements by byself and IFDEF´ed out the glDrawElements part.

This topic is closed to new replies.

Advertisement