summit/frontend/node_modules/three-stdlib/lights/RectAreaLightUniformsLib.cj...

1 line
847 KiB
Plaintext
Raw Normal View History

2025-12-08 16:31:30 +00:00
{"version":3,"file":"RectAreaLightUniformsLib.cjs","sources":["../../src/lights/RectAreaLightUniformsLib.js"],"sourcesContent":["import {\n ClampToEdgeWrapping,\n DataTexture,\n DataUtils,\n FloatType,\n HalfFloatType,\n LinearFilter,\n NearestFilter,\n RGBAFormat,\n UVMapping,\n UniformsLib,\n} from 'three'\n\n/**\n * Uniforms library for RectAreaLight shared webgl shaders\n *\n * NOTE: This is a temporary location for the BRDF approximation texture data\n * based off of Eric Heitz's work (see citation below). BRDF data for\n * RectAreaLight is currently approximated using a precomputed texture\n * of roughly 80kb in size. The hope is to find a better way to include\n * the large texture data before including the full RectAreaLight implementation\n * in the main build files.\n *\n * TODO: figure out a way to compress the LTC BRDF data\n */\n\n// Real-Time Polygonal-Light Shading with Linearly Transformed Cosines\n// by Eric Heitz, Jonathan Dupuy, Stephen Hill and David Neubelt\n// code: https://github.com/selfshadow/ltc_code/\n\nconst RectAreaLightUniformsLib = {\n init() {\n // source: https://github.com/selfshadow/ltc_code/tree/master/fit/results/ltc.js\n\n const LTC_MAT_1 = [\n 1,\n 0,\n 0,\n 2e-5,\n 1,\n 0,\n 0,\n 0.000503905,\n 1,\n 0,\n 0,\n 0.00201562,\n 1,\n 0,\n 0,\n 0.00453516,\n 1,\n 0,\n 0,\n 0.00806253,\n 1,\n 0,\n 0,\n 0.0125978,\n 1,\n 0,\n 0,\n 0.018141,\n 1,\n 0,\n 0,\n 0.0246924,\n 1,\n 0,\n 0,\n 0.0322525,\n 1,\n 0,\n 0,\n 0.0408213,\n 1,\n 0,\n 0,\n 0.0503999,\n 1,\n 0,\n 0,\n 0.0609894,\n 1,\n 0,\n 0,\n 0.0725906,\n 1,\n 0,\n 0,\n 0.0852058,\n 1,\n 0,\n 0,\n 0.0988363,\n 1,\n 0,\n 0,\n 0.113484,\n 1,\n 0,\n 0,\n 0.129153,\n 1,\n 0,\n 0,\n 0.145839,\n 1,\n 0,\n 0,\n 0.163548,\n 1,\n 0,\n 0,\n 0.182266,\n 1,\n 0,\n 0,\n 0.201942,\n 1,\n 0,\n 0,\n 0.222314,\n 1,\n 0,\n 0,\n 0.241906,\n 1,\n 0,\n 0,\n 0.262314,\n 1,\n 0,\n 0,\n 0.285754,\n 1,\n 0,\n 0,\n 0.310159,\n 1,\n 0,\n 0,\n 0.335426,\n 1,\n 0,\n 0,\n 0.361341,\n 1,\n 0,\n 0,\n 0.387445,\n 1,\n 0,\n 0,\n 0.412784,\n 1,\n 0,\n 0,\n 0.438197,\n 1,\n 0,\n 0,\n 0.466966,\n 1,\n 0,\n 0,\n 0.49559,\n 1,\n 0,\n 0,\n 0.523448,\n 1,\n 0,\n 0,\n 0.549938,\n 1,\n 0,\n 0,\n 0.57979,\n 1,\n 0,\n 0,\n 0.608746,\n 1,\n 0,\n 0,\n 0.636185,\n 1,\n 0,\n 0,\n 0.664748,\n 1,\n 0,\n 0,\n 0.69313,\n 1,\n 0,\n 0,\n 0.71966,\n 1,\n 0,\n 0,\n 0.747662,\n 1,\n 0,\n 0,\n 0.774023,\n 1,\n 0,\n 0,\n 0.799775,\n 1,\n 0,\n 0,\n 0.825274,\n 1,\n 0,\n 0,\n 0.849156,\n 1,\n 0,\n 0,\n 0.873248,\n 1,\n 0,\n 0,\n 0.89532,\n 1,\n 0,\n 0,\n 0.917565,\n 1,\n 0,\n 0,\n 0.937863,\n 1,\n 0,\n 0,\n 0.958139,\n 1,\n 0,\n 0,\n 0.976563,\n 1,\n 0,\n 0,\n 0.994658,\n 1,\n 0,\n 0,\n 1.0112,\n 1,\n 0,\n 0,\n 1.02712,\n 1,\n 0,\n 0,\n 1.04189,\n 1,\n 0,\n 0,\n 1.05568,\n 1,\n 0,\n 0,\n 1.06877,\n 1,\n 0,\n 0,\n 1.08058,\n 1,\n 0,\n 0,\n 1.09194,\n 1,\n 0,\n