@genocode/render 0.1.0 → 0.2.1
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 +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/webgl.d.ts +15 -5
- package/dist/webgl.d.ts.map +1 -1
- package/dist/webgl.js +92 -37
- package/dist/webgl.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { creatureBounds, shapeGeometry, type Bounds, type Detail } from "./geometry.js";
|
|
2
2
|
export { backgroundRamp, DEFAULT_BACKGROUND, FIELD_OF_VIEW, frameCamera, LIGHTS, type CameraPlacement, } from "./look.js";
|
|
3
3
|
export { rasterize, type Image, type RasterOptions } from "./software.js";
|
|
4
|
-
export { CreatureView } from "./webgl.js";
|
|
4
|
+
export { CreatureView, Thumbnails } from "./webgl.js";
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,MAAM,EACN,KAAK,eAAe,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,MAAM,EACN,KAAK,eAAe,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,SAAS,EAAE,KAAK,KAAK,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
export { creatureBounds, shapeGeometry } from "./geometry.js";
|
|
4
4
|
export { backgroundRamp, DEFAULT_BACKGROUND, FIELD_OF_VIEW, frameCamera, LIGHTS, } from "./look.js";
|
|
5
5
|
export { rasterize } from "./software.js";
|
|
6
|
-
export { CreatureView } from "./webgl.js";
|
|
6
|
+
export { CreatureView, Thumbnails } from "./webgl.js";
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,kEAAkE;AAElE,OAAO,EAAE,cAAc,EAAE,aAAa,EAA4B,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,MAAM,GAEP,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,SAAS,EAAkC,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,kEAAkE;AAElE,OAAO,EAAE,cAAc,EAAE,aAAa,EAA4B,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,WAAW,EACX,MAAM,GAEP,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,SAAS,EAAkC,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/webgl.d.ts
CHANGED
|
@@ -4,13 +4,9 @@ export declare class CreatureView {
|
|
|
4
4
|
private readonly canvas;
|
|
5
5
|
readonly renderer: WebGLRenderer;
|
|
6
6
|
readonly camera: PerspectiveCamera;
|
|
7
|
-
private readonly
|
|
8
|
-
private readonly creature;
|
|
7
|
+
private readonly look;
|
|
9
8
|
private readonly controls;
|
|
10
|
-
private readonly opaque;
|
|
11
|
-
private readonly seeThrough;
|
|
12
9
|
private readonly resizeObserver;
|
|
13
|
-
private shapes;
|
|
14
10
|
private frameRequested;
|
|
15
11
|
constructor(canvas: HTMLCanvasElement);
|
|
16
12
|
/** Replaces the creature on show. With `keepView`, the camera stays where the viewer left it. */
|
|
@@ -23,4 +19,18 @@ export declare class CreatureView {
|
|
|
23
19
|
private requestFrame;
|
|
24
20
|
dispose(): void;
|
|
25
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Draws creatures into small 2D canvases, such as the tiles of a breeding grid, with one shared
|
|
24
|
+
* WebGL renderer: browsers only allow a few WebGL canvases at once. Shapes are drawn with less
|
|
25
|
+
* detail than in `CreatureView`, which is plenty at tile size and much quicker.
|
|
26
|
+
*/
|
|
27
|
+
export declare class Thumbnails {
|
|
28
|
+
private readonly renderer;
|
|
29
|
+
private readonly camera;
|
|
30
|
+
private readonly look;
|
|
31
|
+
constructor();
|
|
32
|
+
/** Draws a creature and its background to fill `target`, at the target's own pixel size. */
|
|
33
|
+
draw(target: HTMLCanvasElement, shapes: readonly LaidShape[], background: Value | undefined): void;
|
|
34
|
+
dispose(): void;
|
|
35
|
+
}
|
|
26
36
|
//# sourceMappingURL=webgl.d.ts.map
|
package/dist/webgl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl.d.ts","sourceRoot":"","sources":["../src/webgl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webgl.d.ts","sourceRoot":"","sources":["../src/webgl.ts"],"names":[],"mappings":"AAIA,OAAO,EAAS,KAAK,SAAS,EAAkB,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAUL,iBAAiB,EAIjB,aAAa,EAEd,MAAM,OAAO,CAAC;AAqJf,qBAAa,YAAY;IAQX,OAAO,CAAC,QAAQ,CAAC,MAAM;IAPnC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;IACjC,QAAQ,CAAC,MAAM,oBAAsD;IACrE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAuB;IAC5C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IACzC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,cAAc,CAAS;IAE/B,YAA6B,MAAM,EAAE,iBAAiB,EASrD;IAED,iGAAiG;IACjG,WAAW,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,EAAE,QAAQ,UAAQ,GAAG,IAAI,CAIhE;IAED,mGAAmG;IACnG,aAAa,CAAC,IAAI,EAAE,KAAK,GAAG,SAAS,GAAG,IAAI,CAG3C;IAED,yEAAyE;IACzE,SAAS,IAAI,IAAI,CAShB;IAED,OAAO,CAAC,MAAM;IAUd,OAAO,CAAC,YAAY;IAWpB,OAAO,IAAI,IAAI,CAKd;CACF;AAED;;;;GAIG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsD;IAC7E,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAuB;IAE5C,cAEC;IAED,4FAA4F;IAC5F,IAAI,CACF,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,SAAS,SAAS,EAAE,EAC5B,UAAU,EAAE,KAAK,GAAG,SAAS,GAC5B,IAAI,CAYN;IAED,OAAO,IAAI,IAAI,CAGd;CACF"}
|
package/dist/webgl.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
// Shows
|
|
2
|
-
// shape's colour, alpha, shine and sharpness carried per instance.
|
|
1
|
+
// Shows creatures in the browser with three.js: one instanced mesh per kind of shape, with each
|
|
2
|
+
// shape's colour, alpha, shine and sharpness carried per instance. `CreatureView` is the full,
|
|
3
|
+
// interactive view; `Thumbnails` draws many small pictures with one renderer.
|
|
3
4
|
import { toRgb } from "@genocode/core";
|
|
4
5
|
import { AmbientLight, CanvasTexture, Color, DirectionalLight, Group, InstancedBufferAttribute, InstancedMesh, Matrix4, MeshPhongMaterial, PerspectiveCamera, Scene, SRGBColorSpace, Vector3, WebGLRenderer, } from "three";
|
|
5
6
|
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
|
|
6
7
|
import { creatureBounds, shapeGeometry } from "./geometry.js";
|
|
7
|
-
import { backgroundRamp, FIELD_OF_VIEW, frameCamera, LIGHTS } from "./look.js";
|
|
8
|
+
import { backgroundRamp, FIELD_OF_VIEW, frameCamera, LIGHTS, } from "./look.js";
|
|
8
9
|
/** Adds per-instance shine (x), sharpness (y) and alpha (z) to the Phong material. */
|
|
9
10
|
function addInstanceLook(shader) {
|
|
10
11
|
shader.vertexShader = shader.vertexShader
|
|
@@ -34,22 +35,14 @@ function makeMaterial(transparent) {
|
|
|
34
35
|
}
|
|
35
36
|
/** Light strengths in three are scaled by π compared with the software renderer's. */
|
|
36
37
|
const LIGHT_SCALE = Math.PI;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
renderer;
|
|
40
|
-
camera = new PerspectiveCamera(FIELD_OF_VIEW, 1, 0.1, 1000);
|
|
38
|
+
/** The scene both views draw: lights, the creature's shapes and the background. */
|
|
39
|
+
class CreatureScene {
|
|
41
40
|
scene = new Scene();
|
|
42
41
|
creature = new Group();
|
|
43
|
-
controls;
|
|
44
42
|
opaque = makeMaterial(false);
|
|
45
43
|
seeThrough = makeMaterial(true);
|
|
46
|
-
resizeObserver;
|
|
47
44
|
shapes = [];
|
|
48
|
-
|
|
49
|
-
constructor(canvas) {
|
|
50
|
-
this.canvas = canvas;
|
|
51
|
-
this.renderer = new WebGLRenderer({ canvas, antialias: true, preserveDrawingBuffer: true });
|
|
52
|
-
this.renderer.setPixelRatio(window.devicePixelRatio);
|
|
45
|
+
constructor() {
|
|
53
46
|
this.scene.add(this.creature);
|
|
54
47
|
this.scene.add(new AmbientLight(0xffffff, LIGHTS.ambient * LIGHT_SCALE));
|
|
55
48
|
for (const l of [LIGHTS.key, LIGHTS.fill]) {
|
|
@@ -57,16 +50,9 @@ export class CreatureView {
|
|
|
57
50
|
light.position.set(...l.direction);
|
|
58
51
|
this.scene.add(light);
|
|
59
52
|
}
|
|
60
|
-
this.controls = new OrbitControls(this.camera, canvas);
|
|
61
|
-
this.controls.enableDamping = true;
|
|
62
|
-
this.controls.addEventListener("change", () => this.requestFrame());
|
|
63
|
-
this.resizeObserver = new ResizeObserver(() => this.resize());
|
|
64
|
-
this.resizeObserver.observe(canvas);
|
|
65
53
|
this.setBackground(undefined);
|
|
66
|
-
this.resize();
|
|
67
54
|
}
|
|
68
|
-
|
|
69
|
-
setCreature(shapes, keepView = false) {
|
|
55
|
+
setCreature(shapes, detail) {
|
|
70
56
|
for (const child of [...this.creature.children]) {
|
|
71
57
|
this.creature.remove(child);
|
|
72
58
|
const mesh = child;
|
|
@@ -87,7 +73,7 @@ export class CreatureView {
|
|
|
87
73
|
const colour = new Color();
|
|
88
74
|
for (const [key, members] of groups) {
|
|
89
75
|
const [shape, mirrored, transparent] = key.split("/");
|
|
90
|
-
const mesh = new InstancedMesh(shapeGeometry(shape, mirrored === "true"), transparent === "true" ? this.seeThrough : this.opaque, members.length);
|
|
76
|
+
const mesh = new InstancedMesh(shapeGeometry(shape, mirrored === "true", detail), transparent === "true" ? this.seeThrough : this.opaque, members.length);
|
|
91
77
|
const look = new Float32Array(members.length * 3);
|
|
92
78
|
members.forEach((s, i) => {
|
|
93
79
|
matrix.fromArray(s.matrix);
|
|
@@ -103,11 +89,8 @@ export class CreatureView {
|
|
|
103
89
|
mesh.computeBoundingSphere();
|
|
104
90
|
this.creature.add(mesh);
|
|
105
91
|
}
|
|
106
|
-
if (!keepView)
|
|
107
|
-
this.resetView();
|
|
108
|
-
this.requestFrame();
|
|
109
92
|
}
|
|
110
|
-
/**
|
|
93
|
+
/** A background's fill: a colour, a gradient, or (until patterns exist) a tinted default. */
|
|
111
94
|
setBackground(fill) {
|
|
112
95
|
const rows = 256;
|
|
113
96
|
const ramp = backgroundRamp(fill, rows);
|
|
@@ -127,16 +110,59 @@ export class CreatureView {
|
|
|
127
110
|
this.scene.background = texture;
|
|
128
111
|
if (old && "dispose" in old)
|
|
129
112
|
old.dispose();
|
|
113
|
+
}
|
|
114
|
+
/** Points the camera at the whole creature, from the front and a little above. */
|
|
115
|
+
frame(camera, aspect) {
|
|
116
|
+
const placement = frameCamera(creatureBounds(this.shapes), aspect);
|
|
117
|
+
camera.position.set(...placement.position);
|
|
118
|
+
camera.near = placement.near / 4;
|
|
119
|
+
camera.far = placement.far * 4;
|
|
120
|
+
camera.aspect = aspect;
|
|
121
|
+
camera.lookAt(...placement.target);
|
|
122
|
+
camera.updateProjectionMatrix();
|
|
123
|
+
return placement;
|
|
124
|
+
}
|
|
125
|
+
dispose() {
|
|
126
|
+
this.setCreature([], "low");
|
|
127
|
+
this.opaque.dispose();
|
|
128
|
+
this.seeThrough.dispose();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
export class CreatureView {
|
|
132
|
+
canvas;
|
|
133
|
+
renderer;
|
|
134
|
+
camera = new PerspectiveCamera(FIELD_OF_VIEW, 1, 0.1, 1000);
|
|
135
|
+
look = new CreatureScene();
|
|
136
|
+
controls;
|
|
137
|
+
resizeObserver;
|
|
138
|
+
frameRequested = false;
|
|
139
|
+
constructor(canvas) {
|
|
140
|
+
this.canvas = canvas;
|
|
141
|
+
this.renderer = new WebGLRenderer({ canvas, antialias: true, preserveDrawingBuffer: true });
|
|
142
|
+
this.renderer.setPixelRatio(window.devicePixelRatio);
|
|
143
|
+
this.controls = new OrbitControls(this.camera, canvas);
|
|
144
|
+
this.controls.enableDamping = true;
|
|
145
|
+
this.controls.addEventListener("change", () => this.requestFrame());
|
|
146
|
+
this.resizeObserver = new ResizeObserver(() => this.resize());
|
|
147
|
+
this.resizeObserver.observe(canvas);
|
|
148
|
+
this.resize();
|
|
149
|
+
}
|
|
150
|
+
/** Replaces the creature on show. With `keepView`, the camera stays where the viewer left it. */
|
|
151
|
+
setCreature(shapes, keepView = false) {
|
|
152
|
+
this.look.setCreature(shapes, "high");
|
|
153
|
+
if (!keepView)
|
|
154
|
+
this.resetView();
|
|
155
|
+
this.requestFrame();
|
|
156
|
+
}
|
|
157
|
+
/** Shows a background's fill: a colour, a gradient, or (until patterns exist) a tinted default. */
|
|
158
|
+
setBackground(fill) {
|
|
159
|
+
this.look.setBackground(fill);
|
|
130
160
|
this.requestFrame();
|
|
131
161
|
}
|
|
132
162
|
/** Frames the whole creature, seen from the front and a little above. */
|
|
133
163
|
resetView() {
|
|
134
164
|
const aspect = this.canvas.clientWidth / Math.max(1, this.canvas.clientHeight);
|
|
135
|
-
const placement =
|
|
136
|
-
this.camera.position.set(...placement.position);
|
|
137
|
-
this.camera.near = placement.near / 4;
|
|
138
|
-
this.camera.far = placement.far * 4;
|
|
139
|
-
this.camera.updateProjectionMatrix();
|
|
165
|
+
const placement = this.look.frame(this.camera, aspect);
|
|
140
166
|
this.controls.target.set(...placement.target);
|
|
141
167
|
this.controls.minDistance = 0;
|
|
142
168
|
this.controls.maxDistance =
|
|
@@ -163,16 +189,45 @@ export class CreatureView {
|
|
|
163
189
|
// Damping keeps the view moving for a moment after the mouse lets go.
|
|
164
190
|
if (this.controls.update())
|
|
165
191
|
this.requestFrame();
|
|
166
|
-
this.renderer.render(this.scene, this.camera);
|
|
192
|
+
this.renderer.render(this.look.scene, this.camera);
|
|
167
193
|
});
|
|
168
194
|
}
|
|
169
195
|
dispose() {
|
|
170
196
|
this.resizeObserver.disconnect();
|
|
171
197
|
this.controls.dispose();
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
198
|
+
this.look.dispose();
|
|
199
|
+
this.renderer.dispose();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Draws creatures into small 2D canvases, such as the tiles of a breeding grid, with one shared
|
|
204
|
+
* WebGL renderer: browsers only allow a few WebGL canvases at once. Shapes are drawn with less
|
|
205
|
+
* detail than in `CreatureView`, which is plenty at tile size and much quicker.
|
|
206
|
+
*/
|
|
207
|
+
export class Thumbnails {
|
|
208
|
+
renderer;
|
|
209
|
+
camera = new PerspectiveCamera(FIELD_OF_VIEW, 1, 0.1, 1000);
|
|
210
|
+
look = new CreatureScene();
|
|
211
|
+
constructor() {
|
|
212
|
+
this.renderer = new WebGLRenderer({ antialias: true, preserveDrawingBuffer: true });
|
|
213
|
+
}
|
|
214
|
+
/** Draws a creature and its background to fill `target`, at the target's own pixel size. */
|
|
215
|
+
draw(target, shapes, background) {
|
|
216
|
+
const w = target.width;
|
|
217
|
+
const h = target.height;
|
|
218
|
+
if (w === 0 || h === 0)
|
|
219
|
+
return;
|
|
220
|
+
this.renderer.setSize(w, h, false);
|
|
221
|
+
this.look.setCreature(shapes, "low");
|
|
222
|
+
this.look.setBackground(background);
|
|
223
|
+
this.look.frame(this.camera, w / h);
|
|
224
|
+
this.renderer.render(this.look.scene, this.camera);
|
|
225
|
+
const ctx = target.getContext("2d");
|
|
226
|
+
ctx.clearRect(0, 0, w, h);
|
|
227
|
+
ctx.drawImage(this.renderer.domElement, 0, 0, w, h);
|
|
228
|
+
}
|
|
229
|
+
dispose() {
|
|
230
|
+
this.look.dispose();
|
|
176
231
|
this.renderer.dispose();
|
|
177
232
|
}
|
|
178
233
|
}
|
package/dist/webgl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgl.js","sourceRoot":"","sources":["../src/webgl.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"webgl.js","sourceRoot":"","sources":["../src/webgl.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,+FAA+F;AAC/F,8EAA8E;AAE9E,OAAO,EAAE,KAAK,EAA8C,MAAM,gBAAgB,CAAC;AACnF,OAAO,EACL,YAAY,EACZ,aAAa,EACb,KAAK,EACL,gBAAgB,EAChB,KAAK,EACL,wBAAwB,EACxB,aAAa,EACb,OAAO,EACP,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,EACL,cAAc,EACd,OAAO,EACP,aAAa,GAEd,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,aAAa,EAAe,MAAM,eAAe,CAAC;AAC3E,OAAO,EACL,cAAc,EACd,aAAa,EACb,WAAW,EACX,MAAM,GAEP,MAAM,WAAW,CAAC;AAEnB,sFAAsF;AACtF,SAAS,eAAe,CAAC,MAA0C;IACjE,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY;SACtC,OAAO,CACN,mBAAmB,EACnB,sEAAsE,CACvE;SACA,OAAO,CAAC,yBAAyB,EAAE,gDAAgD,CAAC,CAAC;IACxF,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc;SAC1C,OAAO,CAAC,mBAAmB,EAAE,wCAAwC,CAAC;SACtE,OAAO,CAAC,2BAA2B,EAAE,uDAAuD,CAAC;SAC7F,OAAO,CACN,kCAAkC,EAClC;QACE,8BAA8B;QAC9B,2CAA2C;QAC3C,2CAA2C;QAC3C,qDAAqD;QACrD,kCAAkC;KACnC,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;AACN,CAAC;AAED,SAAS,YAAY,CAAC,WAAoB;IACxC,MAAM,QAAQ,GAAG,IA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,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1B,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,OAAO;QACL,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACpB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genocode/render",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Draws GenoCode creatures, textures and backgrounds with three.js.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"LICENSE"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@genocode/core": "0.
|
|
28
|
+
"@genocode/core": "^0.3.0",
|
|
29
29
|
"three": "0.160.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|