1. 程式人生 > >Notes for GGX paper

Notes for GGX paper

see mina dep href truct easy fun cti fin

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)

技術分享圖片



來自為知筆記(Wiz)

Notes for GGX paper