Browse Source

Updated builds.

Mr.doob 5 months ago
parent
commit
1dcf17505d
3 changed files with 14 additions and 24 deletions
  1. 7 12
      build/three.cjs
  2. 7 12
      build/three.module.js
  3. 0 0
      build/three.module.min.js

+ 7 - 12
build/three.cjs

@@ -61623,9 +61623,10 @@ const _origin = /*@__PURE__*/ new Vector3();
  * interpolate diffuse lighting while limiting sampling computation.
  *
  * The prefiltering uses GGX VNDF (Visible Normal Distribution Function)
- * importance sampling to generate environment maps that accurately represent
- * the material's BRDF for image-based lighting.
-*/
+ * importance sampling based on "Sampling the GGX Distribution of Visible Normals"
+ * (Heitz, 2018) to generate environment maps that accurately match the GGX BRDF
+ * used in material rendering for physically-based image-based lighting.
+ */
 class PMREMGenerator {
 
 	/**
@@ -62390,6 +62391,7 @@ function _getGGXShader( lodMax, width, height ) {
 
 			// GGX VNDF importance sampling (Eric Heitz 2018)
 			// "Sampling the GGX Distribution of Visible Normals"
+			// https://jcgt.org/published/0007/04/01/
 			vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
 				float alpha = roughness * roughness;
 
@@ -62437,15 +62439,8 @@ function _getGGXShader( lodMax, width, height ) {
 				for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
 					vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
 
-					// Transform V to tangent space for VNDF sampling
-					vec3 V_tangent = vec3(
-						dot(V, tangent),
-						dot(V, bitangent),
-						dot(V, N)
-					);
-
-					// Sample VNDF in tangent space
-					vec3 H_tangent = importanceSampleGGX_VNDF(Xi, V_tangent, roughness);
+					// For PMREM, V = N, so in tangent space V is always (0, 0, 1)
+					vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
 
 					// Transform H back to world space
 					vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);

+ 7 - 12
build/three.module.js

@@ -2700,9 +2700,10 @@ const _origin = /*@__PURE__*/ new Vector3();
  * interpolate diffuse lighting while limiting sampling computation.
  *
  * The prefiltering uses GGX VNDF (Visible Normal Distribution Function)
- * importance sampling to generate environment maps that accurately represent
- * the material's BRDF for image-based lighting.
-*/
+ * importance sampling based on "Sampling the GGX Distribution of Visible Normals"
+ * (Heitz, 2018) to generate environment maps that accurately match the GGX BRDF
+ * used in material rendering for physically-based image-based lighting.
+ */
 class PMREMGenerator {
 
 	/**
@@ -3467,6 +3468,7 @@ function _getGGXShader( lodMax, width, height ) {
 
 			// GGX VNDF importance sampling (Eric Heitz 2018)
 			// "Sampling the GGX Distribution of Visible Normals"
+			// https://jcgt.org/published/0007/04/01/
 			vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
 				float alpha = roughness * roughness;
 
@@ -3514,15 +3516,8 @@ function _getGGXShader( lodMax, width, height ) {
 				for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
 					vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
 
-					// Transform V to tangent space for VNDF sampling
-					vec3 V_tangent = vec3(
-						dot(V, tangent),
-						dot(V, bitangent),
-						dot(V, N)
-					);
-
-					// Sample VNDF in tangent space
-					vec3 H_tangent = importanceSampleGGX_VNDF(Xi, V_tangent, roughness);
+					// For PMREM, V = N, so in tangent space V is always (0, 0, 1)
+					vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
 
 					// Transform H back to world space
 					vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);

File diff suppressed because it is too large
+ 0 - 0
build/three.module.min.js


Some files were not shown because too many files changed in this diff

粤ICP备19079148号