Skip to content

Commit 0e8e043

Browse files
committed
EffectComposer: Clean up.
1 parent f3fc055 commit 0e8e043

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

examples/js/postprocessing/EffectComposer.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,11 +261,12 @@ Object.assign( THREE.Pass.prototype, {
261261
THREE.Pass.FullScreenQuad = ( function () {
262262

263263
var camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
264+
265+
// https://github.com/mrdoob/three.js/pull/21358
266+
264267
var geometry = new THREE.BufferGeometry();
265-
const vertices = new Float32Array([-1, 3, 0, -1, -1, 0, 3, -1, 0]);
266-
geometry.setAttribute("position", new THREE.BufferAttribute(vertices, 3));
267-
const uv = new Float32Array([0, 2, 0, 0, 2, 0]);
268-
geometry.setAttribute("uv", new THREE.BufferAttribute(uv, 2));
268+
geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );
269+
geometry.setAttribute( 'uv', new THREE.Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );
269270

270271
var FullScreenQuad = function ( material ) {
271272

examples/jsm/postprocessing/EffectComposer.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {
2+
BufferGeometry,
23
Clock,
4+
Float32BufferAttribute,
35
LinearFilter,
46
Mesh,
57
OrthographicCamera,
6-
BufferGeometry,
7-
BufferAttribute,
88
RGBAFormat,
99
Vector2,
1010
WebGLRenderTarget
@@ -277,11 +277,12 @@ Object.assign( Pass.prototype, {
277277
Pass.FullScreenQuad = ( function () {
278278

279279
var camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
280+
281+
// https://github.com/mrdoob/three.js/pull/21358
282+
280283
var geometry = new BufferGeometry();
281-
const vertices = new Float32Array([-1, 3, 0, -1, -1, 0, 3, -1, 0]);
282-
geometry.setAttribute("position", new BufferAttribute(vertices, 3));
283-
const uv = new Float32Array([0, 2, 0, 0, 2, 0]);
284-
geometry.setAttribute("uv", new BufferAttribute(uv, 2));
284+
geometry.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );
285+
geometry.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );
285286

286287
var FullScreenQuad = function ( material ) {
287288

examples/jsm/postprocessing/Pass.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
2-
OrthographicCamera,
32
BufferGeometry,
4-
BufferAttribute,
3+
Float32BufferAttribute,
4+
OrthographicCamera,
55
Mesh
66
} from '../../../build/three.module.js';
77

@@ -42,11 +42,12 @@ Object.assign( Pass.prototype, {
4242
Pass.FullScreenQuad = ( function () {
4343

4444
var camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
45+
46+
// https://github.com/mrdoob/three.js/pull/21358
47+
4548
var geometry = new BufferGeometry();
46-
const vertices = new Float32Array([-1, 3, 0, -1, -1, 0, 3, -1, 0]);
47-
geometry.setAttribute("position", new BufferAttribute(vertices, 3));
48-
const uv = new Float32Array([0, 2, 0, 0, 2, 0]);
49-
geometry.setAttribute("uv", new BufferAttribute(uv, 2));
49+
geometry.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );
50+
geometry.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );
5051

5152
var FullScreenQuad = function ( material ) {
5253

0 commit comments

Comments
 (0)