Uwaga! Informacje na tej stronie mają ponad 5 lat. Nadal je udostępniam, ale prawdopodobnie nie odzwierciedlają one mojej aktualnej wiedzy ani przekonań.
Wed 19 Aug2009
As some of you are interested in seeing source code of my 2D Software Renderer, I'll fullfill this request, although I don't think there is anything special about this code. Here is the file:
SoftRender01.zip
and here is a brief description of this project:
In the FontLoad files you can find simple example of using FreeType library.
In the ImgLoad files you can find simple example of using DevIL library.
In StdAfx and TokenWriter files you can find some of my code that is going to be included in upcoming version of my CommonLib.
Files VariableManager, VariableTypes and MathVariableTypes contain quite smart "property" system (or maybe even reflection?) with text and binary serialization that I'm very satisfied with.
And finally, Renderer itself just contains some of elementary CG algorithms implemented, so you better study Wikipedia and other sources for algorithms such as Line clipping (I've used Liang-Barsky method), Line drawing algorithm (I've used Bresenham method) etc.
BTW, I've started coding a raytracer.
Of course the first primitive I support is a sphere and first effects I've coded
are shadows and reflections.
Ray tracing is not magic. It's just like "foreach pixel, foreach object, render", while rasterization is the opposite: "foreach object, foreach pixel, render". But It's quite fascinating that raytracer suppors directly some of effects that require special preprocessing in standard rasterization (like preparing shadow map and enviromental map in case of my effects).