@threenative/procedural-environment 0.1.6 → 0.1.8

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.d.ts CHANGED
@@ -52,7 +52,7 @@ interface IBakeCityOptions {
52
52
  readonly markings?: boolean;
53
53
  /** Light canvas-drawn sign materials (`extras.sign`) with an emissive map for night scenes. Default false. */
54
54
  readonly emissiveSigns?: boolean;
55
- /** Convert transmissive architectural glass (`transmission > 0`) to opaque reflective PBR glass so background buildings avoid a full-scene transmission pass. Default false. */
55
+ /** Convert transmissive glass (`transmission > 0`) to opaque reflective PBR glass. Default true: the default native engine refuses a transmissive mesh by name (`TN_MATERIAL_UNSUPPORTED transmission`) and three pays a full-scene transmission pass; `false` keeps the kit's transmissive glass. */
56
56
  readonly opaqueGlass?: boolean;
57
57
  }
58
58
 
@@ -304,7 +304,7 @@ declare function bakeRock(options: IBakeRockOptions): Promise<IEnvironmentBake[]
304
304
  * @constraint roadWidth and markings apply to straight and curve; roadLength applies to straight; bendAngle, bendRadius and bendSide apply to curve; roadSurface applies to socketed road modules
305
305
  * @constraint bake-time only, so keep it a dev dependency; textures are capped at 1024 px like the page's export
306
306
  * @constraint only bake road tiles (`straight`, `curve`, `cross`, `tee`, `alley`, `grid`, `pit`, `cul-de-sac`) when assembling the drivable carriageway from kit tiles; when a level builds its own spline or terrain road, bake scenery modules instead (`detail: 1, dressing: false` keeps draw counts low)
307
- * @constraint `emissiveSigns: true` lights canvas-drawn signs (`extras.sign`) for night scenes; `opaqueGlass: true` converts transmissive architectural glass to opaque reflective PBR glass so background buildings avoid a full-scene transmission pass
307
+ * @constraint `emissiveSigns: true` lights canvas-drawn signs (`extras.sign`) for night scenes; glass ships opaque reflective PBR by default (`opaqueGlass: true`), because the default native engine refuses a transmissive mesh by name (`TN_MATERIAL_UNSUPPORTED transmission`) and three pays a full-scene transmission pass; `opaqueGlass: false` keeps the kit's transmissive glass under its own file name
308
308
  * @requires npm i -D @threenative/procedural-environment
309
309
  * @example await bakeCity({ module: "office", detail: 1, dressing: false, out: "assets/city" });
310
310
  * @example await bakeCity({ module: "civic-ad", detail: 1, text: "GRAND PRIX", emissiveSigns: true, out: "assets/city" });
package/dist/index.js CHANGED
@@ -4278,7 +4278,7 @@ var cityRoadDefaults = {
4278
4278
  };
4279
4279
  var cityBakeDefaults = {
4280
4280
  emissiveSigns: false,
4281
- opaqueGlass: false
4281
+ opaqueGlass: true
4282
4282
  };
4283
4283
  var cityRoadEdgeModules = [
4284
4284
  "straight",
@@ -4479,6 +4479,12 @@ function applyMaterialOptions(material, bake) {
4479
4479
  }
4480
4480
  }
4481
4481
  if (bake.opaqueGlass && typeof material.transmission === "number" && material.transmission > 0) {
4482
+ const kept = 1 - Math.min(1, material.transmission);
4483
+ if (material.color) {
4484
+ material.color.r *= kept;
4485
+ material.color.g *= kept;
4486
+ material.color.b *= kept;
4487
+ }
4482
4488
  material.transmission = 0;
4483
4489
  if (typeof material.thickness === "number") material.thickness = 0;
4484
4490
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threenative/procedural-environment",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "license": "MIT",
5
5
  "description": "Optional, bake-first procedural nature GLBs for ThreeNative: trees and cover (Arbor), forest floor (forest-kit) and rocks, cliffs and mountains (Outcrop), found by biome.",
6
6
  "homepage": "https://github.com/ThreeNativeHQ/threenative#readme",