Jump to content
  • Advertisement
Sign in to follow this  
Ganaboy

PBR (EnvMap Prefiltering and Shader optimization)

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

If you intended to correct an error in the post then please contact us.

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

 

Runtime shader(Pseudo code).

 

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

 

 

 

 

 

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!