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.
Friday, 22 August 2008
Thursday, 21 August 2008
Modern art (or when raytracing goes wrong) and some timings...
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:
[caption id="attachment_186" align="aligncenter" width="300" caption="When raytracing goes wrong"]
[/caption]
If I need something to fall back onto - modern art might just be my thing :p
[caption id="attachment_186" align="aligncenter" width="300" caption="When raytracing goes wrong"]
[/caption]If I need something to fall back onto - modern art might just be my thing :p
Wednesday, 20 August 2008
Speed update
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)
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)
Tuesday, 19 August 2008
Optimizations
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.
[caption id="attachment_173" align="aligncenter" width="300" caption="First purely GPU output"]
[/caption]
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.
[caption id="attachment_173" align="aligncenter" width="300" caption="First purely GPU output"]
[/caption]Friday, 15 August 2008
Managing scene objects
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.
[caption id="attachment_162" align="aligncenter" width="300" caption="Yet another lighting change"]
[/caption]
[caption id="attachment_162" align="aligncenter" width="300" caption="Yet another lighting change"]
[/caption]Thursday, 14 August 2008
Colour bleeding
Just a very quick update today as I'm driving all over the place before work this morning. Even the tail end of rush hour on the m4 will be fun. For those of you who take the m4 in the mornings - don't panic! I'm not taking Buttercup, so there wont be any massive delays :p
As you can see from the images below I fixed some of the artifacts and coloured in my Cornel Box. It has a white light source very nearly in the centre. In the screenshot with reflections you can clearly see the colour bleeding (which is the desired effect). Next steps are to get the dimensions of the box correct and add some objects to it.
[gallery]
As you can see from the images below I fixed some of the artifacts and coloured in my Cornel Box. It has a white light source very nearly in the centre. In the screenshot with reflections you can clearly see the colour bleeding (which is the desired effect). Next steps are to get the dimensions of the box correct and add some objects to it.
[gallery]
Wednesday, 13 August 2008
Updates
Busy night last night - a variety of bug fixes in cudart. Amazing how your lighting improves when you are not taking a cubic root :p I was for some reason, probably a really good one at the time, getting the magnitude of a vector and then taking the square root of the scalar. This explains rather nicely why my reflections were so weak. Secondly fixed an error in some intersection calculations which was having an inpact on light reflections. As you can see from the screenshots these fixes have caused a massive improvement in quality.
Subscribe to:
Posts (Atom)