poppygl 0.0.27 → 0.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -503,6 +503,12 @@ function srgbEncodeLinear01(linear) {
|
|
|
503
503
|
return 1.055 * Math.pow(linear, 1 / 2.4) - 0.055;
|
|
504
504
|
}
|
|
505
505
|
|
|
506
|
+
// lib/utils/srgbDecodeToLinear01.ts
|
|
507
|
+
function srgbDecodeToLinear01(srgb) {
|
|
508
|
+
if (srgb <= 0.04045) return srgb / 12.92;
|
|
509
|
+
return ((srgb + 0.055) / 1.055) ** 2.4;
|
|
510
|
+
}
|
|
511
|
+
|
|
506
512
|
// lib/utils/clamp.ts
|
|
507
513
|
var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
508
514
|
|
|
@@ -808,7 +814,12 @@ var SoftwareRenderer = class {
|
|
|
808
814
|
uvp[0],
|
|
809
815
|
uvp[1]
|
|
810
816
|
);
|
|
811
|
-
baseColor = mulColor(baseColor,
|
|
817
|
+
baseColor = mulColor(baseColor, [
|
|
818
|
+
srgbDecodeToLinear01(texel[0]),
|
|
819
|
+
srgbDecodeToLinear01(texel[1]),
|
|
820
|
+
srgbDecodeToLinear01(texel[2]),
|
|
821
|
+
texel[3]
|
|
822
|
+
]);
|
|
812
823
|
}
|
|
813
824
|
const [cr, cg, cb] = this.perspInterp(cs, invW, [l0, l1, l2]);
|
|
814
825
|
baseColor = [
|