@genex-ai/cli-demo 0.1.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.
- package/LICENSE +21 -0
- package/README.md +198 -0
- package/package.json +45 -0
- package/src/commands/init.ts +131 -0
- package/src/commands/publish.ts +151 -0
- package/src/config.ts +102 -0
- package/src/index.ts +238 -0
- package/src/lib/auth.ts +365 -0
- package/src/lib/copy-templates.ts +81 -0
- package/src/lib/env.ts +109 -0
- package/src/lib/project.ts +109 -0
- package/src/lib/ssh.ts +104 -0
- package/src/lib/store.ts +102 -0
- package/src/utils/colors.ts +25 -0
- package/src/utils/logger.ts +40 -0
- package/templates/README.md +19 -0
- package/templates/agents/genex-helper.md +16 -0
- package/templates/commands/genex-status.md +13 -0
- package/templates/skills/genex-getting-started/SKILL.md +41 -0
- package/templates/skills/genex-threejs-atmosphere-aerial-perspective/SKILL.md +30 -0
- package/templates/skills/genex-threejs-atmosphere-aerial-perspective/references/atmosphere.md +29 -0
- package/templates/skills/genex-threejs-bloom/SKILL.md +30 -0
- package/templates/skills/genex-threejs-bloom/references/bloom.md +29 -0
- package/templates/skills/genex-threejs-camera-direction/SKILL.md +36 -0
- package/templates/skills/genex-threejs-camera-direction/references/camera-rigs.md +38 -0
- package/templates/skills/genex-threejs-exposure-color-grading/SKILL.md +30 -0
- package/templates/skills/genex-threejs-exposure-color-grading/references/exposure-grading.md +30 -0
- package/templates/skills/genex-threejs-image-pipeline/SKILL.md +30 -0
- package/templates/skills/genex-threejs-image-pipeline/references/image-pipeline.md +39 -0
- package/templates/skills/genex-threejs-procedural-animation/SKILL.md +31 -0
- package/templates/skills/genex-threejs-procedural-animation/references/procedural-motion.md +33 -0
- package/templates/skills/genex-threejs-procedural-architecture/SKILL.md +30 -0
- package/templates/skills/genex-threejs-procedural-architecture/references/architecture-systems.md +31 -0
- package/templates/skills/genex-threejs-procedural-fields/SKILL.md +31 -0
- package/templates/skills/genex-threejs-procedural-fields/references/field-systems.md +35 -0
- package/templates/skills/genex-threejs-procedural-geometry/SKILL.md +30 -0
- package/templates/skills/genex-threejs-procedural-geometry/references/mesh-systems.md +36 -0
- package/templates/skills/genex-threejs-procedural-materials/SKILL.md +30 -0
- package/templates/skills/genex-threejs-procedural-materials/references/material-systems.md +31 -0
- package/templates/skills/genex-threejs-procedural-planets/SKILL.md +30 -0
- package/templates/skills/genex-threejs-procedural-planets/references/planet-systems.md +30 -0
- package/templates/skills/genex-threejs-procedural-vegetation/SKILL.md +32 -0
- package/templates/skills/genex-threejs-procedural-vegetation/references/vegetation-systems.md +37 -0
- package/templates/skills/genex-threejs-procedural-vfx/SKILL.md +31 -0
- package/templates/skills/genex-threejs-procedural-vfx/references/vfx-systems.md +30 -0
- package/templates/skills/genex-threejs-raymarched-space-effects/SKILL.md +30 -0
- package/templates/skills/genex-threejs-raymarched-space-effects/references/space-effects.md +30 -0
- package/templates/skills/genex-threejs-screen-space-ambient-occlusion/SKILL.md +29 -0
- package/templates/skills/genex-threejs-screen-space-ambient-occlusion/references/ambient-occlusion.md +29 -0
- package/templates/skills/genex-threejs-shadow-systems/SKILL.md +30 -0
- package/templates/skills/genex-threejs-shadow-systems/references/shadow-systems.md +30 -0
- package/templates/skills/genex-threejs-skill-router/SKILL.md +48 -0
- package/templates/skills/genex-threejs-skill-router/references/routing-map.md +53 -0
- package/templates/skills/genex-threejs-spectral-ocean/SKILL.md +30 -0
- package/templates/skills/genex-threejs-spectral-ocean/references/spectral-ocean.md +31 -0
- package/templates/skills/genex-threejs-temporal-surfaces/SKILL.md +30 -0
- package/templates/skills/genex-threejs-temporal-surfaces/references/temporal-surfaces.md +29 -0
- package/templates/skills/genex-threejs-visual-validation/SKILL.md +32 -0
- package/templates/skills/genex-threejs-visual-validation/references/visual-validation.md +42 -0
- package/templates/skills/genex-threejs-volumetric-clouds/SKILL.md +29 -0
- package/templates/skills/genex-threejs-volumetric-clouds/references/volumetric-clouds.md +30 -0
- package/templates/skills/genex-threejs-water-optics/SKILL.md +30 -0
- package/templates/skills/genex-threejs-water-optics/references/water-optics.md +29 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Bloom
|
|
2
|
+
|
|
3
|
+
Use this reference for controlled glow in Genex games.
|
|
4
|
+
|
|
5
|
+
## Signal ownership
|
|
6
|
+
|
|
7
|
+
- Establish whether bloom comes from HDR thresholding, selection layers, or both.
|
|
8
|
+
- Keep tone mapping after bloom composition.
|
|
9
|
+
- Keep exposure changes from unpredictably destroying bloom intent.
|
|
10
|
+
|
|
11
|
+
## Selective bloom
|
|
12
|
+
|
|
13
|
+
- Use layers, masks, or a separate render pass.
|
|
14
|
+
- Restore material state after rendering a selected pass.
|
|
15
|
+
- Avoid duplicate contribution from the same object.
|
|
16
|
+
- Keep selected objects documented.
|
|
17
|
+
|
|
18
|
+
## Blur levels
|
|
19
|
+
|
|
20
|
+
- Small radius: sharp energy and UI-like highlights.
|
|
21
|
+
- Medium radius: glow around light sources.
|
|
22
|
+
- Large radius: atmosphere or spectacle.
|
|
23
|
+
- Keep each level inspectable.
|
|
24
|
+
|
|
25
|
+
## Failure checks
|
|
26
|
+
|
|
27
|
+
- Bloom cannot carry the silhouette alone.
|
|
28
|
+
- White UI or text should not bloom unless intentionally emissive.
|
|
29
|
+
- Dark scenes should not become foggy because bloom strength is too high.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genex-threejs-camera-direction
|
|
3
|
+
description: Design advanced Three.js camera systems for Genex browser games. Use for chase cameras, orbit cameras, side cameras, authored shots, pointer-look controls, scale-aware offsets, collision constraints, camera handoffs, projection ownership, large-world precision, and lifecycle cleanup.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Genex Three.js Camera Direction
|
|
7
|
+
|
|
8
|
+
Treat the camera as part of the game design, not a passive viewport. It must
|
|
9
|
+
explain scale, support the player verb, and survive mode changes.
|
|
10
|
+
|
|
11
|
+
Read [references/camera-rigs.md](references/camera-rigs.md) for concrete rig
|
|
12
|
+
patterns, handoff rules, and browser checks.
|
|
13
|
+
|
|
14
|
+
## Build order
|
|
15
|
+
|
|
16
|
+
1. Define subject size, play distance, screen occupancy, lens, near/far planes,
|
|
17
|
+
input mode, and up-axis convention.
|
|
18
|
+
2. Choose semantic camera frames: player body, vehicle, track, planet normal,
|
|
19
|
+
arena center, or authored shot marker.
|
|
20
|
+
3. Compute target position and orientation separately, then compose the final
|
|
21
|
+
camera transform once.
|
|
22
|
+
4. Add orbit, chase, side, or pointer-look constraints around the chosen frame.
|
|
23
|
+
5. Use frame-rate-independent smoothing for follow motion; avoid stacked
|
|
24
|
+
smoothing during explicit transitions.
|
|
25
|
+
6. Snapshot and restore projection, controls, and ownership when scenes mount or
|
|
26
|
+
dispose.
|
|
27
|
+
|
|
28
|
+
## Rules
|
|
29
|
+
|
|
30
|
+
- Derive distances from subject bounds; do not hard-code one offset for every
|
|
31
|
+
game object.
|
|
32
|
+
- Use `lerp` for positions and `slerp` for orientations.
|
|
33
|
+
- Re-sync yaw and pitch from the active camera when pointer lock is acquired.
|
|
34
|
+
- Update projection matrices after FOV, near, far, or aspect changes.
|
|
35
|
+
- Keep infinite backgrounds camera-relative in large worlds.
|
|
36
|
+
- Validate resize, pointer-lock recovery, mode transitions, and collision edges.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Camera Rigs
|
|
2
|
+
|
|
3
|
+
Use these patterns when a Genex scene needs authored camera behavior.
|
|
4
|
+
|
|
5
|
+
## Chase camera
|
|
6
|
+
|
|
7
|
+
- Base the offset on the controlled object's bounding sphere.
|
|
8
|
+
- Track a target point slightly ahead of the object, not only its origin.
|
|
9
|
+
- Smooth position with an exponential factor based on `deltaTime`.
|
|
10
|
+
- Smooth orientation separately so fast direction changes do not roll the view.
|
|
11
|
+
- Clamp pitch and distance so the player cannot bury the camera in geometry.
|
|
12
|
+
|
|
13
|
+
## Orbit camera
|
|
14
|
+
|
|
15
|
+
- Store yaw, pitch, and distance as explicit state.
|
|
16
|
+
- Clamp pitch before deriving the spherical offset.
|
|
17
|
+
- Recompute the target from the game object each frame.
|
|
18
|
+
- Disable or reduce damping during scripted handoffs.
|
|
19
|
+
|
|
20
|
+
## Side or authored shot
|
|
21
|
+
|
|
22
|
+
- Define shot anchors in scene space or subject-relative space.
|
|
23
|
+
- Keep screen occupancy stable across subject scale changes.
|
|
24
|
+
- Blend only one transition source at a time.
|
|
25
|
+
- Expose a debug view showing target point, camera point, and frustum.
|
|
26
|
+
|
|
27
|
+
## Pointer look
|
|
28
|
+
|
|
29
|
+
- On lock acquisition, derive yaw and pitch from the current camera quaternion.
|
|
30
|
+
- Apply pointer deltas to yaw/pitch state, then rebuild the quaternion.
|
|
31
|
+
- Release cleanly on escape, tab changes, and scene disposal.
|
|
32
|
+
|
|
33
|
+
## Large worlds
|
|
34
|
+
|
|
35
|
+
- Use a floating origin or camera-relative background for scenes with very large
|
|
36
|
+
coordinates.
|
|
37
|
+
- Keep stars, sky domes, and infinite grids from translating in ways that imply
|
|
38
|
+
false parallax.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genex-threejs-exposure-color-grading
|
|
3
|
+
description: Build exposure and color grading for Genex Three.js games. Use for luminance metering, eye adaptation, tone mapping ownership, LUT-style grading, scene-referred color, output color spaces, mood passes, and final image consistency across gameplay lighting.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Genex Three.js Exposure And Color Grading
|
|
7
|
+
|
|
8
|
+
Exposure and grading are final image controls. Use them to preserve readability
|
|
9
|
+
across gameplay, not to fix broken lighting.
|
|
10
|
+
|
|
11
|
+
Read [references/exposure-grading.md](references/exposure-grading.md) for
|
|
12
|
+
metering, tone mapping, LUTs, and validation.
|
|
13
|
+
|
|
14
|
+
## Build order
|
|
15
|
+
|
|
16
|
+
1. Confirm render color space, tone-mapping owner, and output transform.
|
|
17
|
+
2. Define target luminance range and adaptation speed.
|
|
18
|
+
3. Meter luminance from an intentionally downsampled or sampled source.
|
|
19
|
+
4. Apply exposure before tone mapping.
|
|
20
|
+
5. Apply grading after tone mapping if using a display-style LUT.
|
|
21
|
+
6. Expose debug views for luminance, exposure, tone map, LUT, and final output.
|
|
22
|
+
|
|
23
|
+
## Rules
|
|
24
|
+
|
|
25
|
+
- Use one tone-mapping owner.
|
|
26
|
+
- Keep adaptation asymmetric if bright-to-dark and dark-to-bright need different
|
|
27
|
+
response.
|
|
28
|
+
- Avoid grading that hides gameplay colors or UI states.
|
|
29
|
+
- Validate bright, dark, indoor, outdoor, and VFX-heavy moments.
|
|
30
|
+
- Document known artistic compromises.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Exposure And Color Grading
|
|
2
|
+
|
|
3
|
+
Use this reference for final image response.
|
|
4
|
+
|
|
5
|
+
## Metering
|
|
6
|
+
|
|
7
|
+
- Downsample luminance or sample a stable set of pixels.
|
|
8
|
+
- Use log-average luminance for robust exposure.
|
|
9
|
+
- Ignore or reduce weighting for UI and transient VFX when they should not drive
|
|
10
|
+
exposure.
|
|
11
|
+
- Clamp exposure range.
|
|
12
|
+
|
|
13
|
+
## Adaptation
|
|
14
|
+
|
|
15
|
+
- Use different speeds for brightening and darkening when useful.
|
|
16
|
+
- Smooth by `deltaTime`.
|
|
17
|
+
- Reset or seed exposure intentionally on scene transitions.
|
|
18
|
+
|
|
19
|
+
## Tone mapping
|
|
20
|
+
|
|
21
|
+
- Choose one tone mapping stage.
|
|
22
|
+
- Place bloom before tone mapping.
|
|
23
|
+
- Place display grading after tone mapping unless the project has a specific
|
|
24
|
+
scene-referred grading path.
|
|
25
|
+
|
|
26
|
+
## Grading
|
|
27
|
+
|
|
28
|
+
- Keep gameplay-critical colors distinguishable.
|
|
29
|
+
- Provide a neutral grade toggle.
|
|
30
|
+
- Validate captures on multiple scene lighting states.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genex-threejs-image-pipeline
|
|
3
|
+
description: Design the final image pipeline for Genex Three.js games. Use for render-target ownership, depth and normal signals, albedo/history buffers, pass ordering, post-processing composition, AO, bloom, exposure, tone mapping, grading, diagnostics, and avoiding conflicting render effects.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Genex Three.js Image Pipeline
|
|
7
|
+
|
|
8
|
+
Own the frame deliberately. Advanced effects fail when every pass invents its
|
|
9
|
+
own depth, color, history, or tone mapping path.
|
|
10
|
+
|
|
11
|
+
Read [references/image-pipeline.md](references/image-pipeline.md) for pass
|
|
12
|
+
ordering, signal ownership, diagnostics, and cleanup.
|
|
13
|
+
|
|
14
|
+
## Build order
|
|
15
|
+
|
|
16
|
+
1. Inventory the frame: scene color, depth, normals, velocity/history, masks,
|
|
17
|
+
transparency, UI, and output.
|
|
18
|
+
2. Assign one owner for each shared signal.
|
|
19
|
+
3. Order passes from geometry signals to lighting support to final image.
|
|
20
|
+
4. Keep tone mapping and output color at the end.
|
|
21
|
+
5. Add per-pass debug views and no-post baseline.
|
|
22
|
+
6. Dispose render targets and composers on resize or scene teardown.
|
|
23
|
+
|
|
24
|
+
## Rules
|
|
25
|
+
|
|
26
|
+
- Do not let each effect render its own incompatible depth or normal pass.
|
|
27
|
+
- Keep UI composition separate from world post-processing unless intentional.
|
|
28
|
+
- Make DPR and resize behavior explicit.
|
|
29
|
+
- Track render-target count, resolution, and memory.
|
|
30
|
+
- Validate pass order by toggling each effect.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Image Pipeline
|
|
2
|
+
|
|
3
|
+
Use this reference when a Genex game has multiple render passes.
|
|
4
|
+
|
|
5
|
+
## Typical pass order
|
|
6
|
+
|
|
7
|
+
1. Main scene signals: color, depth, normals, masks.
|
|
8
|
+
2. Lighting support: shadows, AO, reflections, volumetrics.
|
|
9
|
+
3. Screen-space effects: refraction, temporal masks, distortion.
|
|
10
|
+
4. HDR effects: bloom and other emission-based contributions.
|
|
11
|
+
5. Exposure and tone mapping.
|
|
12
|
+
6. Color grading.
|
|
13
|
+
7. UI and presentation overlays.
|
|
14
|
+
|
|
15
|
+
## Shared signals
|
|
16
|
+
|
|
17
|
+
- Depth: document projection and encoding.
|
|
18
|
+
- Normals: document space and packing.
|
|
19
|
+
- Color: document linear/HDR/display state.
|
|
20
|
+
- History: document reset and reprojection rules.
|
|
21
|
+
- Masks: document semantic meaning and lifetime.
|
|
22
|
+
|
|
23
|
+
## Diagnostics
|
|
24
|
+
|
|
25
|
+
Provide a pass inspector or simple toggles for:
|
|
26
|
+
|
|
27
|
+
- no-post scene;
|
|
28
|
+
- depth;
|
|
29
|
+
- normals;
|
|
30
|
+
- masks;
|
|
31
|
+
- AO;
|
|
32
|
+
- bloom source and result;
|
|
33
|
+
- exposure;
|
|
34
|
+
- final output.
|
|
35
|
+
|
|
36
|
+
## Cleanup
|
|
37
|
+
|
|
38
|
+
Resize render targets on canvas changes. Dispose render targets, materials,
|
|
39
|
+
geometries, and composers when leaving the scene.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genex-threejs-procedural-animation
|
|
3
|
+
description: Build procedural animation systems for Genex Three.js games. Use for analytic timelines, launch arcs, loops, staging, docking, springs, vehicle lag, rotating frames, debris motion, transform phases, quaternion alignment, and frame-rate-independent motion.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Genex Three.js Procedural Animation
|
|
7
|
+
|
|
8
|
+
Use deterministic motion systems that can be replayed, tuned, and synchronized.
|
|
9
|
+
Animation should support gameplay clarity before it adds spectacle.
|
|
10
|
+
|
|
11
|
+
Read [references/procedural-motion.md](references/procedural-motion.md) for
|
|
12
|
+
timeline, spring, rotating-frame, and debris patterns.
|
|
13
|
+
|
|
14
|
+
## Build order
|
|
15
|
+
|
|
16
|
+
1. Define the motion contract: start/end state, duration, loop policy, gameplay
|
|
17
|
+
meaning, and interrupt behavior.
|
|
18
|
+
2. Use analytic time or explicit simulation state; avoid hidden wall-clock
|
|
19
|
+
dependencies.
|
|
20
|
+
3. Split position, orientation, scale, and material animation into named phases.
|
|
21
|
+
4. Use quaternion alignment for moving frames and docking-style orientation.
|
|
22
|
+
5. Use damped springs only where inertia is intended.
|
|
23
|
+
6. Expose debug controls for pause, time scale, phase, seed, and loop reset.
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
|
|
27
|
+
- Advance animation with `deltaTime`; never assume a fixed frame rate.
|
|
28
|
+
- Keep random variation seeded and reproducible.
|
|
29
|
+
- Prefer one clear motion cause over several unrelated noise offsets.
|
|
30
|
+
- Make restart, pause, scene disposal, and replay deterministic.
|
|
31
|
+
- Keep gameplay-critical state separate from purely visual offsets.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Procedural Motion
|
|
2
|
+
|
|
3
|
+
Use this reference for authored real-time motion in Genex games.
|
|
4
|
+
|
|
5
|
+
## Analytic timelines
|
|
6
|
+
|
|
7
|
+
- Normalize timeline progress to `t` in `[0, 1]`.
|
|
8
|
+
- Apply named easing functions per phase.
|
|
9
|
+
- Derive all animated properties from the same normalized phase when they must
|
|
10
|
+
stay synchronized.
|
|
11
|
+
- Record phase names in debug output so screenshots can be interpreted.
|
|
12
|
+
|
|
13
|
+
## Springs
|
|
14
|
+
|
|
15
|
+
- Use springs for pursuit, vehicle lag, recoil, camera follow, or UI-like
|
|
16
|
+
physical response.
|
|
17
|
+
- Keep spring constants in named parameters.
|
|
18
|
+
- Clamp extreme `deltaTime` after tab resumes.
|
|
19
|
+
- Snap to target when distance and velocity fall below a threshold.
|
|
20
|
+
|
|
21
|
+
## Rotating frames
|
|
22
|
+
|
|
23
|
+
- For docking, orbit, or planet-relative scenes, define the moving frame first.
|
|
24
|
+
- Convert local target axes to world axes each frame.
|
|
25
|
+
- Slerp orientation toward the target quaternion.
|
|
26
|
+
- Avoid mixing Euler interpolation with quaternion alignment.
|
|
27
|
+
|
|
28
|
+
## Debris and secondary motion
|
|
29
|
+
|
|
30
|
+
- Generate seeded velocity, angular velocity, lifetime, and drag.
|
|
31
|
+
- Use object pools for many particles or fragments.
|
|
32
|
+
- Remove or recycle expired fragments deterministically.
|
|
33
|
+
- Keep collision or damage state separate from decorative debris.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genex-threejs-procedural-architecture
|
|
3
|
+
description: Create procedural architecture for Genex Three.js games. Use for buildings, modular kits, facade grammars, exposed-edge analysis, bay systems, roofs, arches, ornaments, city blocks, collision proxies, material-slot compilation, and readable architecture at gameplay distance.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Genex Three.js Procedural Architecture
|
|
7
|
+
|
|
8
|
+
Architecture should communicate function, scale, traversal, and affordance. Use
|
|
9
|
+
grammars that emit semantic parts rather than arbitrary boxes.
|
|
10
|
+
|
|
11
|
+
Read [references/architecture-systems.md](references/architecture-systems.md)
|
|
12
|
+
for massing, facade rules, module compilation, and gameplay checks.
|
|
13
|
+
|
|
14
|
+
## Build order
|
|
15
|
+
|
|
16
|
+
1. Define gameplay role: backdrop, obstacle, climbable surface, interior shell,
|
|
17
|
+
landmark, cover, or arena boundary.
|
|
18
|
+
2. Build massing volumes and exposed edges.
|
|
19
|
+
3. Apply facade grammar by face orientation, floor band, corner, and entrance.
|
|
20
|
+
4. Emit material slots and collision proxies separately from decorative meshes.
|
|
21
|
+
5. Add detail only where camera distance supports it.
|
|
22
|
+
6. Expose debug views for modules, floors, entrances, collision, and LOD.
|
|
23
|
+
|
|
24
|
+
## Rules
|
|
25
|
+
|
|
26
|
+
- Keep doors, ledges, stairs, and openings aligned with player scale.
|
|
27
|
+
- Use repeated modules deliberately; break repetition with semantic variation.
|
|
28
|
+
- Do not spend triangle budget on invisible internal faces.
|
|
29
|
+
- Keep material slots stable so generated variants can share assets.
|
|
30
|
+
- Validate collision and navigation against the visual promise.
|
package/templates/skills/genex-threejs-procedural-architecture/references/architecture-systems.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Architecture Systems
|
|
2
|
+
|
|
3
|
+
Use this guide for authored procedural buildings and city pieces.
|
|
4
|
+
|
|
5
|
+
## Massing
|
|
6
|
+
|
|
7
|
+
- Start with readable volumes.
|
|
8
|
+
- Mark exposed faces and hidden faces.
|
|
9
|
+
- Identify corners, roof lines, ground contact, entrances, and traversal edges.
|
|
10
|
+
- Keep player scale visible through doors, windows, railings, or props.
|
|
11
|
+
|
|
12
|
+
## Facade grammar
|
|
13
|
+
|
|
14
|
+
- Split faces into floor bands and bay columns.
|
|
15
|
+
- Assign modules by semantic role: entrance, window, blank wall, balcony, trim,
|
|
16
|
+
corner, roof, and service detail.
|
|
17
|
+
- Compile repeated modules into shared geometry where possible.
|
|
18
|
+
- Keep material groups stable across variants.
|
|
19
|
+
|
|
20
|
+
## Gameplay
|
|
21
|
+
|
|
22
|
+
- Generate simple collision proxies.
|
|
23
|
+
- Keep navigable gaps wide enough for the controller.
|
|
24
|
+
- Avoid decorative protrusions that snag movement unless they are intentional.
|
|
25
|
+
- Expose landmarks and silhouettes for orientation.
|
|
26
|
+
|
|
27
|
+
## Budgets
|
|
28
|
+
|
|
29
|
+
- Use instancing for repeated windows, trims, and panels.
|
|
30
|
+
- Collapse background buildings to simpler facades.
|
|
31
|
+
- Add close-up ornaments only where inspection distance requires them.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genex-threejs-procedural-fields
|
|
3
|
+
description: Create coherent procedural scalar and vector fields for Genex Three.js games. Use for terrain, masks, biome maps, water influence, cloud density, material variation, displacement, wear, normals, domain warping, and visuals where multiple channels need a shared cause.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Genex Three.js Procedural Fields
|
|
7
|
+
|
|
8
|
+
Use fields to make generated visuals feel caused rather than layered. A field
|
|
9
|
+
can drive geometry, materials, particles, sound hooks, and gameplay affordances.
|
|
10
|
+
|
|
11
|
+
Read [references/field-systems.md](references/field-systems.md) for field
|
|
12
|
+
stacks, masks, warping, and diagnostics.
|
|
13
|
+
|
|
14
|
+
## Build order
|
|
15
|
+
|
|
16
|
+
1. Define the domain: world, object, planet, UV, screen, or simulation space.
|
|
17
|
+
2. Choose base fields with named frequency bands.
|
|
18
|
+
3. Add domain warping only after the unwarped structure reads.
|
|
19
|
+
4. Derive masks, normals, roughness, color, density, and displacement from
|
|
20
|
+
shared field causes.
|
|
21
|
+
5. Expose debug views for each important field and mask.
|
|
22
|
+
6. Keep seed, scale, amplitude, and thresholds explicit.
|
|
23
|
+
|
|
24
|
+
## Rules
|
|
25
|
+
|
|
26
|
+
- Do not stack unrelated noise until the result looks detailed.
|
|
27
|
+
- Keep units stable across camera distance and object scale.
|
|
28
|
+
- Derive normals from the same height or density field used for displacement.
|
|
29
|
+
- Use causal masks: wetness should follow water, scorch should follow impact,
|
|
30
|
+
and snow should follow slope/exposure.
|
|
31
|
+
- Clamp, remap, and document field ranges before feeding shaders.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Field Systems
|
|
2
|
+
|
|
3
|
+
Use this guide to build reusable fields for Genex scenes.
|
|
4
|
+
|
|
5
|
+
## Field stack
|
|
6
|
+
|
|
7
|
+
- `base`: low-frequency silhouette or terrain structure.
|
|
8
|
+
- `detail`: mid-frequency material and shape variation.
|
|
9
|
+
- `micro`: high-frequency normals or roughness, filtered by distance.
|
|
10
|
+
- `mask`: semantic influence such as water, biome, damage, snow, or wear.
|
|
11
|
+
- `flow`: vector direction for wind, particles, waves, or erosion.
|
|
12
|
+
|
|
13
|
+
## Domain rules
|
|
14
|
+
|
|
15
|
+
- World-space fields should not swim when objects move.
|
|
16
|
+
- Object-space fields should travel with the mesh.
|
|
17
|
+
- UV-space fields should be reserved for authored assets or atlases.
|
|
18
|
+
- Screen-space fields should never drive persistent world identity.
|
|
19
|
+
|
|
20
|
+
## Diagnostics
|
|
21
|
+
|
|
22
|
+
Expose a way to render:
|
|
23
|
+
|
|
24
|
+
- raw field values;
|
|
25
|
+
- threshold masks;
|
|
26
|
+
- gradient or normal direction;
|
|
27
|
+
- warped versus unwarped domains;
|
|
28
|
+
- seed variations;
|
|
29
|
+
- near and far camera views.
|
|
30
|
+
|
|
31
|
+
## Performance
|
|
32
|
+
|
|
33
|
+
- Share field functions between CPU generation and shader paths when possible.
|
|
34
|
+
- Cache generated textures that do not change every frame.
|
|
35
|
+
- Use lower resolution or fewer octaves for far-distance fields.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genex-threejs-procedural-geometry
|
|
3
|
+
description: Build procedural mesh systems for Genex Three.js games. Use for mesh writers, profile sweeps, rails, branches, frames, collision-aware shapes, UV density, custom normals, material groups, instancing decisions, and geometry that must hold up to close gameplay inspection.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Genex Three.js Procedural Geometry
|
|
7
|
+
|
|
8
|
+
Procedural geometry should have semantic structure, stable normals, and a clear
|
|
9
|
+
budget. Build mesh writers that explain what they emit.
|
|
10
|
+
|
|
11
|
+
Read [references/mesh-systems.md](references/mesh-systems.md) for profile
|
|
12
|
+
sweeps, mesh writers, normals, UVs, and validation.
|
|
13
|
+
|
|
14
|
+
## Build order
|
|
15
|
+
|
|
16
|
+
1. Define semantic parts and gameplay purpose before vertices.
|
|
17
|
+
2. Choose topology: instanced primitives, merged mesh, skinned mesh, or custom
|
|
18
|
+
buffer geometry.
|
|
19
|
+
3. Emit positions, normals, UVs, indices, material groups, and bounds together.
|
|
20
|
+
4. Keep resolution tied to screen distance or gameplay importance.
|
|
21
|
+
5. Generate collision/proxy geometry separately when needed.
|
|
22
|
+
6. Add debug modes for wireframe, normals, groups, UV density, and bounds.
|
|
23
|
+
|
|
24
|
+
## Rules
|
|
25
|
+
|
|
26
|
+
- Avoid procedural meshes with unnamed arrays and no semantic parts.
|
|
27
|
+
- Keep winding, normals, and tangent expectations consistent.
|
|
28
|
+
- Use material groups deliberately; do not create one material per tiny piece.
|
|
29
|
+
- Recompute bounds after generated changes.
|
|
30
|
+
- Dispose old geometries and materials on regeneration.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Mesh Systems
|
|
2
|
+
|
|
3
|
+
Use this guide for reusable procedural mesh writers.
|
|
4
|
+
|
|
5
|
+
## Mesh writer contract
|
|
6
|
+
|
|
7
|
+
A mesh writer should declare:
|
|
8
|
+
|
|
9
|
+
- input seed and parameters;
|
|
10
|
+
- emitted semantic parts;
|
|
11
|
+
- vertex and triangle budget;
|
|
12
|
+
- material slots;
|
|
13
|
+
- UV convention;
|
|
14
|
+
- bounds and collision proxy behavior;
|
|
15
|
+
- regeneration and disposal policy.
|
|
16
|
+
|
|
17
|
+
## Profile sweeps
|
|
18
|
+
|
|
19
|
+
- Define a 2D profile with named control points.
|
|
20
|
+
- Sweep along a path with stable tangent, normal, and binormal frames.
|
|
21
|
+
- Add caps intentionally.
|
|
22
|
+
- Keep UV length proportional to world distance.
|
|
23
|
+
- Expose cross-section debug lines.
|
|
24
|
+
|
|
25
|
+
## Normals and UVs
|
|
26
|
+
|
|
27
|
+
- Use smooth normals for organic forms and split normals for hard surfaces.
|
|
28
|
+
- Avoid accidental smoothing across material or silhouette seams.
|
|
29
|
+
- Keep UV density consistent across parts that share a material.
|
|
30
|
+
- Validate mirrored or repeated UV islands against normal maps.
|
|
31
|
+
|
|
32
|
+
## Instancing
|
|
33
|
+
|
|
34
|
+
Use instancing when many pieces share geometry and material. Avoid instancing
|
|
35
|
+
when each piece needs unique topology, unique material state, or separate
|
|
36
|
+
collision behavior that dominates the cost.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genex-threejs-procedural-materials
|
|
3
|
+
description: Author production procedural materials for Genex Three.js games. Use for PBR identity, terrain materials, atlas filtering, specular anti-aliasing, wetness, biome surfaces, dissolves, procedural normals, roughness variation, and readable materials across gameplay distances.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Genex Three.js Procedural Materials
|
|
7
|
+
|
|
8
|
+
Materials should communicate object identity, state, and gameplay affordance.
|
|
9
|
+
Build them from shared fields and inspectable parameters.
|
|
10
|
+
|
|
11
|
+
Read [references/material-systems.md](references/material-systems.md) for PBR
|
|
12
|
+
roles, filtering, masks, and shader handoff patterns.
|
|
13
|
+
|
|
14
|
+
## Build order
|
|
15
|
+
|
|
16
|
+
1. Define material identity: base color family, metalness, roughness, normal
|
|
17
|
+
scale, edge wear, and gameplay state.
|
|
18
|
+
2. Choose field causes for variation before writing shader code.
|
|
19
|
+
3. Derive color, roughness, normals, wetness, and emission from named masks.
|
|
20
|
+
4. Add distance-aware filtering for micro detail.
|
|
21
|
+
5. Keep a no-post preview where the material still reads.
|
|
22
|
+
6. Expose debug toggles for albedo, roughness, normals, masks, and emission.
|
|
23
|
+
|
|
24
|
+
## Rules
|
|
25
|
+
|
|
26
|
+
- Do not rely on bloom or grading to make a weak material interesting.
|
|
27
|
+
- Keep roughness variation physically plausible for the object.
|
|
28
|
+
- Filter high-frequency normals and atlas lookups to reduce shimmer.
|
|
29
|
+
- Treat emission as authored signal, not a blanket glow.
|
|
30
|
+
- Make damage, wetness, heat, or dissolve follow a stable mask.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Material Systems
|
|
2
|
+
|
|
3
|
+
Use this reference when building procedural materials for Genex games.
|
|
4
|
+
|
|
5
|
+
## PBR roles
|
|
6
|
+
|
|
7
|
+
- Base color carries identity and broad variation.
|
|
8
|
+
- Roughness controls highlight size and material age.
|
|
9
|
+
- Metalness should usually be binary or near-binary by surface type.
|
|
10
|
+
- Normals add shape detail but should not replace silhouette.
|
|
11
|
+
- Emission should have a scene-relative intensity hierarchy.
|
|
12
|
+
|
|
13
|
+
## Filtering
|
|
14
|
+
|
|
15
|
+
- Fade micro normals with distance.
|
|
16
|
+
- Use mip-aware texture sampling for generated atlases.
|
|
17
|
+
- Reduce specular aliasing on tiny bright details.
|
|
18
|
+
- Avoid unbounded high-frequency noise in motion.
|
|
19
|
+
|
|
20
|
+
## Common masks
|
|
21
|
+
|
|
22
|
+
- Wetness: driven by water height, splash, or exposed low points.
|
|
23
|
+
- Wear: driven by edges, contact, pathing, or gameplay interaction.
|
|
24
|
+
- Heat: driven by event timelines and cooling curves.
|
|
25
|
+
- Dissolve: driven by a stable object-space or authored field.
|
|
26
|
+
- Biome: driven by altitude, slope, latitude, moisture, or gameplay zones.
|
|
27
|
+
|
|
28
|
+
## Debug views
|
|
29
|
+
|
|
30
|
+
Provide direct views of base color, roughness, normals, mask values, emission,
|
|
31
|
+
and final lit material before post-processing.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genex-threejs-procedural-planets
|
|
3
|
+
description: Author procedural planets for Genex Three.js games. Use for spherical terrain, continents, ridges, craters, biome masks, coastlines, altitude detail, orbit-to-surface transitions, planet-relative cameras, material variation, and playable planetary bodies.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Genex Three.js Procedural Planets
|
|
7
|
+
|
|
8
|
+
Planets must hold up across extreme scale changes. Build shared terrain,
|
|
9
|
+
material, atmosphere, and camera rules around one planet contract.
|
|
10
|
+
|
|
11
|
+
Read [references/planet-systems.md](references/planet-systems.md) for terrain
|
|
12
|
+
fields, LOD, materials, and orbit-to-surface checks.
|
|
13
|
+
|
|
14
|
+
## Build order
|
|
15
|
+
|
|
16
|
+
1. Define radius, gravity/up convention, playable altitude range, camera envelope,
|
|
17
|
+
and target quality tiers.
|
|
18
|
+
2. Build low-frequency continent and elevation fields.
|
|
19
|
+
3. Add ridges, craters, erosion bands, biome masks, and coastline rules.
|
|
20
|
+
4. Derive normals, material masks, and gameplay zones from the same fields.
|
|
21
|
+
5. Add atmosphere and clouds only after terrain readability is stable.
|
|
22
|
+
6. Expose debug views for elevation, slope, biome, coast, normal, and LOD.
|
|
23
|
+
|
|
24
|
+
## Rules
|
|
25
|
+
|
|
26
|
+
- Use planet-relative up vectors for cameras, actors, and placement.
|
|
27
|
+
- Keep procedural detail stable between orbit and close approach.
|
|
28
|
+
- Filter altitude detail by camera distance and surface scale.
|
|
29
|
+
- Avoid unrelated noise layers that break geological cause.
|
|
30
|
+
- Make spawn points, traversal zones, and hazards serializable by seed.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Planet Systems
|
|
2
|
+
|
|
3
|
+
Use this reference for spherical worlds in Genex games.
|
|
4
|
+
|
|
5
|
+
## Terrain fields
|
|
6
|
+
|
|
7
|
+
- Base elevation: continents, basins, and major silhouettes.
|
|
8
|
+
- Structural detail: ridges, faults, crater rims, erosion lines.
|
|
9
|
+
- Surface masks: water, snow, biome, rock, sand, city, hazard.
|
|
10
|
+
- Normals: derived from the elevation field, not unrelated texture noise.
|
|
11
|
+
|
|
12
|
+
## Orbit-to-surface LOD
|
|
13
|
+
|
|
14
|
+
- Use lower-frequency geometry from orbit.
|
|
15
|
+
- Add displacement and material detail as the camera approaches.
|
|
16
|
+
- Keep coastlines, large craters, and landmarks stable across LOD boundaries.
|
|
17
|
+
- Use debug captures at orbit, high altitude, gameplay altitude, and close view.
|
|
18
|
+
|
|
19
|
+
## Gameplay
|
|
20
|
+
|
|
21
|
+
- Store seeds and planet parameters in serializable config.
|
|
22
|
+
- Derive spawn zones from slope, altitude, biome, and hazard masks.
|
|
23
|
+
- Keep planet-relative controls and camera up vectors consistent.
|
|
24
|
+
- Separate visual tessellation from gameplay collision when necessary.
|
|
25
|
+
|
|
26
|
+
## Rendering
|
|
27
|
+
|
|
28
|
+
- Add atmosphere after terrain material masks are readable.
|
|
29
|
+
- Keep clouds in a separate layer with independent quality controls.
|
|
30
|
+
- Use exposure and aerial perspective to explain scale without hiding terrain.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: genex-threejs-procedural-vegetation
|
|
3
|
+
description: Generate procedural vegetation for Genex Three.js games. Use for trees, trunks, roots, recursive branches, canopies, leaf cards, grass clumps, species presets, deterministic variation, growth forces, wind deformation, and vegetation that supports navigation or scene readability.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Genex Three.js Procedural Vegetation
|
|
7
|
+
|
|
8
|
+
Vegetation should read as a species with structure, not as random cylinders and
|
|
9
|
+
leaf sprites. Build growth rules that support gameplay scale and navigation.
|
|
10
|
+
|
|
11
|
+
Read [references/vegetation-systems.md](references/vegetation-systems.md) for
|
|
12
|
+
branching, foliage, wind, placement, and budgets.
|
|
13
|
+
|
|
14
|
+
## Build order
|
|
15
|
+
|
|
16
|
+
1. Define species silhouette, height range, trunk character, canopy density, and
|
|
17
|
+
gameplay role.
|
|
18
|
+
2. Generate trunk, roots, primary branches, secondary branches, and foliage as
|
|
19
|
+
separate semantic parts.
|
|
20
|
+
3. Use seeded growth forces: upward bias, light seeking, gravity, spread, and
|
|
21
|
+
obstacle avoidance.
|
|
22
|
+
4. Place foliage with stable normals, density masks, and LOD behavior.
|
|
23
|
+
5. Add wind after static form reads.
|
|
24
|
+
6. Expose debug views for hierarchy, branch radius, foliage density, and wind.
|
|
25
|
+
|
|
26
|
+
## Rules
|
|
27
|
+
|
|
28
|
+
- Keep branching deterministic for a given seed.
|
|
29
|
+
- Do not let leaf cards carry the entire silhouette at close range.
|
|
30
|
+
- Use lower geometry density for background vegetation.
|
|
31
|
+
- Keep collision/navigation proxies simpler than visual meshes.
|
|
32
|
+
- Make wind hierarchical: trunk slow, branches medium, leaves fast.
|