@aura3d/product-studio 1.5.2 → 2.0.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductLighting.d.ts","sourceRoot":"","sources":["../../../../packages/product-studio/src/ProductLighting.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEnF,wBAAgB,2BAA2B,CAAC,MAAM,GAAE,qBAAyC,GAAG,qBAAqB,
|
|
1
|
+
{"version":3,"file":"ProductLighting.d.ts","sourceRoot":"","sources":["../../../../packages/product-studio/src/ProductLighting.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEnF,wBAAgB,2BAA2B,CAAC,MAAM,GAAE,qBAAyC,GAAG,qBAAqB,CA2BpH"}
|
package/dist/ProductLighting.js
CHANGED
|
@@ -2,11 +2,11 @@ import { DirectionalLight } from "@aura3d/scene";
|
|
|
2
2
|
import { createLightingDefault } from "@aura3d/rendering";
|
|
3
3
|
export function createProductLightingPreset(preset = "catalog-softbox") {
|
|
4
4
|
const base = createLightingDefault(preset === "inspection-bay" ? "interiorGallery" : preset === "hero-contrast" ? "gameNight" : "studioProduct");
|
|
5
|
-
const key = makeDirectionalLight("product-key-light", [1, 0.
|
|
6
|
-
const rim = makeDirectionalLight("product-rim-light", [0.
|
|
5
|
+
const key = makeDirectionalLight("product-key-light", preset === "inspection-bay" ? [1, 0.62, 0.32] : preset === "hero-contrast" ? [0.72, 0.86, 1] : [1, 0.96, 0.9], preset === "hero-contrast" ? 4.2 : preset === "inspection-bay" ? 2.15 : 3.1, preset === "inspection-bay" ? [-0.62, -0.54, -0.56] : [0.42, -0.72, -0.55], true);
|
|
6
|
+
const rim = makeDirectionalLight("product-rim-light", preset === "inspection-bay" ? [0.28, 0.66, 1] : preset === "hero-contrast" ? [1, 0.36, 0.16] : [0.72, 0.82, 1], preset === "inspection-bay" ? 1.35 : preset === "hero-contrast" ? 1.5 : 0.9, [-0.56, -0.28, 0.78], false);
|
|
7
7
|
return {
|
|
8
8
|
preset,
|
|
9
|
-
environmentLighting: base.environmentLighting,
|
|
9
|
+
environmentLighting: productEnvironment(preset, base.environmentLighting),
|
|
10
10
|
postprocess: base.postprocess,
|
|
11
11
|
shadow: {
|
|
12
12
|
...base.shadow,
|
|
@@ -16,6 +16,37 @@ export function createProductLightingPreset(preset = "catalog-softbox") {
|
|
|
16
16
|
lights: [key, rim]
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
+
function productEnvironment(preset, fallback) {
|
|
20
|
+
if (preset === "inspection-bay") {
|
|
21
|
+
return {
|
|
22
|
+
color: [1, 0.62, 0.34],
|
|
23
|
+
intensity: 0.5,
|
|
24
|
+
proceduralMap: {
|
|
25
|
+
skyColor: [0.42, 0.68, 1],
|
|
26
|
+
horizonColor: [1, 0.52, 0.24],
|
|
27
|
+
groundColor: [0.045, 0.055, 0.075],
|
|
28
|
+
specularColor: [1, 0.74, 0.42],
|
|
29
|
+
intensity: 0.62,
|
|
30
|
+
specularIntensity: 0.78
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
if (preset === "hero-contrast") {
|
|
35
|
+
return {
|
|
36
|
+
color: [0.38, 0.56, 0.92],
|
|
37
|
+
intensity: 0.36,
|
|
38
|
+
proceduralMap: {
|
|
39
|
+
skyColor: [0.12, 0.24, 0.5],
|
|
40
|
+
horizonColor: [0.84, 0.28, 0.12],
|
|
41
|
+
groundColor: [0.012, 0.018, 0.035],
|
|
42
|
+
specularColor: [0.72, 0.88, 1],
|
|
43
|
+
intensity: 0.48,
|
|
44
|
+
specularIntensity: 0.86
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return fallback;
|
|
49
|
+
}
|
|
19
50
|
function makeDirectionalLight(name, color, intensity, direction, castsShadow) {
|
|
20
51
|
const source = new DirectionalLight(name);
|
|
21
52
|
source.color = [...color];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProductLighting.js","sourceRoot":"","sources":["../../../../packages/product-studio/src/ProductLighting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,MAAM,UAAU,2BAA2B,CAAC,SAAgC,iBAAiB;IAC3F,MAAM,IAAI,GAAG,qBAAqB,CAAC,MAAM,KAAK,gBAAgB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,MAAM,KAAK,eAAe,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IACjJ,MAAM,GAAG,GAAG,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ProductLighting.js","sourceRoot":"","sources":["../../../../packages/product-studio/src/ProductLighting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,MAAM,UAAU,2BAA2B,CAAC,SAAgC,iBAAiB;IAC3F,MAAM,IAAI,GAAG,qBAAqB,CAAC,MAAM,KAAK,gBAAgB,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,MAAM,KAAK,eAAe,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IACjJ,MAAM,GAAG,GAAG,oBAAoB,CAC9B,mBAAmB,EACnB,MAAM,KAAK,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC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AA4C,EAC5C,WAAoB;IAEpB,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,CAA6B,CAAC;IACtD,MAAM,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,MAAM,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,KAAK;QACL,SAAS;QACT,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QACnB,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC;QAC/B,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,CAAC;QACZ,QAAQ,EAAE,CAAC;QACX,WAAW;QACX,SAAS,EAAE,UAAU;QACrB,MAAM;KACP,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,KAAwC;IACzD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,OAAO,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;AAChG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aura3d/product-studio",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"main": "./dist/index.js",
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@aura3d/
|
|
15
|
-
"@aura3d/
|
|
16
|
-
"@aura3d/scene": "
|
|
14
|
+
"@aura3d/assets": "2.0.0",
|
|
15
|
+
"@aura3d/rendering": "2.0.0",
|
|
16
|
+
"@aura3d/scene": "2.0.0"
|
|
17
17
|
},
|
|
18
18
|
"sideEffects": false,
|
|
19
19
|
"description": "Product asset loading, camera framing, diagnostics, export, floor, lighting, material modes, render scenes, and showcase layouts for Aura3D.",
|