Orklev2 gbi

From tweakoz/orkid · View interactive version

Orklev2 gbi is an AI agent skill from the GitHub repository tweakoz/orkid. Answer questions about orkid's GeometryBufferInterface (GBI), vertex buffers, index buffers, vertex formats (SVtxV12C4T16, SVtxV12N12B12T8C4, etc.), VtxWriter, draw primitives, PrimitiveType, dynamic/static buffers, and Python geometry bindings. Use when the user asks about vertex buffers, geometry,

How to use this skill

Skill file

Orkid GeometryBufferInterface (GBI) Reference

When answering questions about geometry, vertex buffers, or draw calls in orkid, consult the files below. All under ork.lev2/.

Key Files

| Component | File |

|-----------|------|

| GBI Interface | inc/ork/lev2/gfx/gbi.h (lines 18–152) |

| Vertex/Index Buffers | inc/ork/lev2/gfx/gfxvtxbuf.h |

| Vertex Format Structs | inc/ork/lev2/gfx/gfxvtxbuf_structs.h |

| Vertex Buffer Inline | inc/ork/lev2/gfx/gfxvtxbuf.inl |

| Enums (formats, primitives) | inc/ork/lev2/gfx/gfxenv_enum.h |

| Base Implementation | src/gfx/context/gbi.cpp |

| Vulkan GBI | src/gfx/vulkan/vulkan_gbi.cpp |

| Python Bindings | pyext/src/pyext_gfx.cpp (lines 259–370) |

GBI Interface (gbi.h:18–152)

Vertex Buffer Operations

Index Buffer Operations

Draw Methods (EML — direct, no material management)

Draw Methods (with material)

2D Helpers

PrimitiveType (gfxenv_enum.h:165–178)

| Type | Description |

|------|-------------|

| POINTS | Point list |

| LINES | Line list |

| LINESTRIP | Connected line strip |

| LINELOOP | Closed line loop |

| TRIANGLES | Triangle list |

| TRIANGLESTRIP | Triangle strip |

| TRIANGLEFAN | Triangle fan |

| QUADS | Quad list |

| PATCHES | Tessellation patches |

Vertex Format Structs (gfxvtxbuf_structs.h)

| Struct | BPV | Components |

|--------|-----|-----------|

| VtxV12C4 | 16 | position(3f) + color(u32) |

| SVtxV12C4T16 | 32 | position(3f) + color(u32) + uv0(2f) + uv1(2f) |

| SVtxV12N12B12T8C4 | 48 | position(3f) + normal(3f) + binormal(3f) + uv(2f) + color(u32) |

| SVtxV12N12B12T16 | 52 | position(3f) + normal(3f) + binormal(3f) + uv0(2f) + uv1(2f) |

| SVtxV12N12T8I4W4 | 40 | position(3f) + normal(3f) + uv(2f) + boneIndices(u32) + boneWeights(u32) |

| SVtxV16T16C16 | 48 | position(4f) + texcoord(4f) + color(4f) |

EVtxStreamFormat enum (gfxenv_enum.h:350–401)

Compact format identifiers: V12, V12C4, V12T8, V12C4T16, V12N12B12T8C4, V12N12B12T16, V12N12T8I4W4, V16T16C16, VU32, VU32INST, etc.

Vertex Buffers (gfxvtxbuf.h)

VertexBufferBase (line 79)

Typed Buffers

Common Aliases

using dvb_V12C4T16 = DynamicVertexBuffer<SVtxV12C4T16>;
using dvb_V12N12B12T8C4 = DynamicVertexBuffer<SVtxV12N12B12T8C4>;
using dvb_V16T16C16 = DynamicVertexBuffer<SVtxV16T16C16>;

Index Buffers (gfxvtxbuf.h:26–75)

VtxWriter (gfxvtxbuf.h:140–163)

Dynamic geometry helper for building vertex data:

VtxWriter<SVtxV12C4T16> writer;
writer.Lock(ctx, &dynVB, vertexCount);
auto& vtx = writer.RefAndIncrement();
vtx._position = fvec3(x, y, z);
vtx._color = 0xFFFFFFFF;
vtx._uv0 = fvec2(u, v);
writer.UnLock(ctx);

ctx->GBI()->DrawPrimitiveEML(writer, PrimitiveType::TRIANGLES);

Members: miWriteBase, miWriteCounter, miWriteMax, mpBase, mpVB

Python API

gbi = ctx.GBI

# VtxWriter
writer = lev2.Writer_V12N12B12T8C4()

# Lock VB for raw access
memview = gbi.lockVB(vb, base, count)  # Returns memoryview
gbi.unlockVB(vb)

# Draw from writer
gbi.drawTriangles(writer)
gbi.drawTriangleStrip(writer)
gbi.drawLines(writer)

How to Answer

  1. For GBI methods: check gbi.h:18–152
  2. For vertex formats: check gfxvtxbuf_structs.h — search by struct name
  3. For buffer types: check gfxvtxbuf.h (Static/Dynamic)
  4. For primitive types: check gfxenv_enum.h:165–178
  5. For Vulkan mapping: check vulkan_gbi.cpp (topology + vertex stream config)
  6. For Python: check pyext_gfx.cpp:259–370
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.