未验证 提交 f3fc0551 编写于 作者: R Rémi Tran 提交者: GitHub

Examples: Postprocessing fullscreen triangle optimization (#21358)

* Examples: Postprocessing fullscreen triangle

* Examples: Postprocessing fullscreen triangle indent
上级 6f11651b
......@@ -261,7 +261,11 @@ Object.assign( THREE.Pass.prototype, {
THREE.Pass.FullScreenQuad = ( function () {
var camera = new THREE.OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
var geometry = new THREE.PlaneGeometry( 2, 2 );
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));
var FullScreenQuad = function ( material ) {
......
......@@ -3,7 +3,8 @@ import {
LinearFilter,
Mesh,
OrthographicCamera,
PlaneGeometry,
BufferGeometry,
BufferAttribute,
RGBAFormat,
Vector2,
WebGLRenderTarget
......@@ -276,7 +277,11 @@ Object.assign( Pass.prototype, {
Pass.FullScreenQuad = ( function () {
var camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
var geometry = new PlaneGeometry( 2, 2 );
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));
var FullScreenQuad = function ( material ) {
......
import {
OrthographicCamera,
PlaneGeometry,
BufferGeometry,
BufferAttribute,
Mesh
} from '../../../build/three.module.js';
......@@ -41,7 +42,11 @@ Object.assign( Pass.prototype, {
Pass.FullScreenQuad = ( function () {
var camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
var geometry = new PlaneGeometry( 2, 2 );
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));
var FullScreenQuad = function ( material ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册