12345678910111213141516171819202122232425262728293031 |
- import Node from '../core/Node.js';
- import {
- transformedNormalView, positionViewDirection,
- transformDirection, negate, reflect, cameraViewMatrix
- } from '../shadernode/ShaderNodeBaseElements.js';
- class ReflectVectorNode extends Node {
- constructor() {
- super( 'vec3' );
- }
- getHash( /*builder*/ ) {
- return 'reflectVector';
- }
- construct() {
- const reflectView = reflect( negate( positionViewDirection ), transformedNormalView );
- return transformDirection( reflectView, cameraViewMatrix );
- }
- }
- export default ReflectVectorNode;
|