Interested in advertising on Derpibooru? Click here for information!
![Play Battle Gem Ponies on Mobile or PC](https://derpicdn.net/spns/2024/11/2/b0a0fb46-9905-11ef-8176-02420a030003.gif)
Help fund the $15 daily operational cost of Derpibooru - support us financially!
Description
Since I suck at art I decided instead to write a reasonably simple ray tracer to “draw” for me since it can shade much better than I can. Unfortunately this image still seems like the expected example of “programmer art” as it is likely the crappiest image of a pony I could’ve produced, though to be fair it’s not easy to make a pony entirely out of hand placed spheres.
This was all done in C++17 with exactly 3476 characters of code, though the main goal was to fit it nicely into a formatted rectangle which can be seen at the source which is here. The algorithm used is a simpled Whitted-style ray tracer to model light transport using a standard physically based BRDF to model the shading all done in HDR, tonemapped with garbage reinhard tonemapping.
If you wish to compile this, I personally used Visual Studio 2017, though it should work on any regular C++17 compiler (though I may have been relying on Visual Studio’s own include structure a bit). If you do run it, do note that it does take quite some time to process as it renders at 1920x1080 with 16 jittered samples per pixel for anti-aliasing with a maximum of 10 reflection bounces per ray. Finally, the program will output to a 24 bit per pixel binary (P6) PPM file named
If you have any questions feel free to ask.
This was all done in C++17 with exactly 3476 characters of code, though the main goal was to fit it nicely into a formatted rectangle which can be seen at the source which is here. The algorithm used is a simpled Whitted-style ray tracer to model light transport using a standard physically based BRDF to model the shading all done in HDR, tonemapped with garbage reinhard tonemapping.
If you wish to compile this, I personally used Visual Studio 2017, though it should work on any regular C++17 compiler (though I may have been relying on Visual Studio’s own include structure a bit). If you do run it, do note that it does take quite some time to process as it renders at 1920x1080 with 16 jittered samples per pixel for anti-aliasing with a maximum of 10 reflection bounces per ray. Finally, the program will output to a 24 bit per pixel binary (P6) PPM file named
a.ppm
, so you’ll likely need a PPM viewer to actually view it.If you have any questions feel free to ask.
Yeh video games tend to use spheres or other basic shapes a lot for things like collisions as some sort of custom mesh collision (concave makes it impossible even) is quite expensive even with a broad phase and the user wont really notice if spheres overestimate something a little usually in just a generic non physics-centric game.