redkrieg

redkrieg

User name
redkrieg
Assigned title
 
Assigned post color
#55eecc
Avatar
 
Medals
 
Registration date
2007 February 21
Post count
2
Score
11 ₧
Location
 
Signature
 
Timezone
UTC
Groups
 

Recent posts by redkrieg

Recent posts by redkrieg

2007 Feb 23 at 11:07 PST
Awesome, I can't wait to see the next version's source... Very interesting stuff going on!
2007 Feb 23 at 04:56 PST
While I was playing with pixel machine making movies, I ran across a few frames that I thought would make really nice wallpapers, so I wrote in a little mod to do the movement calculations between frames for X frames before passing to the render routine. This let me blow up any particular frame out of a movie into a full sized wallpaper. Code changes follow, additions in bold:



[code:1]
#define FRAMES 1 // frames of animation
[b]#define SFRAME 0[/b]
...
int frames;
[b]int sframe;[/b]
...
frames = FRAMES;
[b]sframe = SFRAME;[/b]
...
case 'v': frames = atoi(argv[i]+2); break;
[b] case 's': sframe = atoi(argv[i]+2); break;[/b]
...
[b]for(i=0;i<sframe;i++)
{
subtract( cam, cam, lin );
tar.z -= 0.85;
cam.z -= 0.9;

for(j=0;j<SPHERES;j++)
{
switch( j%3 )
{
case 2: sphere[j].center.z += 1.1; break;
case 1: sphere[j].center.z -= 1.1; break;
case 0: break;;
}
}
}[/b]

printf("Rendering...\n");
[/code:1]

Simple I know, but useful enough that I figured you might want to hang on to it.

Edit:
Oops, bold doesn't work in code tags, ahh well... need something to differentiate.

Also, have you considered making it multithreaded? Divide the work in half, hand half to each thread, combine at the end... All the work in half the time! (On a dual core machine of course). Raytracing I know works well with multithreading, but I'm not sure about photon mapping.

Multithreading tutorial: http://vergil.chemistry.gatech.edu/resources/programming/threads.html