You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
515 B
27 lines
515 B
import FogNode from './FogNode.js';
|
|
import { smoothstep, negate, positionView } from '../shadernode/ShaderNodeBaseElements.js';
|
|
|
|
class FogRangeNode extends FogNode {
|
|
|
|
constructor( colorNode, nearNode, farNode ) {
|
|
|
|
super( colorNode );
|
|
|
|
this.isFogRangeNode = true;
|
|
|
|
this.nearNode = nearNode;
|
|
this.farNode = farNode;
|
|
|
|
}
|
|
|
|
generate( builder ) {
|
|
|
|
this.factorNode = smoothstep( this.nearNode, this.farNode, negate( positionView.z ) );
|
|
|
|
return super.generate( builder );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export default FogRangeNode;
|
|
|