[GH-ISSUE #7318] Native mods: block textures for a client mod's own pass (where a block's sprites are, and the arrays) #3211

Open
opened 2026-11-03 04:06:42 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Stink-O on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7318

Originally assigned to: @Stink-O on GitHub.

🤖 Opened by Stink-O's AI agent (Claude Code, Claude Opus 5.5), not by Stink-O personally.

What

A native client mod that draws blocks in its own pass can't use the game's block textures today. That covers flying debris drawn as voxels, block previews, ghost builds, and block-shaped particles in a shader. Such a mod needs two things:

  1. Where a block's textures are. For each side of a block state: which layer of which sprite array holds each face, where the face lies on the side, how its texture runs across it (rotations included), and its tint source (grass, foliage, water or a fixed colour). The layer a sprite lands on depends on the resource packs and on the GPU's array split, so a mod can't work it out.
  2. The arrays themselves. WorldDrawn has the entity atlas but not the block sprite arrays the terrain samples.

This is part of making Orbital Laser native: its Hurricane throws blocks that it draws as voxels in its post pass, and they should wear the player's own textures, resource packs included.

Proposal

  • Helpers native_block_sprites(blocks), native_texture_sprites(textures) and native_block_sprites_version(), which changes when resources load again. They come from a helper-only fragment, and the Host is regenerated.
    • The answer is the model's own faces as the mesher bakes them, from a small block_sprites::Lookup in the render crate.
    • The tint comes from a new MeshTables::tint_source, the source-level twin of default_tint.
  • A field WorldDrawn::block_sprites, which is additive since WorldDrawn is #[non_exhaustive]. It holds:
    • the eight array views as the terrain binds them;
    • the device's split;
    • the layer size;
    • a nearest repeating sampler, plus the terrain's own filtered one.

I'll implement it, with a GPU test that a pass samples a layer through those views and an ignored test against prepared resources.

🤖 Generated with Claude Code

Originally created by @Stink-O on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7318 Originally assigned to: @Stink-O on GitHub. > 🤖 Opened by Stink-O's AI agent (Claude Code, Claude Opus 5.5), not by Stink-O personally. ## What A native client mod that draws blocks in its own pass can't use the game's block textures today. That covers flying debris drawn as voxels, block previews, ghost builds, and block-shaped particles in a shader. Such a mod needs two things: 1. **Where a block's textures are.** For each side of a block state: which layer of which sprite array holds each face, where the face lies on the side, how its texture runs across it (rotations included), and its tint source (grass, foliage, water or a fixed colour). The layer a sprite lands on depends on the resource packs and on the GPU's array split, so a mod can't work it out. 2. **The arrays themselves.** `WorldDrawn` has the entity atlas but not the block sprite arrays the terrain samples. This is part of making Orbital Laser native: its Hurricane throws blocks that it draws as voxels in its post pass, and they should wear the player's own textures, resource packs included. ## Proposal - **Helpers** `native_block_sprites(blocks)`, `native_texture_sprites(textures)` and `native_block_sprites_version()`, which changes when resources load again. They come from a helper-only fragment, and the `Host` is regenerated. - The answer is the model's own faces as the mesher bakes them, from a small `block_sprites::Lookup` in the render crate. - The tint comes from a new `MeshTables::tint_source`, the source-level twin of `default_tint`. - **A field** `WorldDrawn::block_sprites`, which is additive since `WorldDrawn` is `#[non_exhaustive]`. It holds: - the eight array views as the terrain binds them; - the device's split; - the layer size; - a nearest repeating sampler, plus the terrain's own filtered one. I'll implement it, with a GPU test that a pass samples a layer through those views and an ignored test against prepared resources. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Author
Owner

@Stink-O commented on GitHub (Nov 2, 2026):

/claim

<!-- gh-comment-id:6579620805 --> @Stink-O commented on GitHub (Nov 2, 2026): /claim
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3211
No description provided.