Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

bronxbomber92

Member Since 08 Oct 2006
Offline Last Active Nov 30 2012 08:58 PM
-----

Topics I've Started

Software Rasterisation with Fixed Point Math

28 March 2012 - 12:22 PM

Hi,

I'm trying my hand at writing a software renderer. I've read the Advance Rasterisation article by Nick Capens and it works wonderfully. However, in an attempt to learn the fixed-point representation of floating point numbers, I tried taking the algorithm he presents before he adds the fill convention and fixed point math and writing the fixed point code myself.

My understanding is that the fixed point representation simply gives more precision (and thus more accuracy) and that's why it's effective. However I am not seeing a difference (as a note -- I did implement the fill convention insight Nick outlines, so that is not lacking and thusn't be the reason why my code doesn't work properly).

I went back to the article and looked for differences between the implementations. I believe I'm missing an insight, because there are some parts of his code that don't make sense to me and I can only assume it is these concepts that are the reason my code doesn't work correctly.

The particular areas of his implementation that don't make sense to me are:

1. The necessity of the FDX and FDY variables. Supposedly they are the fixed point representations of the deltas (hence the 4 bit shift), but aren't the DX variables all ready in a 28.4 fixed point format since they are computed from the X and Y variables which are in a 28.4 fixed point format?

2. The addition of 0xf to the min and max variables on their conversion back from 28.4 fixed point format. This is essentially adding .9999 to the fixed point number, correct?

3. Why convert the min and max variables back to normal integers at all? Would it not be equally valid to leave them in the 28.4 format, not do the 4 bit shifts in computing the CY variables, and increment the x, y counters by (1 << 4) in the two for loops?

Thanks ahead of time for any light you can shed on my confusions!

C++11

20 March 2012 - 11:04 PM

With both Clang and GCC having decent support for C++11, I'd like to start writing hobby projects in C++11. As far as I know, I don't believe there exists a published book on C++11, so I'm hoping to get from you all your favourites resources on the web where you've picked up C++11. I'm competent with C++03, so resources that assume prior C++03 experience are perfectly useful to me.

Thanks for your help!

PARTNERS