Software rendering - how? where to learn from?
#1
Posted 26 December 2008 - 12:49 AM
I've checked the DevMaster article but I would like to read it in more newbie friendly way. Maybe my google-fu is weak since I haven't had much results regarding this. Maybe I am 15 years late? :D
Any books, articles, whatever regarding software rendering is welcome. To dephten the thread, I'd like to hear others experience and history with software rendering, discussing it's pros and cons and way of implementing it, different algorithms etc.
Your turn. ;)
#2
Posted 26 December 2008 - 01:10 AM
But in practice, there is the problem that it is traditionally slower than hardware rendering, which implies in simpler graphics and lower resolution to achieve acceptable interactive speeds, so the average user will not understand the fact that you're doing ALL the work yourself.
Unless the new many multicore tech brings SW back, I don't see it as a viable real world option, but as a great learning experience only.
#3
Posted 26 December 2008 - 01:26 AM
vrnunes said:
If we do see CPUs with tons of cores someday, people will most likely want to use all that power for software raytracing/path tracing rather than software rasterization.
#4
Posted 26 December 2008 - 01:42 AM
Nyx said:
#5
Posted 26 December 2008 - 02:48 AM
* a perspective correct textured triangle renderer
* a clipper (do this in 2d after youve projected, except for the near plane)
the triangle renderers need is obvious, but without the clipper you wont be
able to go "inside" the objects, so you wont be able to model an environment
without a clipper.
also, you need these
* a good easy to use vector and matrix library
* a good interface to get the models onto the screen with with little code.
then after that its almost exactly identical as using direct x anyway.
but one last thing ill tell you, is that software rastering gives you total freedom in how you do things, so anything is possible like texture coordinates in the triangle indices instead of vertices, you can go quasi voxel also.
its limitless and i think its perhaps MORE fun (maybe a little more challenging at the start)
I had some success with multicore, but youll never get anisotropic filtering like on the video card...
#6
Posted 26 December 2008 - 03:28 AM
Maybe the best question: Where did you learn software rasterization from?
#7
Posted 26 December 2008 - 09:44 AM
Hertta said:
Id been playing with 3d transformations using BGI (Borland Graphics Interface) to do my rasterisation. Eventually i wanted texture mapping and Z-Buffering so I started work on my own rasteriser. I started out simply scan converting a triangle and then using something called a "pencil and paper" (;)) I worked out the rest as I went along :) It was hard learning this stuff pre-internet ... I do however have a bloody good understanding of how such things work now.
#8
Posted 26 December 2008 - 10:22 AM
one handy tip - perspective texture mapping means you interpolate 1/z not z, and it comes out curved across the triangle
instead of flat straight which isnt correct at all.
#9
Posted 26 December 2008 - 12:43 PM
One day you might regret having spent time on a pure sw rasterizer as i did
#10
Posted 26 December 2008 - 12:57 PM
hehe that sounds bad, nah, editors like zbrush are soft rastered and look great.
#12
Posted 26 December 2008 - 06:06 PM
.oisyn said:
Heh, I used those exact two when I started out :)Another thing I did, was download engines and code-samples that did software rasterization, and study it to see how they did it. I remember there was a lot of Quake I+II level loaders around at the time, and alot of them used software rendering to display the levels.
#13
Posted 26 December 2008 - 07:32 PM
Hertta said:
Quote
Quote
#14
Posted 26 December 2008 - 07:55 PM
Here's the link to fatmap2: http://www.exaflop.org/docs/fatmap/
My stuff: torus.untergrund.net <-- some diy electronic stuff and more.
#15
Posted 26 December 2008 - 10:15 PM
Nick said:
I'd say it's not necessary to implement a rasterizer to understand all that's involved. You can skim over the theory and understand most of it. The most valuable skill is a good understanding of linear algebra (vector, matrices, projection, etc.).
Quote
Implementing OpenGL in software would indeed be tedious foolish, especially since it's already been done (http://www.mesa3d.org/). However, there are things to be learned by experimenting. Personally, I will say that I gained deeper insight into this by implementing a raytracer. This didn't take me 20 years, it took me about a week or two... I had spheres raytraced in about a day.
But anyways, let's break it down... How much time should it take you to spin a teapot on your screen in software? Let's assume C++ is being used.
Reading about matrix and vector algebra to understand the theory
- 0 to 30 hours, you might already know this from school
- This knowledge will stay with you for life, it's not wasted effort
Implementing basic matrix and vector algebra classes with operator overloading
- 5 to 20 hours
- ~400+ lines of code
- What you essentially need is matrix multiplication, vector addition, scalar multiplication, dot product, cross product
Reading about the theory behind perspective projection and scanline rasterization
- 4 to 30 hours
- Again, definitely not wasted effort, will help you understand any 3D API
Implementing perspective projection using your linear algebra primitives
- 2 to 5 hours
- ~200+ lines of code
- Here you simply need to understand your camera model and apply the corresponding linear algebra
Implementing naive, flat-shaded polygon rasterization, for the sake of learning
- 2 to 10 hours
- ~400 lines of code
- Here I'm talking about the code to scan through a polygon, scanline per scanline, and write pixels in a frame buffer
Implementing an OBJ model loader and a TGA image writer to read that teapot model and save the rendered image somewhere
- 3 to 8 hours
- ~300+ lines of code
- Those classes can be practical to implement a simple 3D engine or a raytracer, too
Total: 16 to 103 hours, ~1300 lines of code
- Assuming 12 hours of work a week, 1 to 9 weeks
- Assuming 20 hours of work a week, 1 to 5 weeks
My point is that the time varies greatly depending on your skill level, but most of the effort willl be spent reading, gaining valuable insight into how rasterization work at a high level. To get very basic software rasterization working for the sake of learning can be done in less than a week, once you actually understand the principles behind it.
Of course now, if you want texture mapping, lighting, anti-aliasing, and to optimize it all with ASM/SIMD, it will take longer, but at that point, once you have your basic rasterization structure in place, such "upgrades" are actually pretty easy to implement. As you pointed out, many of these things are hard to get "exactly right", but you can still have a toy renderer working pretty quickly, and with a little extra effort, you might even bring it to a sufficient level that you could implement a quake/doom-like game with it. Performance isn't going to be as insanely important as it was back in the doom and quake days.
#16
Posted 26 December 2008 - 11:37 PM
As a final note, you will still need all this knowledge if you are going to create a new GPU. OK, but then you went pretty hardcore. :-)
#17
Posted 30 December 2008 - 06:44 AM
#18
Posted 30 December 2008 - 10:01 AM
www.blender.org
www.wings3d.com
www.povray.org
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












