mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 10:49:36 +02:00
This commit is contained in:
parent
f0f62670c5
commit
7e26256cac
4563 changed files with 1246712 additions and 17558 deletions
17
node_modules/three/examples/jsm/nodes/postprocessing/NodePass.d.ts
generated
vendored
Normal file
17
node_modules/three/examples/jsm/nodes/postprocessing/NodePass.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { ShaderPass } from '../../postprocessing/ShaderPass';
|
||||
import { ScreenNode } from '../inputs/ScreenNode';
|
||||
|
||||
export class NodePass extends ShaderPass {
|
||||
|
||||
constructor();
|
||||
|
||||
name: string;
|
||||
uuid: string;
|
||||
userData: object;
|
||||
input: ScreenNode;
|
||||
needsUpdate: boolean;
|
||||
|
||||
copy( source: NodePass ): this;
|
||||
toJSON( meta?: object | string ): object;
|
||||
|
||||
}
|
92
node_modules/three/examples/jsm/nodes/postprocessing/NodePass.js
generated
vendored
Normal file
92
node_modules/three/examples/jsm/nodes/postprocessing/NodePass.js
generated
vendored
Normal file
|
@ -0,0 +1,92 @@
|
|||
import { MathUtils } from '../../../../build/three.module.js';
|
||||
|
||||
import { ShaderPass } from '../../postprocessing/ShaderPass.js';
|
||||
import { NodeMaterial } from '../materials/NodeMaterial.js';
|
||||
import { ScreenNode } from '../inputs/ScreenNode.js';
|
||||
|
||||
function NodePass() {
|
||||
|
||||
ShaderPass.call( this );
|
||||
|
||||
this.name = '';
|
||||
this.uuid = MathUtils.generateUUID();
|
||||
|
||||
this.userData = {};
|
||||
|
||||
this.textureID = 'renderTexture';
|
||||
|
||||
this.input = new ScreenNode();
|
||||
|
||||
this.material = new NodeMaterial();
|
||||
|
||||
this.needsUpdate = true;
|
||||
|
||||
}
|
||||
|
||||
NodePass.prototype = Object.create( ShaderPass.prototype );
|
||||
NodePass.prototype.constructor = NodePass;
|
||||
|
||||
NodePass.prototype.render = function () {
|
||||
|
||||
if ( this.needsUpdate ) {
|
||||
|
||||
this.material.dispose();
|
||||
|
||||
this.material.fragment.value = this.input;
|
||||
|
||||
this.needsUpdate = false;
|
||||
|
||||
}
|
||||
|
||||
this.uniforms = this.material.uniforms;
|
||||
|
||||
ShaderPass.prototype.render.apply( this, arguments );
|
||||
|
||||
};
|
||||
|
||||
NodePass.prototype.copy = function ( source ) {
|
||||
|
||||
this.input = source.input;
|
||||
|
||||
return this;
|
||||
|
||||
};
|
||||
|
||||
NodePass.prototype.toJSON = function ( meta ) {
|
||||
|
||||
var isRootObject = ( meta === undefined || typeof meta === 'string' );
|
||||
|
||||
if ( isRootObject ) {
|
||||
|
||||
meta = {
|
||||
nodes: {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
if ( meta && ! meta.passes ) meta.passes = {};
|
||||
|
||||
if ( ! meta.passes[ this.uuid ] ) {
|
||||
|
||||
var data = {};
|
||||
|
||||
data.uuid = this.uuid;
|
||||
data.type = 'NodePass';
|
||||
|
||||
meta.passes[ this.uuid ] = data;
|
||||
|
||||
if ( this.name !== '' ) data.name = this.name;
|
||||
|
||||
if ( JSON.stringify( this.userData ) !== '{}' ) data.userData = this.userData;
|
||||
|
||||
data.input = this.input.toJSON( meta ).uuid;
|
||||
|
||||
}
|
||||
|
||||
meta.pass = this.uuid;
|
||||
|
||||
return meta;
|
||||
|
||||
};
|
||||
|
||||
export { NodePass };
|
35
node_modules/three/examples/jsm/nodes/postprocessing/NodePostProcessing.d.ts
generated
vendored
Normal file
35
node_modules/three/examples/jsm/nodes/postprocessing/NodePostProcessing.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
import {
|
||||
Camera,
|
||||
Mesh,
|
||||
OrthographicCamera,
|
||||
Scene,
|
||||
WebGLRenderer,
|
||||
WebGLRenderTarget,
|
||||
} from '../../../../src/Three';
|
||||
|
||||
import { ScreenNode } from '../inputs/ScreenNode';
|
||||
import { NodeMaterial } from '../materials/NodeMaterial';
|
||||
import { NodeFrame } from '../core/NodeFrame';
|
||||
|
||||
export class NodePostProcessing {
|
||||
|
||||
constructor( renderer: WebGLRenderer, renderTarget?: WebGLRenderTarget );
|
||||
|
||||
renderer: WebGLRenderer;
|
||||
renderTarget: WebGLRenderTarget;
|
||||
|
||||
output: ScreenNode;
|
||||
material: NodeMaterial
|
||||
|
||||
camera: OrthographicCamera;
|
||||
scene: Scene;
|
||||
|
||||
quad: Mesh;
|
||||
needsUpdate: boolean;
|
||||
|
||||
render( scene: Scene, camera: Camera, frame: NodeFrame ): void;
|
||||
setSize( width: number, height: number ): void;
|
||||
copy( source: NodePostProcessing ): this;
|
||||
toJSON( meta?: object | string ): object;
|
||||
|
||||
}
|
150
node_modules/three/examples/jsm/nodes/postprocessing/NodePostProcessing.js
generated
vendored
Normal file
150
node_modules/three/examples/jsm/nodes/postprocessing/NodePostProcessing.js
generated
vendored
Normal file
|
@ -0,0 +1,150 @@
|
|||
import {
|
||||
LinearFilter,
|
||||
Mesh,
|
||||
OrthographicCamera,
|
||||
PlaneGeometry,
|
||||
RGBAFormat,
|
||||
Scene,
|
||||
Vector2,
|
||||
WebGLRenderTarget
|
||||
} from '../../../../build/three.module.js';
|
||||
|
||||
import { NodeMaterial } from '../materials/NodeMaterial.js';
|
||||
import { ScreenNode } from '../inputs/ScreenNode.js';
|
||||
|
||||
function NodePostProcessing( renderer, renderTarget ) {
|
||||
|
||||
if ( renderTarget === undefined ) {
|
||||
|
||||
var parameters = {
|
||||
minFilter: LinearFilter,
|
||||
magFilter: LinearFilter,
|
||||
format: RGBAFormat
|
||||
};
|
||||
|
||||
var size = renderer.getDrawingBufferSize( new Vector2() );
|
||||
renderTarget = new WebGLRenderTarget( size.width, size.height, parameters );
|
||||
|
||||
}
|
||||
|
||||
this.renderer = renderer;
|
||||
this.renderTarget = renderTarget;
|
||||
|
||||
this.output = new ScreenNode();
|
||||
this.material = new NodeMaterial();
|
||||
|
||||
this.camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
|
||||
this.scene = new Scene();
|
||||
|
||||
this.quad = new Mesh( new PlaneGeometry( 2, 2 ), this.material );
|
||||
this.quad.frustumCulled = false; // Avoid getting clipped
|
||||
this.scene.add( this.quad );
|
||||
|
||||
this.needsUpdate = true;
|
||||
|
||||
}
|
||||
|
||||
NodePostProcessing.prototype = {
|
||||
|
||||
constructor: NodePostProcessing,
|
||||
|
||||
render: function ( scene, camera, frame ) {
|
||||
|
||||
if ( this.needsUpdate ) {
|
||||
|
||||
this.material.dispose();
|
||||
|
||||
this.material.fragment.value = this.output;
|
||||
this.material.build();
|
||||
|
||||
if ( this.material.uniforms.renderTexture ) {
|
||||
|
||||
this.material.uniforms.renderTexture.value = this.renderTarget.texture;
|
||||
|
||||
}
|
||||
|
||||
this.needsUpdate = false;
|
||||
|
||||
}
|
||||
|
||||
frame.setRenderer( this.renderer )
|
||||
.setRenderTexture( this.renderTarget.texture );
|
||||
|
||||
this.renderer.setRenderTarget( this.renderTarget );
|
||||
this.renderer.render( scene, camera );
|
||||
|
||||
frame.updateNode( this.material );
|
||||
|
||||
this.renderer.setRenderTarget( null );
|
||||
this.renderer.render( this.scene, this.camera );
|
||||
|
||||
},
|
||||
|
||||
setPixelRatio: function ( value ) {
|
||||
|
||||
this.renderer.setPixelRatio( value );
|
||||
|
||||
var size = this.renderer.getSize( new Vector2() );
|
||||
|
||||
this.setSize( size.width, size.height );
|
||||
|
||||
},
|
||||
|
||||
setSize: function ( width, height ) {
|
||||
|
||||
var pixelRatio = this.renderer.getPixelRatio();
|
||||
|
||||
this.renderTarget.setSize( width * pixelRatio, height * pixelRatio );
|
||||
|
||||
this.renderer.setSize( width, height );
|
||||
|
||||
},
|
||||
|
||||
copy: function ( source ) {
|
||||
|
||||
this.output = source.output;
|
||||
|
||||
return this;
|
||||
|
||||
},
|
||||
|
||||
toJSON: function ( meta ) {
|
||||
|
||||
var isRootObject = ( meta === undefined || typeof meta === 'string' );
|
||||
|
||||
if ( isRootObject ) {
|
||||
|
||||
meta = {
|
||||
nodes: {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
if ( meta && ! meta.post ) meta.post = {};
|
||||
|
||||
if ( ! meta.post[ this.uuid ] ) {
|
||||
|
||||
var data = {};
|
||||
|
||||
data.uuid = this.uuid;
|
||||
data.type = 'NodePostProcessing';
|
||||
|
||||
meta.post[ this.uuid ] = data;
|
||||
|
||||
if ( this.name !== '' ) data.name = this.name;
|
||||
|
||||
if ( JSON.stringify( this.userData ) !== '{}' ) data.userData = this.userData;
|
||||
|
||||
data.output = this.output.toJSON( meta ).uuid;
|
||||
|
||||
}
|
||||
|
||||
meta.post = this.uuid;
|
||||
|
||||
return meta;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
export { NodePostProcessing };
|
Loading…
Add table
Add a link
Reference in a new issue