Notes for GGX paper

Posted dydx

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Notes for GGX paper相关的知识,希望对你有一定的参考价值。

Here are some notes for the GGX paper "Microfacet Models for Refraction through Rough Surfaces". In this article, I will give derivations for some important equation in this paper.

 

Derivation for equation (8)

This equation tell us how to construct a macrosurface BRDF given microsurface ‘s D, G, F.

 

技术分享图片

 

In this equation,

技术分享图片 is incident vector.

技术分享图片 is outgoing vector.

技术分享图片 is macrosurface normal.

技术分享图片 is microsurface normal.

技术分享图片 is the macrosurface BRDF.

技术分享图片 is the microsurface BRDF.

技术分享图片 is microfacet distribution function.

技术分享图片 is shadowing-masking function.

技术分享图片 is solid angle in the hemisphere 技术分享图片.

 

How can we get this equation? Please see the figure below.

技术分享图片

In this figure, the surface is illuminated by a light source and an observer is looking at the surface. The observer has a microscope so that he will see the microfacets s1, s2, ... . These microfacets have different colors because of their orientations are different. When the observer look at the surface at the same location, but without the microscope, he will no longer see the microfacets but a uniform color. This time, he knows that it is colors from microfacets that mix together and form the uniform color. Let‘s denote the colors from microfacets as 技术分享图片 and the uniform color as 技术分享图片. Then we have:

 

技术分享图片

In this equation, 技术分享图片 is the projected area of si . According to the definition of microfacet distribution function, we have:

技术分享图片

In this equation,

技术分享图片 is the area of macrosurface.

技术分享图片 is i-th microfacet‘s normal.

技术分享图片 is a small solid angle aligned with 技术分享图片.

技术分享图片 is microfacet distribution function.

 

Combine these equations, we have:

技术分享图片

We can eliminate 技术分享图片 and using the equation (3) in the paper:

 
技术分享图片

Convert sum to integral, then we get:

技术分享图片

Now we can see the term 技术分享图片. Let‘s investigate the term技术分享图片 further:

技术分享图片

In this equation,

技术分享图片 is a small solid angle of incident light over the hemisphere 技术分享图片.

Finally, we have:

技术分享图片

According to the rendering equation

技术分享图片

We can regard the inner integral 技术分享图片 as the equivalent BRDF for macrosurface, so that we get:

技术分享图片

 

Confirm equation (9)

According to the definition of radiance:

技术分享图片

In this equation,

技术分享图片 is the radiance in outgoing direction 技术分享图片

技术分享图片 is luminous flux

技术分享图片 is area of macrofacet

So the outgoing irradiance is:

技术分享图片

Put equation (9) in, we have:

技术分享图片

According to equation (10),

技术分享图片

So According to equation (9), the overall outgoing irradiance equals the incoming irradiance scaled by a factor 技术分享图片, which is less than 1.  

 

Derivation for equation (20)

According to equation (8),

技术分享图片

 

Put equation (15) in it, we have:

技术分享图片

When 技术分享图片 , 技术分享图片, then according to equation (10), we have:

技术分享图片

Derivation for equation (42)

Let us take a careful look at the definition of 技术分享图片.

Suppose there is one point 技术分享图片 on surface whose normal is 技术分享图片, we construct a plane技术分享图片 perpendicular to the normal and choose two perpendicular axes 技术分享图片 and 技术分享图片. For a small patch 技术分享图片 on the plane, we denote the direction pointing from 技术分享图片 to it 技术分享图片, and the small solid angle it occupies 技术分享图片.

技术分享图片

According to equation (4), which is

技术分享图片

We can consider 技术分享图片 as the probability 技术分享图片 of finding a microfacet whose normal 技术分享图片 is inside 技术分享图片 , so that we have

技术分享图片

That‘s exactly what 技术分享图片 is.

Derivation for equation (45)

Break the ray into many short segments, each with projected length 技术分享图片. According to the paper, the probability that the ray is first blocked in segment 技术分享图片 is 技术分享图片, so the probability that ray is always unblocked is:

技术分享图片

Then we have:

技术分享图片

From calculus we know:

技术分享图片

So

技术分享图片

So that

技术分享图片

Derivation for equation (46)

Let‘s consider the situation that a ray intersects with an short and straight surface segment 技术分享图片. In order to do that, the surface height should below the ray at 技术分享图片 and above the ray at 技术分享图片. For a given slope 技术分享图片, there exist a set of surface segments that fulfill this condition, which are in the shaded areas in the figures below.

技术分享图片

It‘s easy to note that the possible surface height at 技术分享图片 varies from 技术分享图片 to 技术分享图片. So given a surface with slope 技术分享图片, the probability that it intersects with a ray 技术分享图片 is

技术分享图片

In this equation,

技术分享图片is the probability density that surface height reaches 技术分享图片 at point 技术分享图片.

 

Also we know that the probability that a surface segment has slope 技术分享图片 is

技术分享图片

Combine them, then we get the probability for finding a surface segment with slope 技术分享图片 as well as intersecting with the ray:

技术分享图片

Consider all possible surface slope 技术分享图片, the probability that they intersect with the ray is:

技术分享图片

Among all surface segments with slope 技术分享图片, the probability that a surface segment below the ray is:

技术分享图片

Consider all possible surface slope 技术分享图片, the probability that they below the ray is:

技术分享图片

Assume 技术分享图片 is independent from 技术分享图片, we have:

技术分享图片

So the probability that a ray first intersects with surface in 技术分享图片 is:

技术分享图片

Let 技术分享图片, so

技术分享图片

Derivation for equation (49)

From equation (48), we have:

技术分享图片

Note that

技术分享图片

So

技术分享图片

Then

技术分享图片

技术分享图片

技术分享图片

Put it in equation (45):

技术分享图片

Derivation for equation (50)

技术分享图片










以上是关于Notes for GGX paper的主要内容,如果未能解决你的问题,请参考以下文章

markdown [general:docker] #general learning #notes for #docker

notes for lxf

Git for Windows v2.11.0 Release Notes

Notes for uc/OS-III User Guide

高级算法设计讲义 Lecture Notes for Advanced Algorithm Design

notes for python简明学习教程