Smooth Shading with bidirectional path tracing? back
Board:
Home
Board index
Raytracing
General Development
(L) [2014/04/22] [tby shiqiu1105] [Smooth Shading with bidirectional path tracing?] Wayback!Hi folks,
I am having trouble producing smooth shading with bidirectional path tracing(BDPT).
I am using per vertex normal, and smooth shading can be achieved with path tracing or direct lighting. However, BDPT always results in faceted looking results such as the one below.
Notice that even the caustics, which is most sampled with light tracing, are faceted.
[IMG #1 Image]
I spent some time debugging and found that this faceted look was the result of the sampling technique that connects light samples directly to the camera.
I really don't know how to fix this, since these samples are sampled from light source, and they depend only on the geometry, not normal.
The following is a pure light tracing image. All samples are traced from the light source and then projected to camera.
[IMG #2 sphere.jpg]
All meshes in the above image uses per-vertex normal.
But it confuses me that mitsuba seems to be free from this artifact.
Any clue?
[IMG #1]:Not scraped:
https://web.archive.org/web/20161005163133im_/http://www.edxgraphics.com/uploads/8/5/2/1/8521459/8625664_orig.jpg
[IMG #2]:Not scraped:
/web/20161005163133im_/http://ompf2.com/download/file.php?id=156&sid=b3efc2166313b24dc61e7df98be9778e
(L) [2014/04/22] [ost
by shiqiu1105] [Smooth Shading with bidirectional path tracing?] Wayback!Hi folks,
I am having trouble producing smooth shading with bidirectional path tracing(BDPT).
I am using per vertex normal, and smooth shading can be achieved with path tracing or direct lighting. However, BDPT always results in faceted looking results such as the one below.
Notice that even the caustics, which is most sampled with light tracing, are faceted.
[IMG #1 Image]
I spent some time debugging and found that this faceted look was the result of the sampling technique that connects light samples directly to the camera.
I really don't know how to fix this, since these samples are sampled from light source, and they depend only on the geometry, not normal.
The following is a pure light tracing image. All samples are traced from the light source and then projected to camera.
sphere.jpg
All meshes in the above image uses per-vertex normal.
But it confuses me that mitsuba seems to be free from this artifact.
Any clue?
[IMG #1]:Not scraped:
https://web.archive.org/web/20210303092759im_/http://www.edxgraphics.com/uploads/8/5/2/1/8521459/8625664_orig.jpg
(L) [2014/04/22] [tby beason] [Smooth Shading with bidirectional path tracing?] Wayback!Veach's thesis discusses issues with bidirectional methods and smoothed normals, have you seen that...?
(L) [2014/04/22] [tby shiqiu1105] [Smooth Shading with bidirectional path tracing?] Wayback!>> beason wrote:Veach's thesis discusses issues with bidirectional methods and smoothed normals, have you seen that...?
Actually I haven't. Would you mind telling me which chapter in which he talks about that?
(L) [2014/04/22] [tby shiqiu1105] [Smooth Shading with bidirectional path tracing?] Wayback!I found it. It's in section 5.3.
I haven't read the details, if anybody knows what's happening please explain it here too so that we can all learn.
I will read it first.
What a great thesis, always can learn new things from it. No wonder he won the Oscar...
(L) [2014/04/23] [tby Dade] [Smooth Shading with bidirectional path tracing?] Wayback!>> shiqiu1105 wrote:I found it. It's in section 5.3.
I haven't read the details, if anybody knows what's happening please explain it here too so that we can all learn.
I will read it first.
What a great thesis, always can learn new things from it. No wonder he won the Oscar...
The problem is presented in section 3.7.5: normal interpolation makes your BSDF no symmetrical and you have to use adjoint BSDF to solve the problem as explained in section 5.3. All the chapter 5 is dedicated to the cause and the solution of this problem.
(L) [2014/04/28] [tby shiqiu1105] [Smooth Shading with bidirectional path tracing?] Wayback!>> Dade wrote:shiqiu1105 wrote:I found it. It's in section 5.3.
I haven't read the details, if anybody knows what's happening please explain it here too so that we can all learn.
I will read it first.
What a great thesis, always can learn new things from it. No wonder he won the Oscar...
The problem is presented in section 3.7.5: normal interpolation makes your BSDF no symmetrical and you have to use adjoint BSDF to solve the problem as explained in section 5.3. All the chapter 5 is dedicated to the cause and the solution of this problem.
I read the section and whipped up a quick fix in my BDPT implementation where light vertices are connected explicitly to the sensor. And this fixed the faceted looks. However I am more confused about the problem in general. I tried to use this adjoint BSDF for all light path (not only when connecting to the sensor, but also when connecting with camera path), but obvious error would occur.
And I don't see pbrt mentioning this in its implementation of MLT or photon mapping. I did see Mitsuba implemented this, in the PathVertex::sampleNext() function, however its implementation it's quite tricky to follow and I failed to match it with Veach's thesis.
I think this shading normal problem really makes the light transport framework more messed up. If only there is a good illustration on how to do it correctly.
(L) [2014/04/28] [tby shiqiu1105] [Smooth Shading with bidirectional path tracing?] Wayback!Additionally, Veach says when tracing importance from the light source, local bsdf sampling should happen based on the cosine term of the geometry normal.
I took a quick glance at the mitsuba source code, and it looks to me that it's always sampling based on shading normal too.
(L) [2014/05/21] [tby shocker_0x15] [Smooth Shading with bidirectional path tracing?] Wayback!Hi.
I have implemented the correction of non-symmetrical BSDF problem due to shading normal.
First, sampling a direction not according to a geometry normal when we focus on adjoint BSDF is not problem for convergence.
(as long as we can sample all directions wherever a BSDF value is not zero)
You have to consider a correction factor for all vertices related to light-path.
In BPT, one considers a case where a path is constructed by more light-path sampling.
So, in case you determine Russian roulette probability by using MC throughput (fs * cos / pdf), you have to take adjoint correction into consideration.
As you think, this makes the algorithm messy, but I think it is inevitable because shading normal doesn't have a physical basis.
Furthermore, adjoint correction factor |(dot(wo, Ns) * dot(wi, Ng)) / (dot(wo, Ng) * dot(wi, Ns))| has singularity, so you need to also take care of this.
What you have to pay attention to is the order of the numerator and denominator of the factor.
[IMG #1 BcVi0jiCQAMzudF.png]
* When you implement the BPT algorithm based on PBRT, you should disable texture filtering used by a ray traced from a camera, because it makes BSDF non-symmetric.
[IMG #1]:Not scraped:
/web/20161005163133im_/http://ompf2.com/download/file.php?id=163&sid=b3efc2166313b24dc61e7df98be9778e
(L) [2014/05/21] [ost
by shocker_0x15] [Smooth Shading with bidirectional path tracing?] Wayback!Hi.
I have implemented the correction of non-symmetrical BSDF problem due to shading normal.
First, sampling a direction not according to a geometry normal when we focus on adjoint BSDF is not problem for convergence.
(as long as we can sample all directions wherever a BSDF value is not zero)
You have to consider a correction factor for all vertices related to light-path.
In BPT, one considers a case where a path is constructed by more light-path sampling.
So, in case you determine Russian roulette probability by using MC throughput (fs * cos / pdf), you have to take adjoint correction into consideration.
As you think, this makes the algorithm messy, but I think it is inevitable because shading normal doesn't have a physical basis.
Furthermore, adjoint correction factor |(dot(wo, Ns) * dot(wi, Ng)) / (dot(wo, Ng) * dot(wi, Ns))| has singularity, so you need to also take care of this.
What you have to pay attention to is the order of the numerator and denominator of the factor.
BcVi0jiCQAMzudF.png
* When you implement the BPT algorithm based on PBRT, you should disable texture filtering used by a ray traced from a camera, because it makes BSDF non-symmetric.
back