Skip to content

Conversation

@mrdoob
Copy link
Owner

@mrdoob mrdoob commented Oct 30, 2025

Related issue: #32147

@mrdoob mrdoob added this to the r182 milestone Oct 30, 2025
return [v[0] * s, v[1] * s, v[2] * s];
}

function clamp(x, min, max) {

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused function clamp.

Copilot Autofix

AI about 5 hours ago

The best way to fix this problem is to remove the unused clamp function definition from the file utils/generateSheenLUT.js. This improves code quality and maintainability by eliminating dead code. This involves deleting the function code on lines 33-35. No additional changes, imports, or code definitions are needed, assuming clamp is truly not used in the remainder of the file.

Suggested changeset 1
utils/generateSheenLUT.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/utils/generateSheenLUT.js b/utils/generateSheenLUT.js
--- a/utils/generateSheenLUT.js
+++ b/utils/generateSheenLUT.js
@@ -30,10 +30,8 @@
 
 
 
-function clamp(x, min, max) {
-    return Math.max(min, Math.min(max, x));
-}
 
+
 // ============================================================================
 // Random number generation
 // ============================================================================
EOF
@@ -30,10 +30,8 @@



function clamp(x, min, max) {
return Math.max(min, Math.min(max, x));
}


// ============================================================================
// Random number generation
// ============================================================================
Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated

function integrateBRDF(roughness, NoV, samples) {
const V = [Math.sqrt(1.0 - NoV * NoV), 0.0, NoV];
const N = [0.0, 0.0, 1.0];

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable N.

Copilot Autofix

AI about 5 hours ago

The best way to fix the problem is to remove the initialization and declaration of the unused variable N on line 102 inside the integrateBRDF function in utils/generateSheenLUT.js. This change will ensure the code remains clean and maintainable, and it does not affect any functionality, as N is not used elsewhere in the function. No additional imports or modifications are needed.

Suggested changeset 1
utils/generateSheenLUT.js

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/utils/generateSheenLUT.js b/utils/generateSheenLUT.js
--- a/utils/generateSheenLUT.js
+++ b/utils/generateSheenLUT.js
@@ -99,7 +99,6 @@
 
 function integrateBRDF(roughness, NoV, samples) {
     const V = [Math.sqrt(1.0 - NoV * NoV), 0.0, NoV];
-    const N = [0.0, 0.0, 1.0];
     
     let directionalAlbedo = 0.0;
     
EOF
@@ -99,7 +99,6 @@

function integrateBRDF(roughness, NoV, samples) {
const V = [Math.sqrt(1.0 - NoV * NoV), 0.0, NoV];
const N = [0.0, 0.0, 1.0];

let directionalAlbedo = 0.0;

Copilot is powered by AI and may make mistakes. Always verify output.
Unable to commit as this autofix suggestion is now outdated
@github-actions
Copy link

github-actions bot commented Oct 30, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 356.24
86.47
363.73
89.61
+7.49 kB
+3.13 kB
WebGPU 609.66
171.01
609.66
171.01
+0 B
+0 B
WebGPU Nodes 608.27
170.75
608.27
170.75
+0 B
+0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 487.87
121.22
495.36
124.43
+7.5 kB
+3.21 kB
WebGPU 678.52
186.29
678.52
186.29
+0 B
+0 B
WebGPU Nodes 620.51
169.56
620.51
169.56
+0 B
+0 B

…rt, function or class

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
mrdoob and others added 3 commits October 30, 2025 20:52
…rt, function or class

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…rt, function or class

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…rt, function or class

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants