Skip to content

Commit

Permalink
EffectComposer: Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Mar 30, 2021
1 parent f3fc055 commit 0e8e043
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
9 changes: 5 additions & 4 deletions examples/js/postprocessing/EffectComposer.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,12 @@ Object.assign( THREE.Pass.prototype, {
THREE.Pass.FullScreenQuad = ( function () {

This comment has been minimized.

Copy link
@takahirox

takahirox Mar 30, 2021

Collaborator

Do you think we should rename FullScreenQuad to FullScreenTriangle?

This comment has been minimized.

Copy link
@mrdoob

mrdoob Mar 31, 2021

Author Owner

Good catch! Probably not worth the possible side effects though...
Hoping to finally move all this inside the renderer soon anyway!


var camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );

// https://github.com/mrdoob/three.js/pull/21358

var geometry = new THREE.BufferGeometry();
const vertices = new Float32Array([-1, 3, 0, -1, -1, 0, 3, -1, 0]);
geometry.setAttribute("position", new THREE.BufferAttribute(vertices, 3));
const uv = new Float32Array([0, 2, 0, 0, 2, 0]);
geometry.setAttribute("uv", new THREE.BufferAttribute(uv, 2));
geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );
geometry.setAttribute( 'uv', new THREE.Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );

var FullScreenQuad = function ( material ) {

Expand Down
13 changes: 7 additions & 6 deletions examples/jsm/postprocessing/EffectComposer.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
BufferGeometry,
Clock,
Float32BufferAttribute,
LinearFilter,
Mesh,
OrthographicCamera,
BufferGeometry,
BufferAttribute,
RGBAFormat,
Vector2,
WebGLRenderTarget
Expand Down Expand Up @@ -277,11 +277,12 @@ Object.assign( Pass.prototype, {
Pass.FullScreenQuad = ( function () {

var camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );

// https://github.com/mrdoob/three.js/pull/21358

var geometry = new BufferGeometry();
const vertices = new Float32Array([-1, 3, 0, -1, -1, 0, 3, -1, 0]);
geometry.setAttribute("position", new BufferAttribute(vertices, 3));
const uv = new Float32Array([0, 2, 0, 0, 2, 0]);
geometry.setAttribute("uv", new BufferAttribute(uv, 2));
geometry.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );
geometry.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );

var FullScreenQuad = function ( material ) {

Expand Down
13 changes: 7 additions & 6 deletions examples/jsm/postprocessing/Pass.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
OrthographicCamera,
BufferGeometry,
BufferAttribute,
Float32BufferAttribute,
OrthographicCamera,
Mesh
} from '../../../build/three.module.js';

Expand Down Expand Up @@ -42,11 +42,12 @@ Object.assign( Pass.prototype, {
Pass.FullScreenQuad = ( function () {

var camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );

// https://github.com/mrdoob/three.js/pull/21358

var geometry = new BufferGeometry();
const vertices = new Float32Array([-1, 3, 0, -1, -1, 0, 3, -1, 0]);
geometry.setAttribute("position", new BufferAttribute(vertices, 3));
const uv = new Float32Array([0, 2, 0, 0, 2, 0]);
geometry.setAttribute("uv", new BufferAttribute(uv, 2));
geometry.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );
geometry.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );

var FullScreenQuad = function ( material ) {

Expand Down

0 comments on commit 0e8e043

Please sign in to comment.