A Path tracer

Starting easy.
Torwgia
Posts: 8
Joined: Fri Apr 20, 2012 8:08 am
Location: Reno, NV, USA

A Path tracer

Postby Torwgia » Mon Aug 13, 2012 8:29 pm

Trying out making a Path Tracer after reading around a bit. I think I might have messed up a bit so far. There "should" be two spheres(one red, one blue) on top of a plane.

Lets see if I can fix it. Please excuse the jpg quality, I haven't gotten used to using convert yet.

Image

Torwgia
Posts: 8
Joined: Fri Apr 20, 2012 8:08 am
Location: Reno, NV, USA

Re: A Path tracer

Postby Torwgia » Tue Aug 14, 2012 6:52 pm

Made more progress last night before bed.

Image
1024 samples

Turns out I had forgotten to normalize a the direction vector for my rays as the camera was generating them. oops haha.

I think the next thing on the list to due is triangles and some sort of jittering of the produced rays.

raider
Posts: 42
Joined: Fri Aug 03, 2012 10:36 pm
Location: Moscow, Russia.

Re: A Path tracer

Postby raider » Tue Aug 14, 2012 9:19 pm

Quite strange sharp "shadows" on the walls. They should not be there in that kind of scene. Seams to me you've overlooked one more bug.

Torwgia
Posts: 8
Joined: Fri Apr 20, 2012 8:08 am
Location: Reno, NV, USA

Re: A Path tracer

Postby Torwgia » Wed Aug 15, 2012 12:00 am

hmm, I think that might be caused from my poor use of convert to make the ppm's I am output into jpgs for the internet... Maybe I should switch over pngs?

raider
Posts: 42
Joined: Fri Aug 03, 2012 10:36 pm
Location: Moscow, Russia.

Re: A Path tracer

Postby raider » Wed Aug 15, 2012 9:26 am

Render the scene with one light only placed in the middle of the floor and make it white, not colored. Let's see how will it look like.

Torwgia
Posts: 8
Joined: Fri Apr 20, 2012 8:08 am
Location: Reno, NV, USA

Re: A Path tracer

Postby Torwgia » Thu Aug 16, 2012 4:26 am

Here is a single white light in the center of the screen.
Image
128 samples per pixel

I added in a simple jitter to rays as they leave the camera. It seems to improve the image quality
Heres the same 3 colored sphere picture with the new jittered rays
Image
i think this one is 1024 samples per pixel

I also switched over to png's with convert.
$ convert <the ppm> <the png>

This change seems to be better?

Next on my list is to move over to all triangles. No more of this infinite plane and sphere nonsense. Next update will be that!

raider
Posts: 42
Joined: Fri Aug 03, 2012 10:36 pm
Location: Moscow, Russia.

Re: A Path tracer

Postby raider » Thu Aug 16, 2012 11:25 pm

Hm... No, it's not correct. What are the lighter circular areas on the left and right walls? That's also visible on the single light scene.

raider
Posts: 42
Joined: Fri Aug 03, 2012 10:36 pm
Location: Moscow, Russia.

Re: A Path tracer

Postby raider » Thu Aug 16, 2012 11:34 pm

I don't see you code, so cant say exactly, but seeing what I see I suspect that the lighter areas are the areas where dot product of -eye vector (direction from the intersection point to to eye) and the normal vector is positive, and darker areas are where dot(-eye, n) < 0.

When you calculate angles like cos(theta) via dot product, are you sure you use normalized vectors? Seams to me like that could be that simple bug.

Torwgia
Posts: 8
Joined: Fri Apr 20, 2012 8:08 am
Location: Reno, NV, USA

Re: A Path tracer

Postby Torwgia » Fri Aug 17, 2012 3:25 pm

I will check that tonight after work! Thanks for the help.

Torwgia
Posts: 8
Joined: Fri Apr 20, 2012 8:08 am
Location: Reno, NV, USA

Re: A Path tracer

Postby Torwgia » Sat Aug 18, 2012 4:14 am

I think I transposed the color of the object versus it's emitted color when I was reading some of the papers. I changed that and am now waiting on a image with 1024 samples to finish.

I was wondering if anyone had some suggestions for some papers to read on multithreading this thing. I tried using std::async to get a bunch of futures, but I think I ran out of thread handles because it threw an exception.

Anyway, I will update you all when that image finishes and I am done eating! Thanks for the help so far!


Return to “My First...”

Who is online

Users browsing this forum: No registered users and 1 guest