TSL : PositionLocal
Channel Membership :
Playlist : • Three Shader Language (TSL)
Documentation : https://sbcode.net/tsl/positionLocal
You will find in almost all fragment shaders, the use of some kind of positional coordinates. The positional coordinates are interpolated from left and right, up and down as each pixel colour is calculated.
In TSL, we can use `positionLocal` to get the fragment shaders current positional coordinate.
import { positionLocal } from 'three/tsl'
This value essentially comes from the `BufferGeometry.attributes.position`.
So, depending where we are on the scan, the coordinate will be a different value, and we can use that to output a different color.
On a 2D plane, the coordinates will behave like X, Y coordinates on a graph.
#three
#threejs
#tsl
#threeShaderLanguage
Other Videos By SBCODE
2025-02-19 | TSL : Distance Lines |
2025-02-18 | TSL : Signed Distance Fields |
2025-02-17 | #ScratchedWoodenFloor |
2025-02-15 | #jammedFurler |
2025-02-14 | TSL : Uniform and UniformArray |
2025-02-13 | #jammedFurler #thamesEstuary |
2025-02-13 | TSL : Lines - Part 2 |
2025-02-13 | TSL : Lines - Part 1 |
2025-02-12 | #threeshaderlanguage #tsl #threejs |
2025-02-11 | Three Shader Language Patterns |
2025-02-10 | TSL : PositionLocal |
2025-02-10 | TSL : What Do We Have |
2025-02-10 | TSL : Getting Started |
2025-02-08 | #hangkai #outboard #sparkplug |
2025-02-06 | #eyecontact #gazecorrection #nvidiabroadcast |
2025-02-05 | #eyecontact #gazecorrection #noblink |
2025-02-04 | #drillingholes |
2025-02-03 | #vaillant #ecotec |
2025-02-01 | #sonicare #electrictoothbrush |
2025-01-31 | #oscilloscope |
2025-01-30 | #stirlingengine |