Skip to content

Commit 60c7bf5

Browse files
authored
Merge pull request #14777 from Mugen87/dev17
Examples: Remove more lgtm.com warnings
2 parents 304cec1 + 21a9169 commit 60c7bf5

17 files changed

+69
-79
lines changed

examples/canvas_geometry_terrain.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@
145145

146146
function generateTexture( data, width, height ) {
147147

148-
var canvas, context, image, imageData,
149-
level, diff, vector3, sun, shade;
148+
var canvas, context, image, imageData, vector3, sun, shade;
150149

151150
vector3 = new THREE.Vector3( 0, 0, 0 );
152151

examples/canvas_interactive_voxelpainter.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@
7474

7575
objects.push( plane );
7676

77-
var material = new THREE.MeshBasicMaterial( { color: 0xff0000, wireframe: true } );
78-
7977
// Lights
8078

8179
var ambientLight = new THREE.AmbientLight( 0x606060 );

examples/canvas_lines_sphere.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,14 @@
3333
windowHalfX = window.innerWidth / 2,
3434
windowHalfY = window.innerHeight / 2,
3535

36-
SEPARATION = 200,
37-
AMOUNTX = 10,
38-
AMOUNTY = 10,
39-
4036
camera, scene, renderer;
4137

4238
init();
4339
animate();
4440

4541
function init() {
4642

47-
var container, separation = 100, amountX = 50, amountY = 50, particles, particle;
43+
var container, particle;
4844

4945
container = document.createElement( 'div' );
5046
document.body.appendChild( container );

examples/js/postprocessing/SSAOPass.js

Lines changed: 57 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* - Ambient occlusion clamp (numeric value).
1313
* - lumInfluence
1414
* - Pixel luminosity influence in AO calculation (numeric value).
15-
*
15+
*
1616
* To output to screen set renderToScreens true
1717
*
1818
* @author alteredq / http://alteredqualia.com/
@@ -21,7 +21,7 @@
2121
*/
2222
THREE.SSAOPass = function ( scene, camera, width, height ) {
2323

24-
if ( THREE.SSAOShader === undefined) {
24+
if ( THREE.SSAOShader === undefined ) {
2525

2626
console.warn( 'THREE.SSAOPass depends on THREE.SSAOShader' );
2727
return new THREE.ShaderPass();
@@ -46,7 +46,7 @@ THREE.SSAOPass = function ( scene, camera, width, height ) {
4646
//Depth render target
4747
this.depthRenderTarget = new THREE.WebGLRenderTarget( this.width, this.height, { minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter } );
4848
//this.depthRenderTarget.texture.name = 'SSAOShader.rt';
49-
49+
5050
//Shader uniforms
5151
this.uniforms[ 'tDepth' ].value = this.depthRenderTarget.texture;
5252
this.uniforms[ 'size' ].value.set( this.width, this.height );
@@ -59,51 +59,84 @@ THREE.SSAOPass = function ( scene, camera, width, height ) {
5959
this.uniforms[ 'lumInfluence' ].value = 0.7;
6060

6161
//Setters and getters for uniforms
62-
var self = this;
63-
Object.defineProperties(this, {
62+
63+
Object.defineProperties( this, {
6464

6565
radius: {
66-
get: function() { return this.uniforms[ 'radius' ].value; },
67-
set: function( value ) { this.uniforms[ 'radius' ].value = value; }
66+
get: function () {
67+
68+
return this.uniforms[ 'radius' ].value;
69+
70+
},
71+
set: function ( value ) {
72+
73+
this.uniforms[ 'radius' ].value = value;
74+
75+
}
6876
},
6977

7078
onlyAO: {
71-
get: function() { return this.uniforms[ 'onlyAO' ].value; },
72-
set: function( value ) { this.uniforms[ 'onlyAO' ].value = value; }
79+
get: function () {
80+
81+
return this.uniforms[ 'onlyAO' ].value;
82+
83+
},
84+
set: function ( value ) {
85+
86+
this.uniforms[ 'onlyAO' ].value = value;
87+
88+
}
7389
},
7490

7591
aoClamp: {
76-
get: function() { return this.uniforms[ 'aoClamp' ].value; },
77-
set: function( value ) { this.uniforms[ 'aoClamp' ].value = value; }
92+
get: function () {
93+
94+
return this.uniforms[ 'aoClamp' ].value;
95+
96+
},
97+
set: function ( value ) {
98+
99+
this.uniforms[ 'aoClamp' ].value = value;
100+
101+
}
78102
},
79103

80104
lumInfluence: {
81-
get: function() { return this.uniforms[ 'lumInfluence' ].value; },
82-
set: function( value ) { this.uniforms[ 'lumInfluence' ].value = value; }
105+
get: function () {
106+
107+
return this.uniforms[ 'lumInfluence' ].value;
108+
109+
},
110+
set: function ( value ) {
111+
112+
this.uniforms[ 'lumInfluence' ].value = value;
113+
114+
}
83115
},
84116

85-
});
86-
}
117+
} );
118+
119+
};
87120

88121
THREE.SSAOPass.prototype = Object.create( THREE.ShaderPass.prototype );
89122

90123
/**
91124
* Render using this pass.
92-
*
125+
*
93126
* @method render
94127
* @param {WebGLRenderer} renderer
95128
* @param {WebGLRenderTarget} writeBuffer Buffer to write output.
96129
* @param {WebGLRenderTarget} readBuffer Input buffer.
97130
* @param {Number} delta Delta time in milliseconds.
98131
* @param {Boolean} maskActive Not used in this pass.
99132
*/
100-
THREE.SSAOPass.prototype.render = function( renderer, writeBuffer, readBuffer, delta, maskActive ) {
133+
THREE.SSAOPass.prototype.render = function ( renderer, writeBuffer, readBuffer, delta, maskActive ) {
101134

102135
//Render depth into depthRenderTarget
103136
this.scene2.overrideMaterial = this.depthMaterial;
104-
137+
105138
renderer.render( this.scene2, this.camera2, this.depthRenderTarget, true );
106-
139+
107140
this.scene2.overrideMaterial = null;
108141

109142

@@ -118,8 +151,8 @@ THREE.SSAOPass.prototype.render = function( renderer, writeBuffer, readBuffer, d
118151
* @method setScene
119152
* @param {Scene} scene
120153
*/
121-
THREE.SSAOPass.prototype.setScene = function(scene) {
122-
154+
THREE.SSAOPass.prototype.setScene = function ( scene ) {
155+
123156
this.scene2 = scene;
124157

125158
};
@@ -130,7 +163,7 @@ THREE.SSAOPass.prototype.setScene = function(scene) {
130163
* @method setCamera
131164
* @param {Camera} camera
132165
*/
133-
THREE.SSAOPass.prototype.setCamera = function( camera ) {
166+
THREE.SSAOPass.prototype.setCamera = function ( camera ) {
134167

135168
this.camera2 = camera;
136169

@@ -141,12 +174,12 @@ THREE.SSAOPass.prototype.setCamera = function( camera ) {
141174

142175
/**
143176
* Set resolution of this render pass.
144-
*
177+
*
145178
* @method setSize
146179
* @param {Number} width
147180
* @param {Number} height
148181
*/
149-
THREE.SSAOPass.prototype.setSize = function( width, height ) {
182+
THREE.SSAOPass.prototype.setSize = function ( width, height ) {
150183

151184
this.width = width;
152185
this.height = height;

examples/webgl_buffergeometry_instancing.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@
129129

130130
var vector = new THREE.Vector4();
131131

132-
var triangles = 1;
133132
var instances = 50000;
134133

135134
var positions = [];

examples/webgl_geometries.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
scene = new THREE.Scene();
5555

56-
var light, object;
56+
var object;
5757

5858
var ambientLight = new THREE.AmbientLight( 0xcccccc, 0.4 );
5959
scene.add( ambientLight );

examples/webgl_geometry_minecraft_ao.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@
160160
//
161161

162162
var geometry = new THREE.Geometry();
163-
var dummy = new THREE.Mesh();
164163

165164
for ( var z = 0; z < worldDepth; z ++ ) {
166165

examples/webgl_lights_pointlights2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@
217217
function render() {
218218

219219
var time = Date.now() * 0.00025;
220-
var z = 20, d = 150;
220+
var d = 150;
221221

222222
light1.position.x = Math.sin( time * 0.7 ) * d;
223223
light1.position.z = Math.cos( time * 0.3 ) * d;

examples/webgl_lines_sphere.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
scene = new THREE.Scene();
7676

77-
var i, line, vertex1, vertex2, material, p,
77+
var i, line, material, p,
7878
parameters = [ [ 0.25, 0xff7700, 1, 2 ], [ 0.5, 0xff9900, 1, 1 ], [ 0.75, 0xffaa00, 0.75, 1 ], [ 1, 0xffaa00, 0.5, 1 ], [ 1.25, 0x000833, 0.8, 1 ],
7979
[ 3.0, 0xaaaaaa, 0.75, 2 ], [ 3.5, 0xffffff, 0.5, 1 ], [ 4.5, 0xffffff, 0.25, 1 ], [ 5.5, 0xffffff, 0.125, 1 ] ];
8080

examples/webgl_materials_curvature.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@
338338
topologyFolder.add( params, 'filterConvex' );
339339
topologyFolder.add( params, 'filterConcave' );
340340
topologyFolder.add( params, 'filterBoth' );
341-
topologyFolder.open()
341+
topologyFolder.open();
342342

343343
onWindowResize();
344344

0 commit comments

Comments
 (0)