Buckets:
| import { attribute } from '../core/AttributeNode.js'; | |
| import { cameraViewMatrix } from './Camera.js'; | |
| import { modelViewMatrix } from './ModelNode.js'; | |
| import { Fn, vec4 } from '../tsl/TSLBase.js'; | |
| /** | |
| * TSL object that represents the tangent attribute of the current rendered object. | |
| * | |
| * @tsl | |
| * @type {Node<vec4>} | |
| */ | |
| export const tangentGeometry = /*@__PURE__*/ Fn( ( builder ) => { | |
| if ( builder.geometry.hasAttribute( 'tangent' ) === false ) { | |
| builder.geometry.computeTangents(); | |
| } | |
| return attribute( 'tangent', 'vec4' ); | |
| } )(); | |
| /** | |
| * TSL object that represents the vertex tangent in local space of the current rendered object. | |
| * | |
| * @tsl | |
| * @type {Node<vec3>} | |
| */ | |
| export const tangentLocal = /*@__PURE__*/ tangentGeometry.xyz.toVar( 'tangentLocal' ); | |
| /** | |
| * TSL object that represents the vertex tangent in view space of the current rendered object. | |
| * | |
| * @tsl | |
| * @type {Node<vec3>} | |
| */ | |
| export const tangentView = /*@__PURE__*/ modelViewMatrix.mul( vec4( tangentLocal, 0 ) ).xyz.toVarying( 'v_tangentView' ).normalize().toVar( 'tangentView' ); | |
| /** | |
| * TSL object that represents the vertex tangent in world space of the current rendered object. | |
| * | |
| * @tsl | |
| * @type {Node<vec3>} | |
| */ | |
| export const tangentWorld = /*@__PURE__*/ tangentView.transformDirection( cameraViewMatrix ).toVarying( 'v_tangentWorld' ).normalize().toVar( 'tangentWorld' ); | |
| /** | |
| * TSL object that represents the transformed vertex tangent in view space of the current rendered object. | |
| * | |
| * @tsl | |
| * @type {Node<vec3>} | |
| */ | |
| export const transformedTangentView = /*@__PURE__*/ tangentView.toVar( 'transformedTangentView' ); | |
| /** | |
| * TSL object that represents the transformed vertex tangent in world space of the current rendered object. | |
| * | |
| * @tsl | |
| * @type {Node<vec3>} | |
| */ | |
| export const transformedTangentWorld = /*@__PURE__*/ transformedTangentView.transformDirection( cameraViewMatrix ).normalize().toVar( 'transformedTangentWorld' ); | |
Xet Storage Details
- Size:
- 1.92 kB
- Xet hash:
- 0c673fd00ec44b98e33bce0df1b1e2e6089286a9909af13b3809195396522201
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.