@chromatic-coherence/generative-engine 1.0.0 → 1.0.2

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/README.md CHANGED
@@ -7,13 +7,13 @@
7
7
  [![licence: source-available](https://img.shields.io/badge/licence-source--available-1e88e5)](./LICENSE)
8
8
  [![zero dependencies](https://img.shields.io/badge/dependencies-0-success)](#)
9
9
 
10
- **[2D · CPU edition →](https://www.npmjs.com/package/@chromatic-coherence/generative-charts-2d)** · **[3D · GPU charts edition →](https://www.npmjs.com/package/@chromatic-coherence/generative-charts-3d)**
10
+ **[Live scenes →](https://chromaticcoherence.ai/generative-engine)** · **[The charts sibling →](https://www.npmjs.com/package/@chromatic-coherence/generative-charts)**
11
11
 
12
12
  </div>
13
13
 
14
14
  ---
15
15
 
16
- The two chart editions stay what they are — small, stable, chart-first. **generative-engine** is where
16
+ The charts library stays what it is — small, stable, chart-first. **generative-engine** is where
17
17
  the family expands: the same API (`createWorld` · `face` · `line` · `glow` · `grow` · `draw*` ·
18
18
  `fade`), so chart recipes port forward by changing one import — and underneath it, a real
19
19
  graphics engine. Zero dependencies; the browser is the only runtime.
package/dist/world.js CHANGED
@@ -161,17 +161,23 @@ export class World {
161
161
  this.shadowSoft = o.shadows.softness ?? 1.6;
162
162
  this.shadowBias = o.shadows.bias ?? 0.0035;
163
163
  }
164
- if (this.shadowsOn) {
165
- // a REAL depth texture with hardware comparison LINEAR gives free 2x2 PCF per tap
164
+ {
165
+ // the shadow sampler must ALWAYS have a complete depth-comparable texture bound:
166
+ // an unbound sampler2DShadow invalidates the face program on some drivers and
167
+ // every solid silently vanishes. Shadows off => a 1x1 dummy depth texture.
168
+ // (Shadows on: a REAL depth texture — LINEAR gives free 2x2 hardware PCF per tap.)
169
+ const size = this.shadowsOn ? this.shadowSize : 1;
166
170
  this.shadowTex = gl.createTexture();
167
171
  gl.bindTexture(gl.TEXTURE_2D, this.shadowTex);
168
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT24, this.shadowSize, this.shadowSize, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_INT, null);
172
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.DEPTH_COMPONENT24, size, size, 0, gl.DEPTH_COMPONENT, gl.UNSIGNED_INT, null);
169
173
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
170
174
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
171
175
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
172
176
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
173
177
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_MODE, gl.COMPARE_REF_TO_TEXTURE);
174
178
  gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_COMPARE_FUNC, gl.LEQUAL);
179
+ }
180
+ if (this.shadowsOn) {
175
181
  this.shadowFBO = gl.createFramebuffer();
176
182
  gl.bindFramebuffer(gl.FRAMEBUFFER, this.shadowFBO);
177
183
  gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.TEXTURE_2D, this.shadowTex, 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chromatic-coherence/generative-engine",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "THE THIRD ENGINE — a zero-dependency WebGL2 graphics engine grown from generative-charts-3d: HDR + bloom + SSAO post chain, hardware-PCF shadow maps, a geometry stdlib, ribbon strokes, group transforms and morph targets. The charts API rides on top unchanged.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",