Open-Source Wikis

/

Bevy

/

Packages

/

bevy_gizmos_render

bevyengine/bevy

bevy_gizmos_render

The renderer for bevy_gizmos. Five files. Reads the per-frame gizmo storage produced by bevy_gizmos, extracts it into the render world, and draws the lines and triangles with a dedicated pipeline.

Purpose

Splitting rendering from data collection lets users compose a bevy_gizmos-only feature set without dragging in bevy_render. This crate is the renderer half.

Directory layout

crates/bevy_gizmos_render/src/
├── lib.rs            # GizmoRenderPlugin
├── pipeline_2d.rs    # 2D pipeline (line strip, triangle list)
├── pipeline_3d.rs    # 3D pipeline (depth-tested + non-depth-tested variants)
├── gizmo_lines.wgsl, gizmo_triangles.wgsl   # Shaders
└── …

Key abstractions

Type File Description
GizmoRenderPlugin crates/bevy_gizmos_render/src/lib.rs Adds the extract/prepare/render systems.
LineGizmoPipeline2d / LineGizmoPipeline3d crates/bevy_gizmos_render/src/pipeline_*.rs The two specialized pipelines.

How it works

In ExtractSchedule, the gizmo storage is moved into the render world. Prepare uploads vertex buffers and creates bind groups. Queue schedules draw calls onto the appropriate render phase (2d or 3d, opaque or overlay). The 3D path runs as a Transparent3d phase item (so it draws after opaque geometry); a non-depth-tested variant draws on top of everything.

Integration points

  • Depends on: bevy_gizmos, bevy_render, bevy_core_pipeline, bevy_camera.
  • Depended on by: bevy_internal (in default plugins).

Entry points for modification

  • Pipeline changes: the two pipeline files.
  • Shader changes: gizmo_lines.wgsl and gizmo_triangles.wgsl.

See also

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

bevy_gizmos_render – Bevy wiki | Factory