mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 19:42:38 +02:00
This commit is contained in:
parent
f0f62670c5
commit
7e26256cac
4563 changed files with 1246712 additions and 17558 deletions
62
node_modules/three/examples/jsm/nodes/accessors/ScreenUVNode.js
generated
vendored
Normal file
62
node_modules/three/examples/jsm/nodes/accessors/ScreenUVNode.js
generated
vendored
Normal file
|
@ -0,0 +1,62 @@
|
|||
import { TempNode } from '../core/TempNode.js';
|
||||
import { ResolutionNode } from './ResolutionNode.js';
|
||||
|
||||
function ScreenUVNode( resolution ) {
|
||||
|
||||
TempNode.call( this, 'v2' );
|
||||
|
||||
this.resolution = resolution || new ResolutionNode();
|
||||
|
||||
}
|
||||
|
||||
ScreenUVNode.prototype = Object.create( TempNode.prototype );
|
||||
ScreenUVNode.prototype.constructor = ScreenUVNode;
|
||||
ScreenUVNode.prototype.nodeType = 'ScreenUV';
|
||||
|
||||
ScreenUVNode.prototype.generate = function ( builder, output ) {
|
||||
|
||||
var result;
|
||||
|
||||
if ( builder.isShader( 'fragment' ) ) {
|
||||
|
||||
result = '( gl_FragCoord.xy / ' + this.resolution.build( builder, 'v2' ) + ')';
|
||||
|
||||
} else {
|
||||
|
||||
console.warn( 'THREE.ScreenUVNode is not compatible with ' + builder.shader + ' shader.' );
|
||||
|
||||
result = 'vec2( 0.0 )';
|
||||
|
||||
}
|
||||
|
||||
return builder.format( result, this.getType( builder ), output );
|
||||
|
||||
};
|
||||
|
||||
ScreenUVNode.prototype.copy = function ( source ) {
|
||||
|
||||
TempNode.prototype.copy.call( this, source );
|
||||
|
||||
this.resolution = source.resolution;
|
||||
|
||||
return this;
|
||||
|
||||
};
|
||||
|
||||
ScreenUVNode.prototype.toJSON = function ( meta ) {
|
||||
|
||||
var data = this.getJSONNode( meta );
|
||||
|
||||
if ( ! data ) {
|
||||
|
||||
data = this.createJSONNode( meta );
|
||||
|
||||
data.resolution = this.resolution.toJSON( meta ).uuid;
|
||||
|
||||
}
|
||||
|
||||
return data;
|
||||
|
||||
};
|
||||
|
||||
export { ScreenUVNode };
|
Loading…
Add table
Add a link
Reference in a new issue