Skip to main content
gamedev.net
🔒 Locked

Software rendering tutorials/examples

Started by vinnyvicious Feb 7, 2014 at 8:36 PM 19 replies 13.5k views
Original Post
vinnyvicious
vinnyvicious

I've been looking around for a few software rendering projects: simple engines, tutorials or even some examples. I managed to found this highly portable, but outdated, engine called Yeti3D: http://sourceforge.net/projects/yeti3dpro/

I'm looking for modern approaches or alternatives, or even tutorials on this topic. Any tips? :)

spinningcube
spinningcube

Not even a book? sad.png

Your best bet is sifting through the source of some old school demo. Might not be the best structured code but gives ideas about clipping etc. The best of class parallel rendering systems that rival or give hardware renderers a good fight is the half-space, grid or tile-based (threaded), a la Nick Capens pixel drawers (don't know what to call them really as they don't do scan line rasterisation, really a bastard version of ray casting). I think his system was bought up by some VCs and later commercialised?

PS - (speculative) His web history has been wiped clean not to give too many hints about the tech behind. I guess due to the patenting or other issues.

PS2 - I might be right after all :-) http://transgaming.com/swiftshader

Glass_Knife
Glass_Knife

The cheap version - http://www.scratchapixel.com/

This website has lots of information about writing your own software renderer. Not all the lessons are available, but the ones that are can really help.

The expensive version - http://www.pbrt.org/

http://www.amazon.com/Physically-Based-Rendering-Second-Edition/dp/0123750792

The book walks you through the source code for the rendering engine explaining how everything works. By downloading the code and working through it with the book you should be able to write your own rendering engine (provided you understand all the math).

mark ds
mark ds

I've been looking around for a few software rendering projects:

Why? Do you think it'll render faster?

vinnyvicious
vinnyvicious

I've been looking around for a few software rendering projects:

Why? Do you think it'll render faster?

Obviously, no. It's a curiosity thing. I'm a big fan of Quake 1's software renderer and wanted to implement something of my own.

vinnyvicious
vinnyvicious

Amazing link, thanks @JohnnyCode

rouncer
rouncer

ok. you can make your whole game greyscale, then have a material id, and then its just colour operations on r g and b, and i bet you all the latest crazo games do it.

Geri
Geri

i dont suggest to study these outdated technologies like the q2. those optimization tricks will not work any more, and keep in mind that we have superscalar cpu-s now. also remember that you will need an agressively multithreaded code to achieve fast speed with nice quality. just write your renderer, and if you find a part that is too slow, then meditate/study/doodle that practicular problem.

http://geri.comeze.com/darktower/

my last (software rendered) free game, done for a game competition. it uses ray tracing, runs playable in 320x160.

spinningcube
spinningcube

Fabian Giesen also touches upon the same technique that I mentioned in my first post, that is rendering with half spaces. It's the approach best suited for a software renderer and is used in top of the class software driver implementations. To approach software rendering today with a scan line rasteriser is fun as a hobby project but will lead nowhere as the real speed comes with multi-threading and therefore from a binning or tiled based approach.

JohnnyCode
JohnnyCode

software rasterizer combined with gpu availability check is the best engine I can think of. And also, you can make software rasterizing into gpu SIMD, though bypassing general gl/dx vendor tweeks will mostly lead to lesser performance, it is possible to (out)perform it- or more correctly, have better operatibility available. Imagine you could alter triangle rasterization ruiles, so that you will process also pixels with its center out of edge but partialy touching edge, then you could do ++ best antialiasing on any surface or, particular draw call. It is for sure very worthy to implement rasterizing on software, wheather for learning, or for possible usage in the future.

Geri
Geri

JohnnyCode: i disaggree. maybe in *theory*, you can get the biggest performance, but using gpgpu would so much limit the number of compatible systems and would make so many extra work and compatibility issue, it would basically double the required work, and would make the whole thing almost unsellable, becouse there is a limited number of users with proper computers to run it. maybe such minor works like antialiasing, and other various filters effectively can done with gpu in this case, but that would not significantly boost the rendering ,,pipeline'', and should be maked with the possibility to disable it and use the software fallback.

vinnyvicious
vinnyvicious

Bumping up to see more interest links or projects with software renderers!

thissideup
thissideup

There is a tutorial series by David Rousset:
http://blogs.msdn.com/b/davrous/archive/2013/06/13/tutorial-series-learning-how-to-write-a-3d-soft-engine-from-scratch-in-c-typescript-or-javascript.aspx

When it comes to ray-tracing (and since PBRT was already mentioned) I would suggest you have a look at Ray Tracing from the Ground Up by Kevin Suffern as, in my opinion, more beginner-friendly.

vinnyvicious
vinnyvicious

Those series are very well written and the examples are very clear. Thanks for the link! I just wish they had C++ examples included.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.