Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9f95af4
add metadata parsing
verbiiz May 28, 2026
33c162d
move towards me actually kinda works!
verbiiz Jun 1, 2026
5526ca6
rl operators can collide with each other
verbiiz Jun 1, 2026
c1bfcd8
agent controller *almost* dispalys the frame from the agent's perspec…
verbiiz Jun 1, 2026
fa1cab7
it kinda displays a frame slightly
verbiiz Jun 1, 2026
69ad281
controller.py copied in
verbiiz Jun 1, 2026
65f985e
fix controller.py import into the game (doesnt listen to WASD however)
verbiiz Jun 1, 2026
6df4bfb
key listener works! alongside xos changes!
verbiiz Jun 1, 2026
e174dce
agent controller wasd starting to work!
verbiiz Jun 1, 2026
b30d00d
entities are orbs? lmao
verbiiz Jun 1, 2026
4c790a7
it kinda looks better/crispier but its mirrored
verbiiz Jun 1, 2026
a843b49
add the mouse show/hide and lock/unlock
verbiiz Jun 1, 2026
f5153af
patched mouse lock and hide in-game
verbiiz Jun 1, 2026
b318e4c
start moving like controller script but for the agent vision!
verbiiz Jun 1, 2026
49afd72
much better
verbiiz Jun 1, 2026
ae6b076
even more slightly better
verbiiz Jun 1, 2026
662b373
remove all look momentum (feels awesome)
verbiiz Jun 1, 2026
d2ba7a8
reractor to Vision.java
verbiiz Jun 1, 2026
d6a630b
use real render pipeline? contained!!! but its not displaying 100%
verbiiz Jun 1, 2026
e07bc5f
low poly renders!
verbiiz Jun 1, 2026
a7a1060
add some notes
verbiiz Jun 3, 2026
3839da8
update notes
verbiiz Jun 3, 2026
5020512
both versions of the renderer in the same codebase
verbiiz Jun 3, 2026
5d0ede5
updates to notes!
verbiiz Jun 3, 2026
3614905
split into a third vision class and start adding TexturedWorldVision,…
verbiiz Jun 3, 2026
68162e4
liquid dream stitching (not great but its a start of merging entities…
verbiiz Jun 3, 2026
2041b69
just use basic world vision fo rnow.
verbiiz Jun 3, 2026
ed91050
esc out
verbiiz Jun 3, 2026
471607e
shoot from viewport
verbiiz Jun 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 98 additions & 0 deletions MinecraftRenderingNotes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Minecraft Rendering Notes

This document tracks the current split vision stack and the historical commit lineage.

Current branch snapshot:

- **Current commit**: `5020512c394d8c4f4b27b93d6f6659cfc16606a0`
- **Both renderers now exist in the same branch/commit**:
- `EntityVision.java`
- `WorldVision.java`
- Runtime selection is currently in `XosViewportRuntime.renderAgentViewRgbaHex(...)` and `flushDeferredVisionCaptures(...)` with an easy comment swap.

---

## 1) Entity Rendering

### What `EntityVision` does now

`EntityVision` is the camera-driven render-pass path intended for accurate POV rendering:

- Per-camera context (`CameraContext`) keyed by agent UUID.
- Offscreen `TextureTarget` lifecycle management.
- Render-thread scheduling (`queueCapture` + `flushDeferredCaptures`) so world pass work stays on the correct thread.
- Capture using actual game render invocation (`renderLevel`) and readback.

Tiny internals example:

```java
camera.target = new TextureTarget(width, height, true, Minecraft.ON_OSX);
mc.setCameraEntity(cameraEntity);
gameRendererRenderLevelMethod.invoke(mc.gameRenderer, args);
GL11C.glReadPixels(..., GL11C.GL_RGBA, GL11C.GL_UNSIGNED_BYTE, buf);
```

Why `EntityVision` is the "accurate entity" direction:

- It is camera-entity based (agent POV), not just projected world math.
- It uses renderer passes rather than hand-authored entity shapes.
- It keeps per-camera state and deferred capture semantics needed for correctness.

---

## 2) World Rendering

### What `WorldVision` does now (ported from `4c790a70...` lineage)

`WorldVision` keeps the block-state ray/clip approach from the `b30d00d9...` and `4c790a70...` line:

- Per-pixel world ray casting using `ClipContext`.
- Block color from `MapColor` with registry-hash fallback.
- Distance and face-based shading for depth/readability.
- Entity overlay rendered as projected disks (orbs) with depth checks.

Tiny world hit example:

```java
var hit = mc.level.clip(new ClipContext(origin, rayEnd, OUTLINE, NONE, agent));
BlockPos bp = hit.getBlockPos();
int rgb = rgbFromBlockState(mc, bp, state);
```

Tiny orb overlay example:

```java
int color = rgbFromEntity(e);
if ((dx * dx + dy * dy) <= rr && camZ < depth[p]) {
// paint projected entity disk
}
```

What `WorldVision` gives:

- World **state structure** that is close to live block layout.
- Stable, readable rendering and predictable performance shape.
- Explicit fallback behavior that is easy to reason about.

What `WorldVision` does **not** provide:

- Mesh/textured entity rendering.
- Full native-frame parity with Minecraft's standard on-screen camera pass.

---

## EntityVision vs WorldVision

Both renderers now exist side by side in one branch so each can be stabilized independently.

- **`EntityVision`**
- Camera/render-pass architecture (`renderLevel` + offscreen target + readback).
- Best path toward true POV fidelity (including proper entity rendering).
- More sensitive to render-thread/target-state correctness.

- **`WorldVision`**
- Deterministic ray/clip world sampler with shaded block colors.
- Entity visibility via synthetic projected orbs.
- Easier to reason about for world-state output and debugging.

This split is intentional: verify each path independently, then merge strengths into one robust final renderer.
Loading