preact
This commit is contained in:
parent
6acf267d48
commit
b7614eb3f8
4794 changed files with 1280808 additions and 1546 deletions
40
frontend/node_modules/three/examples/jsm/nodes/display/FrontFacingNode.js
generated
vendored
Normal file
40
frontend/node_modules/three/examples/jsm/nodes/display/FrontFacingNode.js
generated
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import Node, { addNodeClass } from '../core/Node.js';
|
||||
import { nodeImmutable, float } from '../shadernode/ShaderNode.js';
|
||||
import { BackSide, WebGLCoordinateSystem } from 'three';
|
||||
|
||||
class FrontFacingNode extends Node {
|
||||
|
||||
constructor() {
|
||||
|
||||
super( 'bool' );
|
||||
|
||||
this.isFrontFacingNode = true;
|
||||
|
||||
}
|
||||
|
||||
generate( builder ) {
|
||||
|
||||
const { renderer, material } = builder;
|
||||
|
||||
if ( renderer.coordinateSystem === WebGLCoordinateSystem ) {
|
||||
|
||||
if ( material.side === BackSide ) {
|
||||
|
||||
return 'false';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return builder.getFrontFacing();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default FrontFacingNode;
|
||||
|
||||
export const frontFacing = nodeImmutable( FrontFacingNode );
|
||||
export const faceDirection = float( frontFacing ).mul( 2.0 ).sub( 1.0 );
|
||||
|
||||
addNodeClass( 'FrontFacingNode', FrontFacingNode );
|
||||
Loading…
Add table
Add a link
Reference in a new issue