preact
This commit is contained in:
parent
6acf267d48
commit
b7614eb3f8
4794 changed files with 1280808 additions and 1546 deletions
31
frontend/node_modules/three/examples/jsm/nodes/functions/ShadowMaskModel.js
generated
vendored
Normal file
31
frontend/node_modules/three/examples/jsm/nodes/functions/ShadowMaskModel.js
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import LightingModel from '../core/LightingModel.js';
|
||||
import { diffuseColor } from '../core/PropertyNode.js';
|
||||
import { float } from '../shadernode/ShaderNode.js';
|
||||
|
||||
class ShadowMaskModel extends LightingModel {
|
||||
|
||||
constructor() {
|
||||
|
||||
super();
|
||||
|
||||
this.shadowNode = float( 1 ).toVar( 'shadowMask' );
|
||||
|
||||
}
|
||||
|
||||
direct( { shadowMask } ) {
|
||||
|
||||
this.shadowNode.mulAssign( shadowMask );
|
||||
|
||||
}
|
||||
|
||||
finish( context ) {
|
||||
|
||||
diffuseColor.a.mulAssign( this.shadowNode.oneMinus() );
|
||||
|
||||
context.outgoingLight.rgb.assign( diffuseColor.rgb ); // TODO: Optimize LightsNode to avoid this assignment
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ShadowMaskModel;
|
||||
Loading…
Add table
Add a link
Reference in a new issue