Archive for August, 2008

CUDA v2.0

Sunday, August 31st, 2008

I have put off downloading the version 2.0 documentation for a while now, largely as I cannot afford a board with compute capability 2 just yet. This weekend I eventually succumbed to temptation and downloaded the pdf.

For those of you playing with raytracers figure 5.4 on page 58 should be of particular interest :)  Its nice to see how much the nice NVidia engineers are improving their products all the time. Now to scrape together my pennies for a 2.0 card…   Still developing on a 8800GT isnt a bad idea as a lot of people have them - I’ll just keep telling myself that for now :)

Acceptable performance guidelines for gaming

Friday, August 29th, 2008

According to the PC Gaming Alliance Performance Definition these are the acceptable performance guidelines for gaming:

Pass/Fail Game Metrics (fps):
First Person Shooters: 24+ frames per second
Real Time Strategy: 20+ frames per second
Role Playing Games: 20+ frames per second
Racing Simulation: 50+ frames per second
Flight Simulation: 20+ frames per second
Playability = FPS + Responsiveness + no Graphical Problems

Assuming this is correct it could mean that raytracing will shortly be a viable alternative to rasterising for RTS and role playing games.

4 more fps

Friday, August 29th, 2008

4 more fps! … well on average anyway :)  So its now running at 25-30 continually. Last night did a small update to optimize the number of threads. Also added more colours to the spheres - and you can now press ‘R’ to get some very primitive physics (bouncing)

The download link is the same as the previous post but inside the zip is a version 0.02.

This is still without my new acceleration structures. They are taking a while to implement so as to maximize the efficiency in the way the GPU wants to read the memory. I’m hoping for at least a 2x speed up.

Cudart spheres: movie and download

Wednesday, August 27th, 2008

Here is a sample movie of the spheres in cudart, the average fps code is not quite correct but gives a good idea of the current speed of the system. Well over 25 times the CPU implementation now.

Cudart Spheres movie

Here is the promised download - note it is only tested on a 8800GT with 512mb of memory. Any problems / comments / suggestions please let me know.

cudart-sp-0.01

Again this one is only doing untextured spheres with 2 light sources.

Spheres

Wednesday, August 27th, 2008

For whatever reason spheres in an image seem to appeal to people in general a lot more than a collection of big triangles, no matter how well shaded / textured and lit they are… So to get a bit of “ooooo” and “aaaaah” factor going I decided to add spheres to cudart over the weekend.

Of course, as well as looking better than a triangle, computationally they are much quicker to compute. So even with 111 objects in the scene and 2 levels of reflection it is still possible to get close to 20fps at 800×800. I have just finished an interactive demo version which I will make available for download here as soon as I’ve sorted out the license agreement. In the meantime here are some screenshots.

Texturing

Friday, August 22nd, 2008

As mentioned in earlier posts I have been calculating u,v coordinates for every triangle intersection. I have avoided actually texturing my triangles as I wanted to get most of the other things working well first - I find textures tend to disguise shading / intersection glitches.

Last night I decided to implement some basic texturing and see how much longer the scene took to render. So I added the Lena image to my modified Cornell box - if you are going to be a cliche you may as well go all the way :)    Screenshot with texturing is below.

(more…)

Modern art (or when raytracing goes wrong) and some timings…

Thursday, August 21st, 2008

I wanted to get some proper timing figures before I implemented reflections in order to tell how badly (or well) my reflection code is performing. So I removed one or two small optimizations which would affect the timings based on the scene layout and got this:

When raytracing goes wrong

When raytracing goes wrong

If I need something to fall back onto - modern art might just be my thing :p

(more…)

Speed update

Wednesday, August 20th, 2008

To prevent confusion on my timing figures, here is how I calculate them: As my target framerate is 24 fps I base my timings on creating a full frame from scratch every cycle and doing that 24 times to get my timing. Best demostrated with pseudocode:

setup stuff and create scene objects

start timing

for framecount 1 to 25         (25 instead of 24 to allow for some overhead later)

     generate frame

stop timing

I’ve now set up my scene with 100 objects (the goal amount) and one light source (the goal is 2). I’ve enabled lighting and shadows but as yet no colour and reflections. (screenshot below)

(more…)

Optimizations

Tuesday, August 19th, 2008

My goal for cudart is to run 24 frames per second at 800*600 with a decent object and light count. Decent is a bit hard to define but for now 100 objects and 2 light sources would make me pretty happy.

Most of the screen shots until now have been only partially computed on the GPU as I have been trying to develop my algorithms. I’ve found it is very easy to fall into the trap of making a photo realistic renderer and as a result the earlier screenshots you see are running at about 1 second a frame - ie 1 fps…  So although they might look impressive they are hardly running in realtime. Over the last few days I have been converting everything to run on the GPU and here is the first screenshot.

First purely GPU output

First purely GPU output

  (more…)

Managing scene objects

Friday, August 15th, 2008

After a small change to the lighting (again…) I’m fairly happy with the basic ray / light model now. I still need to implement refraction but that can wait a bit. The next task is to work out an efficient way of manipulating the many triangles in the scene. I need to group them into objects - remembering that OO is not supported on CUDA, and make methods to translate / rotate / scale these objects.

Yet another lighting change

Yet another lighting change

(more…)