avoid rejection sampling back

Board: Home Board index Raytracing General Development

(L) [2014/07/01] [tby koiava] [avoid rejection sampling] Wayback!

Hi guys, I have problem about rejection sampling.
I have surface with perturbed normals(smooth shaded or perturbed with normal map) and I want to evaluate BRDF to get reflected ray.
There is a probability that angle between reflected ray direction and face normal may be greater then π/2.
In this case I'm using rejection sampling to avoid this problem.
I'm generating brdf proportional reflected rays until reflected ray isn't directed as desired. It works correctly but dramatically decreases performance.
Any suggestions will be helpful [SMILEY :)]
(L) [2014/07/02] [tby sriravic] [avoid rejection sampling] Wayback!

You can use cosine weighted sampling (pdf proportional to the cos(theta) term) which is where I feel its more important to sample since you're using a normal map to perturb the normals.
(L) [2014/09/24] [tby koiava] [avoid rejection sampling] Wayback!

[IMG #1 Image]
this is a figure illustrating this problem. If surface is highly specular then probability that reflected ray will fall under the surface is high.
Actually, this is a reason of "shadow terminator" problem... (When Angle between light direction and perturbed surface normal is less then π/2, And angle between light direction and face normal is greater then π/2). One solution for this is to do always flat shading and subdivide surface to make correct smooth shading. Is there any different solutions for this?
[IMG #2 Image]
[IMG #1]:Not scraped: https://web.archive.org/web/20161005161407im_/https://lh6.googleusercontent.com/-qhk1pZRayRM/VCJ7HMeUm6I/AAAAAAAAGdQ/kIgCOuWDbmk/w464-h248-no/perturbed_normal_problem.png
[IMG #2]:[IMG:#1]
(L) [2014/09/25] [tby Dade] [avoid rejection sampling] Wayback!

>> koiava wrote:Actually, this is a reason of "shadow terminator" problem... (When Angle between light direction and perturbed surface normal is less then π/2, And angle between light direction and face normal is greater then π/2).

Another solution is to use only the geometry normal (i.e. face normal in your figure) for this kind of check and not the shading normal (i.e. perturbed normal). You are going to have less problems: energy conservation, no rays reflected inside the sphere, etc. However there will be still some noticeable shading artifact on the transition between the dark side and the illuminated side.
(L) [2014/09/25] [tby koiava] [avoid rejection sampling] Wayback!

Energy Conservation is another problem here. When I evaluate BRDF, if it always gives me a ray from hemisphere(directed  to perturbed normal) minus solid angle(which fall under surface), then a corresponding pdf isn't normalized anymore and correct normalization isn't easy task for complicated BRDFs. [SMILEY :)]
(L) [2014/09/26] [tby koiava] [avoid rejection sampling] Wayback!

according to SolidAngle documentation, Arnold has shadow_terminator_fix option,  but this solution doesn't work in some cases.
 >> It works great for convex meshes, but may produce artifacts in concave areas of high curvature. A proper solution in this situation to reduce the shadow terminator artifact is to increase the number of subdivision iterations in the mesh.
I think that for unbiased physical bases production renderers proper solution is to avoid normal perturbing, replace fake smooth shading with subdivision surfaces, and normal mapping with displacement.
(L) [2014/09/27] [tby bod] [avoid rejection sampling] Wayback!

The LEADR paper proposes an non-centred BRDF that only relies on the geometric normal, the offset usually comes from the bump normal, but perhaps the shading normal could also be part of the offset.
[LINK http://hal.inria.fr/hal-00858220/en]
Sampling theory comes here: [LINK http://hal.inria.fr/hal-00996995/en]

back