• Create Account

# bronxbomber92

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

### 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.

### Data Oriented Design Question

07 December 2010 - 08:47 PM

I was looking through an old thread on DOD and I came across this post by Hodgman: http://www.gamedev.net/community/forums/topic.asp?topic_id=575076&whichpage=2�

Looking at his code, I see this:

```
ParticleLifeData& life = lifeData[i];
ParticleLocation& pos  = location[i];

```

and

```
ParticleLocation& pos = location[i];
ParticleMaterial& mat = material[i];

```

In both instances, each lookup into lifeData, location, or material will cause a catch miss, won't it? Assuming a 64 kb cache line, if the index into lifeData causes a cache miss, then lifeData[i], lifeData[i + 1], lifeData[i + 2], lifeData[i + 3], lifeData[i + 4], lifeData[i + 5], lifeData[i + 6], lifeData[i + 7] will be loaded into a cache line. But when locations is indexed, won't that cause another cache miss since the cache was either just filled or was all ready loaded with some block of lifeData? If this is the case, would it make more sense to pair either lifeData and location into one structure, or pair location and material into one structure so that the cache miss can be eliminated in one of the cases? Or, is there no cache miss because lifeData, location and material will each be loaded into separate cache lines? If this is the case, then how does the CPU know which cache line should be used when a cache miss is incurred (ie say material[i] causes a cache miss, how does the cpu know not to use the cache line that location[i] is loaded into; is it able to tell which cache line contains the "oldest" memory [ie, last touched]?)?

### Computer Science @ RIT

24 June 2010 - 04:16 AM

I'll be attending RIT this coming fall for Computer Science. I would like to see if there are any RIT alumni here and if so what they thought of the program? I'm slightly worried that due to RIT's strong industry placement emphasis that their computer science program will be one those "produce crappy business app java programmers" programs. I'd just like to ensure that the quality of education is decent!

Also, how does RIT's computer science program compare to the University of Rochester's computer science program? The US News and World Report ranks UR's program much higher than RIT, but the ranking doesn't exactly explain why so I'm hesitant to put too much trust in it. And at a much higher cost, UR may just not be worth it compared to the cheaper RIT.

Thanks

### Universities outside of the U.S.?

21 March 2010 - 12:57 PM

I'm curious about what are some of the top-tier Universities for Computer Science outside of the U.S.? I'm all ready pretty much locked in to attending a school in U.S. for the upcoming year (my first year of college), but it would be interesting to see what out there for possible study abroad programs or graduate school (or maybe just transferring after two years).

PARTNERS