Skip to content

SpotLightNode: Add custom attenuation using spotLight.attenuationNode#31013

Merged
sunag merged 2 commits into
mrdoob:devfrom
sunag:dev-attenuationnode
Apr 28, 2025
Merged

SpotLightNode: Add custom attenuation using spotLight.attenuationNode#31013
sunag merged 2 commits into
mrdoob:devfrom
sunag:dev-attenuationnode

Conversation

@sunag

@sunag sunag commented Apr 28, 2025

Copy link
Copy Markdown
Collaborator

Closes #30993 (comment)

Description

Add custom attenuation using spotLight.attenuationNode.

image

@sunag sunag added this to the r177 milestone Apr 28, 2025
@github-actions

github-actions Bot commented Apr 28, 2025

Copy link
Copy Markdown

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.33
78.33
336.33
78.33
+0 B
+0 B
WebGPU 547.56
151.81
547.81
151.88
+251 B
+70 B
WebGPU Nodes 546.91
151.66
547.16
151.73
+251 B
+70 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.78
112.28
465.78
112.28
+0 B
+0 B
WebGPU 622.41
168.39
622.66
168.44
+251 B
+53 B
WebGPU Nodes 577.29
157.65
577.54
157.71
+251 B
+65 B

Comment thread src/nodes/lighting/SpotLightNode.js Fixed
@sunag sunag marked this pull request as ready for review April 28, 2025 03:28
@sunag sunag merged commit 5ab06a3 into mrdoob:dev Apr 28, 2025
@sunag sunag deleted the dev-attenuationnode branch April 28, 2025 03:30
@WestLangley

Copy link
Copy Markdown
Collaborator

@Mugen87

  1. I don't think this PR accommodates the aspect ratio of the texture as in the original feature request. Do you agree?

  2. Do you also see the intensity as relatively brighter on the diagonals in this implementation?

RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 2025
RuthySheffi pushed a commit to RuthySheffi/three.js that referenced this pull request Jun 5, 2025
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.

Spotlights Use Rectangular Projection

3 participants