Skip to content

Commit

Permalink
Minor clarifications
Browse files Browse the repository at this point in the history
  • Loading branch information
jstone-lucasfilm committed Dec 26, 2023
1 parent 0711edd commit 2ac301c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libraries/pbrlib/genglsl/lib/mx_prefilter_environment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ vec3 mx_prefilter_environment()
float NdotV = 1.0;
float G1V = mx_ggx_smith_G1(NdotV, alpha);

// Integrate the LD term for the given environment and alpha.
vec3 radiance = vec3(0.0, 0.0, 0.0);
float weight = 0.0;
int envRadianceSamples = 1024;
Expand All @@ -65,7 +66,7 @@ vec3 mx_prefilter_environment()
vec2 Xi = mx_spherical_fibonacci(i, envRadianceSamples);

// Compute the half vector and incoming light direction.
vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, vec2(alpha, alpha));
vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, vec2(alpha));
vec3 L = -V + 2.0 * H.z * H;

// Compute dot products for this sample.
Expand All @@ -76,7 +77,7 @@ vec3 mx_prefilter_environment()

// Sample the environment light from the given direction.
vec3 Lw = tangentToWorld * L;
float pdf = mx_ggx_NDF(H, vec2(alpha, alpha)) * G1V / (4.0 * NdotV);
float pdf = mx_ggx_NDF(H, vec2(alpha)) * G1V / (4.0 * NdotV);
float lod = mx_latlong_compute_lod(Lw, pdf, float($envRadianceMips - 1), envRadianceSamples);
vec3 sampleColor = mx_latlong_map_lookup(Lw, $envMatrix, lod, $envRadiance);

Expand Down

0 comments on commit 2ac301c

Please sign in to comment.