DShade - a 3d software rasterizer

Tom S h3r3tic at remove.mat.uni.torun.pl
Sat Jan 19 04:47:36 PST 2008


janderson wrote:
> This is some nice work.  It seems to run a little slow.  I assume this 
> is software rendered so I guess performance is reasonable for that.

It's a very basic renderer, with not many optimizations, but I believe 
it's not very slow either, at least for something not using any SIMD 
instructions and done in about two weeks.


> Anyway I'm not trying to be picky, but if you don't mind here are some 
> optimisation suggestions.  I couldn't look over all your code so I may 
> have missed something.

I don't mind, thanks :)


> Are you using the PVS data stored in the tree to speed things up?
> 
> Are you sorting closest to furthest so that you can early out in your 
> z-tests (the BSP tree almost does this for you).
> 
> Another thing you could do is a software occlusion test using the 
> bounding boxes of the BSP nodes.

Unfortunately nope, I didn't have enough time to do that. I guess I'll 
add this stuff when I'm bored (and find some spare time) ... I actually 
wanted DShade to do span-based rendering like in the old times. That 
would provide pretty decent occlussion testing, but... reality struck. I 
failed the 'Abstract Algebra' exam and had to study to take it again, 
thus shrinking my predicted time budget :F


> Oh, another probably obvious: make sure your not doing any allocation 
> during the real time part of the game.

Sure thing :) I only use the GC for top-level objects, malloc elsewhere, 
there's some pooling going on under the hood as well.


> My thesis may be helpful.  The engine was in D, however it uses hardware 
> rendering and doesn't look half as cool as yours.
> 
> http://www.gamasutra.com/features/20060417/anderson_01.shtml

I've actually had it on my HDD for a while. Hard not to notice a 
gamasutra feature by a fellow D (game) programmer, especially when it 
touches BSP trees ( when every other kid was playing with early hardware 
shaders, I stuck my nose in automatic portal generation ). Your thesis 
may come in handy when we restart the work on Deadlock :)


-- 
Tomasz Stachowiak
http://h3.team0xf.com/
h3/h3r3tic on #D freenode



More information about the Digitalmars-d-announce mailing list