Ray differentials are widely used in physically based rendering system for the purpose of texture mapping and particle tracing. While it is easy to trace and calculate the ray differentials of the light transport phenomenons like reflection and refraction, tracing ray differential of BRDF glossy reflection is not easy for usually BRDF sampling will introduce two random numbers. Here we decide to calculate the precise result for glossy reflections for most types BRDF models.

I won't repeat the definitions here. What we concerned more is the differential of ray direction.

1. Phong Models

In phong models importance sampling we will sample an solid angle between the direction R(pure reflection vector) and wo(the out direction of the phong reflection). The general approach is building a tangent frame of specular vector, like the figure below

请输入图片描述

While we use two random numbers to sample the two angles:

请输入图片描述

If we assume the sampling function is:

请输入图片描述

we can easily represent the sample direction like:

请输入图片描述

In which, U and V are two vetors which will construct the tangent frame with vector R.

Then, we can calculate the differentials for every term in the formula by using the chain rule. Which we will get:

请输入图片描述

By observing the three term we can easily find out that all the dHdx term is zero(h is just the function of random numbers), and dRdx is easily calculated(see "tracing ray differentials"). The only problems are calculating differentials of U and V. We will solve these step by step.

First we can represent U as the function of R,

请输入图片描述

The problem is the normalization, we can write it as:

请输入图片描述

We can finally calculate this as:

请输入图片描述

For V, we know it is the cross product of U and R, we will apply the differential rules of cross product:

请输入图片描述

All the differentials are known in this formula so we could easily get dVdx.

2. Microfacet models

In microfacet models like blinn; beckmann or GGX. We will sample an half vector:

请输入图片描述

Then we deriavte the output direction. Then we can have the differentials:

请输入图片描述

Generally we sample the H vector in the tangent frame of normal vector. As the derivations before, we can calculate each term in H by using the chain rule. But one thing lucky is that dNdx is always so small that we can treat it as zero. So let dHdx be zero won't cause big problem. We can have:

请输入图片描述

3. Results

Using the path differentials in texutre mapping we can get more robust results for the benefits of texture mapping.

请输入图片描述

请输入图片描述

请输入图片描述

请输入图片描述

请输入图片描述
PS:写的也比较粗糙,权当草稿了。。


Wentao_Wang
136 声望54 粉丝

引用和评论

0 条评论