Buckets:
| import { Fn } from '../tsl/TSLBase.js'; | |
| /** | |
| * Represents a `discard` shader operation in TSL. | |
| * | |
| * @method | |
| * @param {Object} inputs - The input parameter object. | |
| * @param {Node<float>} inputs.lightDistance - The distance of the light's position to the current fragment position. | |
| * @param {Node<float>} inputs.cutoffDistance - The light's cutoff distance. | |
| * @param {Node<float>} inputs.decayExponent - The light's decay exponent. | |
| * @return {Node<float>} The distance falloff. | |
| */ | |
| export const getDistanceAttenuation = /*@__PURE__*/ Fn( ( { lightDistance, cutoffDistance, decayExponent } ) => { | |
| // based upon Frostbite 3 Moving to Physically-based Rendering | |
| // page 32, equation 26: E[window1] | |
| // https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf | |
| const distanceFalloff = lightDistance.pow( decayExponent ).max( 0.01 ).reciprocal(); | |
| return cutoffDistance.greaterThan( 0 ).select( | |
| distanceFalloff.mul( lightDistance.div( cutoffDistance ).pow4().oneMinus().clamp().pow2() ), | |
| distanceFalloff | |
| ); | |
| } ); // validated | |
Xet Storage Details
- Size:
- 1.07 kB
- Xet hash:
- 1b6ffb9faa3764567103a444b0f24d8efd3ef8eb950caf48a746555e913591e6
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.