@triforge/compositor-core 0.1.2 → 0.1.3
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.
|
@@ -59,7 +59,7 @@ export class GlareStreaks extends BasePass {
|
|
|
59
59
|
uniform float length;
|
|
60
60
|
varying vec2 vUv;
|
|
61
61
|
|
|
62
|
-
float
|
|
62
|
+
float stLuma(vec3 c) { return dot(c, vec3(0.299, 0.587, 0.114)); }
|
|
63
63
|
|
|
64
64
|
vec4 sampleStreak(vec2 dir) {
|
|
65
65
|
vec4 acc = vec4(0.0);
|
|
@@ -68,7 +68,7 @@ export class GlareStreaks extends BasePass {
|
|
|
68
68
|
for (int i = 1; i <= ${sampleLength}; i++) {
|
|
69
69
|
vec2 uv = vUv + step * float(i) * strength;
|
|
70
70
|
vec4 samp = texture2D(tDiffuse, clamp(uv, 0.0, 1.0));
|
|
71
|
-
float lum =
|
|
71
|
+
float lum = stLuma(samp.rgb);
|
|
72
72
|
if (lum > threshold) acc += samp * att;
|
|
73
73
|
att *= fade;
|
|
74
74
|
}
|
package/dist/passes/LensFlare.js
CHANGED
|
@@ -46,7 +46,7 @@ export class LensFlare extends BasePass {
|
|
|
46
46
|
uniform float chromatic;
|
|
47
47
|
varying vec2 vUv;
|
|
48
48
|
|
|
49
|
-
float
|
|
49
|
+
float stLuma(vec3 c) { return dot(c, vec3(0.299, 0.587, 0.114)); }
|
|
50
50
|
|
|
51
51
|
vec3 sampleChromatic(vec2 uv, vec2 offset) {
|
|
52
52
|
vec2 r = clamp(uv + offset * (1.0 + chromatic * 0.1), 0.0, 1.0);
|
|
@@ -69,7 +69,7 @@ export class LensFlare extends BasePass {
|
|
|
69
69
|
float disp = 0.3 + fi * 0.25;
|
|
70
70
|
vec2 guv = vUv + ghost * disp;
|
|
71
71
|
vec3 samp = sampleChromatic(guv, ghost * 0.01 * fi);
|
|
72
|
-
float lum =
|
|
72
|
+
float lum = stLuma(samp);
|
|
73
73
|
if (lum > threshold) {
|
|
74
74
|
vec3 tint = mix(vec3(1.0, 0.8, 0.6), vec3(0.6, 0.8, 1.0), fract(fi * 0.37));
|
|
75
75
|
flare += samp * tint * (lum - threshold) * strength / fi;
|
|
@@ -81,7 +81,7 @@ export class LensFlare extends BasePass {
|
|
|
81
81
|
float haloBias = abs(dist - haloWidth);
|
|
82
82
|
float halo = smoothstep(0.05, 0.0, haloBias) * strength * 0.5;
|
|
83
83
|
vec4 haloCentre = texture2D(tDiffuse, clamp(vec2(0.5) + normalize(-ghost) * haloWidth, 0.0, 1.0));
|
|
84
|
-
if (
|
|
84
|
+
if (stLuma(haloCentre.rgb) > threshold) {
|
|
85
85
|
flare += haloCentre.rgb * halo;
|
|
86
86
|
}
|
|
87
87
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@triforge/compositor-core",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Blender-matched compositor
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Blender-matched post-processing compositor for Three.js — 28 passes (Bloom, Depth of Field, SSAO, SSR, LUT, Film Grain), backend-agnostic",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
@@ -19,7 +19,14 @@
|
|
|
19
19
|
"post-processing",
|
|
20
20
|
"compositor",
|
|
21
21
|
"blender",
|
|
22
|
-
"effects"
|
|
22
|
+
"effects",
|
|
23
|
+
"threejs",
|
|
24
|
+
"webgl",
|
|
25
|
+
"bloom",
|
|
26
|
+
"postprocessing",
|
|
27
|
+
"ssao",
|
|
28
|
+
"typescript",
|
|
29
|
+
"vfx"
|
|
23
30
|
],
|
|
24
31
|
"author": "Aftab Ibrahim Kazi",
|
|
25
32
|
"license": "MIT",
|
|
@@ -32,8 +39,8 @@
|
|
|
32
39
|
}
|
|
33
40
|
},
|
|
34
41
|
"devDependencies": {
|
|
35
|
-
"@types/three": "^0.
|
|
36
|
-
"three": "^0.
|
|
42
|
+
"@types/three": "^0.186.0",
|
|
43
|
+
"three": "^0.186.0",
|
|
37
44
|
"typescript": "^5.3.0"
|
|
38
45
|
},
|
|
39
46
|
"repository": {
|