# PBR (EnvMap Prefiltering and Shader optimization)

This topic is 1549 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello,

I have some questions regarding PBR in general and filtering.

So i am using the lighting equation.

L - light dir(directional light)

N - surface normal.

H - Half Vec.

Lc - Light color(1/PI factor in this).

V - View vec

R = 2 * (V.N) * N - V

Lo = (diffuse + directSpecular) * NoL * lightColor + IndirectSpecular;

directSpecular = GGX_NDF(roughness,NoH) * (Fresnel * G);

IndirectSpecular = EnvBRDF(specularColor.roughness,NOV) * EnvMap.sample(R,roughnessBias);

I want to prefilter Environment maps using GGX distribution and optimize my shader, but i have some confusion in my understanding.

1>Prefilter envmap using N = V = R,

So my understanding is N = texel location to cube center(0.0), ( I need help understanding this mapping).

2>I am using the EnvBRDF approximate analytical solution just like here(https://www.unrealengine.com/blog/physically-based-shading-on-mobile).

Also if u read to end part of the blog, UE4 uses Blinn NDF on mobile(approximated using R and L),

GGX distribution is really nice( would rather drop the geometry term than GGX), Can GGX be approximated using R and L ?

He also mentions he multiplies the EnvBRDF with the NDF(direct specular), i am not able to understand the basis of this.or is it only a good approximate for directional lights?

(Fresnel *G) =  EnvBRDF(specularColor,roughness,NOV) ?

In doing so the following things happen in UE4 mobile shader.

1>No need to compute half vector.(Can GGX be represented using Reflection/View vector instead of halfvector?)

2>F and G , need not be computed for direct specular(since they come from EnvBRDF).

Regards,

Gana

1. 1
2. 2
Rutin
21
3. 3
A4L
15
4. 4
5. 5

• 13
• 26
• 10
• 11
• 44
• ### Forum Statistics

• Total Topics
633742
• Total Posts
3013628
×