Author Topic: EDAN30 Photorealistic Computer Graphics 2014  (Read 18470 times)

Offline MikeD

  • Full Member
  • ***
  • Posts: 207
EDAN30 Photorealistic Computer Graphics 2014
« on: 2014-03-17 09:41:55 »
Hi,

Here you can post questions about the course and assignments. Magnus, Rasmus and I will monitor the forum.

Mike

Offline f03mm

  • Newbie
  • *
  • Posts: 17
  • Gender: Male
Re: EDAN30 Photorealistic Computer Graphics 2014
« Reply #1 on: 2014-03-19 06:56:49 »
Here's the source from the homepage with autotools stuff added so you can compile it in linux,
http://users.student.lth.se/f03mm/prTracer.tar.gz
There is a single change to the source to #undef major and minor, as apparently gcc has macros by those names predefined.

https://twitter.com/paniq/status/446538418709745665
« Last Edit: 2014-03-25 16:09:52 by f03mm »

Offline ada09vs1

  • Newbie
  • *
  • Posts: 1
Re: EDAN30 Photorealistic Computer Graphics 2014
« Reply #2 on: 2014-03-20 10:58:29 »
I'm looking for a partner for the labs. Mail me, ada09vs1@student.lu.se.  / Vilhelm

Offline f03mm

  • Newbie
  • *
  • Posts: 17
  • Gender: Male
Re: EDAN30 Photorealistic Computer Graphics 2014
« Reply #3 on: 2014-03-21 16:57:04 »
Could someone explain what the arrows in the given equations are supposed to signify?

Offline MikeD

  • Full Member
  • ***
  • Posts: 207
Re: EDAN30 Photorealistic Computer Graphics 2014
« Reply #4 on: 2014-03-24 10:01:00 »
Could someone explain what the arrows in the given equations are supposed to signify?

If you are referring to the arrows in say equation 1 of assignment 1, then they are referring to 'going in the direction of'. In equation 1, it has something like, L ( x -> O ), here the arrows means light going from the point, x, in the direction, O.

Offline MikeD

  • Full Member
  • ***
  • Posts: 207
Re: EDAN30 Photorealistic Computer Graphics 2014
« Reply #5 on: 2014-03-24 10:01:37 »

We have an issue with the Friday 13-15 lab and will have to switch to using the 10-12 lab. If this doesn't work for you, please let me know.

Offline Jesper Ö

  • Newbie
  • *
  • Posts: 12
Re: EDAN30 Photorealistic Computer Graphics 2014
« Reply #6 on: 2014-03-24 12:32:07 »
Here's the source from the homepage with autotools stuff added so you can compile it in linux,
http://users.student.lth.se/f03mm/prTracer.tar.gz
There is a single change to the source to #undef major and minor, as apparently gcc has macros by those names predefined.

This worked for me on Linux Mint, with one small change:

In main.cpp I modified the #ifdef WIN32...:

Code: [Select]
#ifdef WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif


Offline MikeD

  • Full Member
  • ***
  • Posts: 207
Re: EDAN30 Photorealistic Computer Graphics 2014
« Reply #7 on: 2014-03-24 15:03:30 »
Since too many students can't make the 10-12 lab, I've limited the 13-15 lab to 5 groups and reopened the 10-12 lab, also with 5 groups. Have a look on the lab sign up page, you can enrol in either lab now. I've left the students who originally enrolled for the 13-15 lab in that time slot.

Offline f03mm

  • Newbie
  • *
  • Posts: 17
  • Gender: Male
Re: EDAN30 Photorealistic Computer Graphics 2014
« Reply #8 on: 2014-04-07 15:26:55 »
How many samples per pixel are used in the example pictures in the seminar slides? Even with 100 samples (eg, 10 in each direction), my result right now is much much noisier with multiple bounces than even just the "one bounce then termination" example image.

Offline Jesper Ö

  • Newbie
  • *
  • Posts: 12
Re: EDAN30 Photorealistic Computer Graphics 2014
« Reply #9 on: 2014-04-07 17:31:44 »
In the seminar slides for the Path Tracing seminar, on page 35, there is an image with caustics ("Incorrect caustics"). However I don't recall simulation of caustics being discussed at the seminar?

If the light intensity is simply modulated by the transparency of any object(s) obscuring the light, we would just get a lighter shadow. How do we simulate caustics to get the result from the slides? Is that even part of the assignment?

Offline f03mm

  • Newbie
  • *
  • Posts: 17
  • Gender: Male
Re: EDAN30 Photorealistic Computer Graphics 2014
« Reply #10 on: 2014-04-07 17:34:48 »
In the seminar slides for the Path Tracing seminar, on page 35, there is an image with caustics ("Incorrect caustics"). However I don't recall simulation of caustics being discussed at the seminar?

If the light intensity is simply modulated by the transparency of any object(s) obscuring the light, we would just get a lighter shadow. How do we simulate caustics to get the result from the slides? Is that even part of the assignment?

Any path refracted through the sphere hitting the bright area of the ceiling probably contributes to these incorrect caustics, whereas the correct ones later on would be directly caused by the emissive sphere.

Offline f03mm

  • Newbie
  • *
  • Posts: 17
  • Gender: Male
Re: EDAN30 Photorealistic Computer Graphics 2014
« Reply #11 on: 2014-04-07 17:41:33 »
How many samples per pixel are used in the example pictures in the seminar slides? Even with 100 samples (eg, 10 in each direction), my result right now is much much noisier with multiple bounces than even just the "one bounce then termination" example image.

http://users.student.lth.se/f03mm/p1.png
This is my result for 400spp with 4 forced bounces and 10% absorption. I checked with an image editor and there is ever so slight color bleeding (about 5 in the 8bit rgb space) which is hardly as perceptible as the examples in the seminar slides.

I'm doing the indirect lighting with the cos weighted thingy (the result was more or less identical with uniform sampling but maybe noisier), and then adding the contribution of each indirect ray like this:
Code: [Select]
newdir.normalize();
Ray newray(is.mPosition, newdir);
c += (2.0f/6.28f) * trace(newray, depth + 1) * is.mMaterial->evalBRDF(is, newdir);
(The multiplication with 1/(1-α) is done in the return statement if the iteration was not forced.)
The direct lighting is as before;
Code: [Select]
c += (li->getRadiance(op) * is.mMaterial->evalBRDF(is, L) * std::max(0.0f, is.mNormal * L));(I overloaded getRadiance to do distance falloff if passed a vector).

http://users.student.lth.se/f03mm/p2.png
This is the result with the factor 1/pi removed which is brighter, but still not as bright as the example images.

http://users.student.lth.se/f03mm/p3.png
This is the result with the factor inverted, i.e. i multiply by pi instead of dividing. This has exactly the same brightness as the seminar slides. I guess i simply solved the integral equation incorrectly then :). (Oops, I accidentally overwrote this with the version that has transparency and reflection, but the brightness is still the correct one here). And just for fun, here's the same image with the noise removed with postprocessing:
http://users.student.lth.se/f03mm/p4.png

http://users.student.lth.se/f03mm/area.png
can anyone figure out how i did this? ;)
« Last Edit: 2014-04-08 15:59:57 by f03mm »

Offline Jesper Ö

  • Newbie
  • *
  • Posts: 12
Re: EDAN30 Photorealistic Computer Graphics 2014
« Reply #12 on: 2014-04-07 18:01:17 »
Ah yes, I was thinking the caustics were simulated by some trick with the shadow ray. I should be seeing this caustic effect from the bright spot on the ceiling then, but maybe my sphere is not translucent enough.

In the seminar slides for the Path Tracing seminar, on page 35, there is an image with caustics ("Incorrect caustics"). However I don't recall simulation of caustics being discussed at the seminar?

If the light intensity is simply modulated by the transparency of any object(s) obscuring the light, we would just get a lighter shadow. How do we simulate caustics to get the result from the slides? Is that even part of the assignment?

Any path refracted through the sphere hitting the bright area of the ceiling probably contributes to these incorrect caustics, whereas the correct ones later on would be directly caused by the emissive sphere.

Edit: Okay I upped the transparency and index of refraction of the glass ball and I now get clear caustics. It seems the seminar slides just use different values than those suggested in the lab assignment document.
« Last Edit: 2014-04-07 18:30:51 by JesperOqvist »

Offline Jesper Ö

  • Newbie
  • *
  • Posts: 12
Re: EDAN30 Photorealistic Computer Graphics 2014
« Reply #13 on: 2014-04-07 18:24:41 »
The cosine weighted sampling is intended to reduce noise. Maybe your implementation is not working correctly?

How many samples per pixel are used in the example pictures in the seminar slides? Even with 100 samples (eg, 10 in each direction), my result right now is much much noisier with multiple bounces than even just the "one bounce then termination" example image.

http://users.student.lth.se/f03mm/p1.png
This is my result for 400spp with 4 forced bounces and 10% absorption. I checked with an image editor and there is ever so slight color bleeding (about 5 in the 8bit rgb space) which is hardly as perceptible as the examples in the seminar slides.

I'm doing the indirect lighting with the cos weighted thingy (the result was more or less identical with uniform sampling but maybe noisier), and then adding the contribution of each indirect ray like this:
Code: [Select]
newdir.normalize();
Ray newray(is.mPosition, newdir);
c += (2.0f/6.28f) * trace(newray, depth + 1) * is.mMaterial->evalBRDF(is, newdir);
(The multiplication with 1/(1-α) is done in the return statement if the iteration was not forced.)
The direct lighting is as before;
Code: [Select]
c += (li->getRadiance(op) * is.mMaterial->evalBRDF(is, L) * std::max(0.0f, is.mNormal * L));(I overloaded getRadiance to do distance falloff if passed a vector).

http://users.student.lth.se/f03mm/p2.png
This is the result with the factor 1/pi removed which is brighter, but still not as bright as the example images.

Offline rasmus

  • Newbie
  • *
  • Posts: 31
Re: EDAN30 Photorealistic Computer Graphics 2014
« Reply #14 on: 2014-04-07 21:40:29 »
Here's what you need to change to get light probes working on a windows machine:

In image.cpp line 133. Change:
Code: [Select]
ifstream istream(filename.c_str());Into:
Code: [Select]
ifstream istream(filename.c_str(), ios::binary);
To answer a few questions: the scene in the seminar slides should be the same as in the assignment. So it should be possible to get the same results. Almost all the example images have 400 spp, except for the area light image and the light probe images. The area light image has 1600 spp and the light probe images have a bit more than that.

 

joke