Skip to content
14 changes: 14 additions & 0 deletions editor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,20 @@

editor.selectByUuid( selected );

// Update PointLightHelper showRange for restored selection

for ( const id in editor.helpers ) {

const helper = editor.helpers[ id ];

if ( helper.isPointLightHelper ) {

helper.showRange = ( helper.light === editor.selected );

}

}

}

} );
Expand Down
26 changes: 0 additions & 26 deletions editor/js/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,32 +396,6 @@ Editor.prototype = {

helper = new THREE.PointLightHelper( object, 1 );

helper.matrix = new THREE.Matrix4();
helper.matrixAutoUpdate = true;

const light = object;
const editor = this;

helper.updateMatrixWorld = function () {

light.getWorldPosition( this.position );

const distance = editor.viewportCamera.position.distanceTo( this.position );
this.scale.setScalar( distance / 30 );

this.updateMatrix();
this.matrixWorld.copy( this.matrix );

const children = this.children;

for ( let i = 0, l = children.length; i < l; i ++ ) {

children[ i ].updateMatrixWorld();

}

};

} else if ( object.isDirectionalLight ) {

helper = new THREE.DirectionalLightHelper( object, 1 );
Expand Down
6 changes: 2 additions & 4 deletions editor/js/Menubar.Add.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,8 @@ function MenubarAdd( editor ) {

const color = 0xffffff;
const intensity = 1;
const distance = 0;

const light = new THREE.PointLight( color, intensity, distance );
const light = new THREE.PointLight( color, intensity );
light.name = 'PointLight';

editor.execute( new AddObjectCommand( editor, light ) );
Expand All @@ -433,11 +432,10 @@ function MenubarAdd( editor ) {

const color = 0xffffff;
const intensity = 1;
const distance = 0;
const angle = Math.PI * 0.1;
const penumbra = 0;

const light = new THREE.SpotLight( color, intensity, distance, angle, penumbra );
const light = new THREE.SpotLight( color, intensity, 0, angle, penumbra );
light.name = 'SpotLight';
light.target.name = 'SpotLight Target';

Expand Down
23 changes: 0 additions & 23 deletions editor/js/Sidebar.Object.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,16 +245,6 @@ function SidebarObject( editor ) {

container.add( objectGroundColorRow );

// distance

const objectDistanceRow = new UIRow();
const objectDistance = new UINumber().setRange( 0, Infinity ).onChange( update );

objectDistanceRow.add( new UIText( strings.getKey( 'sidebar/object/distance' ) ).setClass( 'Label' ) );
objectDistanceRow.add( objectDistance );

container.add( objectDistanceRow );

// angle

const objectAngleRow = new UIRow();
Expand Down Expand Up @@ -535,12 +525,6 @@ function SidebarObject( editor ) {

}

if ( object.distance !== undefined && Math.abs( object.distance - objectDistance.getValue() ) >= 0.01 ) {

editor.execute( new SetValueCommand( editor, object, 'distance', objectDistance.getValue() ) );

}

if ( object.angle !== undefined && Math.abs( object.angle - objectAngle.getValue() ) >= 0.01 ) {

editor.execute( new SetValueCommand( editor, object, 'angle', objectAngle.getValue() ) );
Expand Down Expand Up @@ -650,7 +634,6 @@ function SidebarObject( editor ) {
'intensity': objectIntensityRow,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 LOW - console.warn used for exception logging
Agent: quality

Category: quality

Description:
Production code uses console.warn to log exceptions. Should use structured logging instead.

Suggestion:
Replace console.warn with a project-level logging utility or consider if this logging is needed.

Confidence: 60%
Rule: quality_avoid_console_in_production
Review ID: d45dfd15-2438-493b-ae82-0d50672f888b
Rate it 👍 or 👎 to improve future reviews | Powered by diffray

'color': objectColorRow,
'groundColor': objectGroundColorRow,
'distance': objectDistanceRow,
'angle': objectAngleRow,
'penumbra': objectPenumbraRow,
'decay': objectDecayRow,
Expand Down Expand Up @@ -825,12 +808,6 @@ function SidebarObject( editor ) {

}

if ( object.distance !== undefined ) {

objectDistance.setValue( object.distance );

}

if ( object.angle !== undefined ) {

objectAngle.setValue( object.angle );
Expand Down
6 changes: 0 additions & 6 deletions editor/js/Strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ function Strings( config ) {
'sidebar/object/intensity': 'شدت',
'sidebar/object/color': 'رنگ',
'sidebar/object/groundcolor': 'رنگ زمینه',
'sidebar/object/distance': 'مسافت',
'sidebar/object/angle': 'زاویه',
'sidebar/object/penumbra': 'نیم سایه',
'sidebar/object/decay': 'پوسیدگی',
Expand Down Expand Up @@ -539,7 +538,6 @@ function Strings( config ) {
'sidebar/object/intensity': 'Intensity',
'sidebar/object/color': 'Color',
'sidebar/object/groundcolor': 'Ground Color',
'sidebar/object/distance': 'Distance',
'sidebar/object/angle': 'Angle',
'sidebar/object/penumbra': 'Penumbra',
'sidebar/object/decay': 'Decay',
Expand Down Expand Up @@ -942,7 +940,6 @@ function Strings( config ) {
'sidebar/object/intensity': 'Intensité',
'sidebar/object/color': 'Couleur',
'sidebar/object/groundcolor': 'Couleur de fond',
'sidebar/object/distance': 'Distance',
'sidebar/object/angle': 'Angle',
'sidebar/object/penumbra': 'Pénombre',
'sidebar/object/decay': 'Affaiblissement',
Expand Down Expand Up @@ -1345,7 +1342,6 @@ function Strings( config ) {
'sidebar/object/intensity': '强度',
'sidebar/object/color': '颜色',
'sidebar/object/groundcolor': '基色',
'sidebar/object/distance': '距离',
'sidebar/object/angle': '角度',
'sidebar/object/penumbra': '边缘',
'sidebar/object/decay': '衰减',
Expand Down Expand Up @@ -1748,7 +1744,6 @@ function Strings( config ) {
'sidebar/object/intensity': '強度',
'sidebar/object/color': '色',
'sidebar/object/groundcolor': '地面の色',
'sidebar/object/distance': '距離',
'sidebar/object/angle': '角度',
'sidebar/object/penumbra': '半影',
'sidebar/object/decay': '減衰',
Expand Down Expand Up @@ -2150,7 +2145,6 @@ function Strings( config ) {
'sidebar/object/intensity': '강도',
'sidebar/object/color': '색',
'sidebar/object/groundcolor': '지면 색',
'sidebar/object/distance': '거리',
'sidebar/object/angle': '각도',
'sidebar/object/penumbra': '반음영',
'sidebar/object/decay': '감쇠',
Expand Down
14 changes: 14 additions & 0 deletions editor/js/Viewport.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,20 @@ function Viewport( editor ) {
selectionBox.visible = false;
transformControls.detach();

// Hide range on all PointLightHelpers, then show for selected

for ( const id in editor.helpers ) {

const helper = editor.helpers[ id ];

if ( helper.isPointLightHelper ) {

helper.showRange = ( helper.light === object );

}

}

if ( object !== null && object !== scene && object !== camera ) {

box.setFromObject( object, true );
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/environments/RoomEnvironment.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class RoomEnvironment extends Scene {
const roomMaterial = new MeshStandardMaterial( { side: BackSide } );
const boxMaterial = new MeshStandardMaterial();

const mainLight = new PointLight( 0xffffff, 900, 28, 2 );
const mainLight = new PointLight( 0xffffff, 900, 0, 2 );
mainLight.position.set( 0.418, 16.199, 0.300 );
this.add( mainLight );

Expand Down
19 changes: 2 additions & 17 deletions examples/jsm/loaders/FBXLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -1206,28 +1206,13 @@ class FBXTreeParser {

}

let distance = 0;
if ( lightAttribute.FarAttenuationEnd !== undefined ) {

if ( lightAttribute.EnableFarAttenuation !== undefined && lightAttribute.EnableFarAttenuation.value === 0 ) {

distance = 0;

} else {

distance = lightAttribute.FarAttenuationEnd.value;

}

}

// TODO: could this be calculated linearly from FarAttenuationStart to FarAttenuationEnd?
const decay = 1;

switch ( type ) {

case 0: // Point
model = new PointLight( color, intensity, distance, decay );
model = new PointLight( color, intensity, 0, decay );
break;

case 1: // Directional
Expand All @@ -1254,7 +1239,7 @@ class FBXTreeParser {

}

model = new SpotLight( color, intensity, distance, angle, penumbra, decay );
model = new SpotLight( color, intensity, 0, angle, penumbra, decay );
break;

default:
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/objects/Lensflare.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
* When using {@link WebGPURenderer}, use {@link LensflareMesh}.
*
* ```js
* const light = new THREE.PointLight( 0xffffff, 1.5, 2000 );
* const light = new THREE.PointLight( 0xffffff, 1.5 );
*
* const lensflare = new Lensflare();
* lensflare.addElement( new LensflareElement( textureFlare0, 512, 0 ) );
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/objects/LensflareMesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { texture, textureLoad, uv, ivec2, vec2, vec4, positionGeometry, referenc
* When using {@link WebGLRenderer}, use {@link Lensflare}.
*
* ```js
* const light = new THREE.PointLight( 0xffffff, 1.5, 2000 );
* const light = new THREE.PointLight( 0xffffff, 1.5 );
*
* const lensflare = new LensflareMesh();
* lensflare.addElement( new LensflareElement( textureFlare0, 512, 0 ) );
Expand Down
Binary file modified examples/screenshots/misc_exporter_usdz.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_animation_keyframes.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_batch_lod_bvh.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_helpers.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_instancing_dynamic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_lensflares.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_loader_gltf_animation_pointer.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_loader_gltf_compressed.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_loader_gltf_dispersion.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_loader_gltf_sheen.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_loader_ldraw.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_materials_alphahash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_materials_subsurface_scattering.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgl_shadowmap_pointlight.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgpu_instance_path.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgpu_lensflares.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgpu_lights_custom.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgpu_lights_projector.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgpu_materials_alphahash.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgpu_materials_sss.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgpu_postprocessing_ca.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgpu_postprocessing_sobel.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgpu_postprocessing_ssr.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/screenshots/webgpu_shadowmap_pointlight.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion examples/webgl_animation_walk.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
controls.floorDecale = ( size / repeat ) * 4;

const bulbGeometry = new THREE.SphereGeometry( 0.05, 16, 8 );
const bulbLight = new THREE.PointLight( 0xffee88, 2, 500, 2 );
const bulbLight = new THREE.PointLight( 0xffee88, 2, 0, 2 );

const bulbMat = new THREE.MeshStandardMaterial( { emissive: 0xffffee, emissiveIntensity: 1, color: 0x000000 } );
bulbLight.add( new THREE.Mesh( bulbGeometry, bulbMat ) );
Expand Down
4 changes: 2 additions & 2 deletions examples/webgl_helpers.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@

scene = new THREE.Scene();

light = new THREE.PointLight();
light = new THREE.PointLight( 0xffffff, 1, 0, 0 );
light.position.set( 200, 100, 150 );
scene.add( light );

scene.add( new THREE.PointLightHelper( light, 15 ) );
scene.add( new THREE.PointLightHelper( light, 1 ) );

const gridHelper = new THREE.GridHelper( 400, 40, 0x0000ff, 0x808080 );
gridHelper.position.y = - 150;
Expand Down
2 changes: 1 addition & 1 deletion examples/webgl_lensflares.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@

function addLight( h, s, l, x, y, z ) {

const light = new THREE.PointLight( 0xffffff, 1.5, 2000, 0 );
const light = new THREE.PointLight( 0xffffff, 1.5, 0, 0 );
light.color.setHSL( h, s, l );
light.position.set( x, y, z );
scene.add( light );
Expand Down
2 changes: 1 addition & 1 deletion examples/webgl_lights_physical.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
scene = new THREE.Scene();

const bulbGeometry = new THREE.SphereGeometry( 0.02, 16, 8 );
bulbLight = new THREE.PointLight( 0xffee88, 1, 100, 2 );
bulbLight = new THREE.PointLight( 0xffee88, 1, 0, 2 );

bulbMat = new THREE.MeshStandardMaterial( {
emissive: 0xffffee,
Expand Down
4 changes: 2 additions & 2 deletions examples/webgl_materials_subsurface_scattering.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@
scene.add( directionalLight );

const pointLight1 = new THREE.Mesh( new THREE.SphereGeometry( 4, 8, 8 ), new THREE.MeshBasicMaterial( { color: 0xc1c1c1 } ) );
pointLight1.add( new THREE.PointLight( 0xc1c1c1, 4.0, 300, 0 ) );
pointLight1.add( new THREE.PointLight( 0xc1c1c1, 4.0, 0, 0 ) );
scene.add( pointLight1 );
pointLight1.position.x = 0;
pointLight1.position.y = - 50;
pointLight1.position.z = 350;

const pointLight2 = new THREE.Mesh( new THREE.SphereGeometry( 4, 8, 8 ), new THREE.MeshBasicMaterial( { color: 0xc1c100 } ) );
pointLight2.add( new THREE.PointLight( 0xc1c100, 0.75, 500, 0 ) );
pointLight2.add( new THREE.PointLight( 0xc1c100, 0.75, 0, 0 ) );
scene.add( pointLight2 );
pointLight2.position.x = - 100;
pointLight2.position.y = 20;
Expand Down
2 changes: 1 addition & 1 deletion examples/webgl_materials_toon.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@

scene.add( new THREE.AmbientLight( 0xc1c1c1, 3 ) );

const pointLight = new THREE.PointLight( 0xffffff, 2, 800, 0 );
const pointLight = new THREE.PointLight( 0xffffff, 2, 0, 0 );
particleLight.add( pointLight );

//
Expand Down
8 changes: 4 additions & 4 deletions examples/webgl_mirror.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,19 @@
scene.add( planeLeft );

// lights
const mainLight = new THREE.PointLight( 0xe7e7e7, 2.5, 250, 0 );
const mainLight = new THREE.PointLight( 0xe7e7e7, 2.5, 0, 0 );
mainLight.position.y = 60;
scene.add( mainLight );

const greenLight = new THREE.PointLight( 0x00ff00, 0.5, 1000, 0 );
const greenLight = new THREE.PointLight( 0x00ff00, 0.5, 0, 0 );
greenLight.position.set( 550, 50, 0 );
scene.add( greenLight );

const redLight = new THREE.PointLight( 0xff0000, 0.5, 1000, 0 );
const redLight = new THREE.PointLight( 0xff0000, 0.5, 0, 0 );
redLight.position.set( - 550, 50, 0 );
scene.add( redLight );

const blueLight = new THREE.PointLight( 0xbbbbfe, 0.5, 1000, 0 );
const blueLight = new THREE.PointLight( 0xbbbbfe, 0.5, 0, 0 );
blueLight.position.set( 0, 50, 550 );
scene.add( blueLight );

Expand Down
8 changes: 4 additions & 4 deletions examples/webgl_portal.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,19 @@
scene.add( planeLeft );

// lights
const mainLight = new THREE.PointLight( 0xe7e7e7, 2.5, 250, 0 );
const mainLight = new THREE.PointLight( 0xe7e7e7, 2.5, 0, 0 );
mainLight.position.y = 60;
scene.add( mainLight );

const greenLight = new THREE.PointLight( 0x00ff00, 0.5, 1000, 0 );
const greenLight = new THREE.PointLight( 0x00ff00, 0.5, 0, 0 );
greenLight.position.set( 550, 50, 0 );
scene.add( greenLight );

const redLight = new THREE.PointLight( 0xff0000, 0.5, 1000, 0 );
const redLight = new THREE.PointLight( 0xff0000, 0.5, 0, 0 );
redLight.position.set( - 550, 50, 0 );
scene.add( redLight );

const blueLight = new THREE.PointLight( 0xbbbbfe, 0.5, 1000, 0 );
const blueLight = new THREE.PointLight( 0xbbbbfe, 0.5, 0, 0 );
blueLight.position.set( 0, 50, 550 );
scene.add( blueLight );

Expand Down
2 changes: 1 addition & 1 deletion examples/webgl_postprocessing_pixel.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
directionalLight.shadow.mapSize.set( 2048, 2048 );
scene.add( directionalLight );

const spotLight = new THREE.SpotLight( 0xffc100, 10, 10, Math.PI / 16, .02, 2 );
const spotLight = new THREE.SpotLight( 0xffc100, 10, 0, Math.PI / 16, .02, 2 );
spotLight.position.set( 2, 2, 0 );
const target = spotLight.target;
scene.add( target );
Expand Down
Loading
Loading