Geeks3D
smallpt: Global Illumination in 99 lines of C++
Kevin Beason / smallpt is a global illumination renderer. It is 99 lines of C++, is open source, and renders the above scene using unbiased Monte Carlo path tracing (click for full size). Features Global illumination via unbiased Monte Carlo path tracing 99 lines of 72-column (or less) open source C++ code Multi-threading using OpenMP Soft shadows from diffuse luminaire Specular, Diffuse, and Glass BRDFs Antialiasing via super-sampling with importance-sampled tent distribution, and 2x2 subpixels Ray-sphere intersection Modified Cornell box scene description Cosine importance sampling of the hemisphere for diffuse reflection Russian roulette for path termination Russian roulette and splitting for selecting reflection and/or refraction for glass BRDF With minor changes compiles to a 4 KB binary (less than 4096 bytes) Added 11/11/2010: Modifications including explicit light sampling and non-branching ray tree. Source Other formats Usage Details More Scenes License Modifications Ports
Lattice Effect
When I initially viewed the 256-byte intro Puls by Řrřola that took first place at Riverwash 2009, I think I shared a common sentiment with many other developers out there: That’s impossible! Řrřola was kind enough to release his x86 assembly language source code, revealing that the effect is computed without the aid of 3D libraries or hardware acceleration. It’s mind-blowing. Check out the start of the source: org 100h ; assume ah=bx=0 cx=255 sp=di=-2 si=100h mov al,13h ;<(byte)[100h]>>8 = 0.6875 push bx ; (word)[100h]>>16 = 0.0769 mov dx,3C8h ; (float)[100h] = -0.0008052 int 10h The interrupt call changes the video mode to 13h (320×200 resolution with 256 colors). 3c8h is one of the ports involves in changing the palette, which is used later. Simple enough so far—no wait! Which outputs: Push BX maps to 53. The compression tricks certainly don’t end there, but I really wasn’t that interested in how Řrřola packed the effect into 256 bytes. The code is obfuscated, but well commented.
Spuify
Related:
Related: