Skip to content

[Feature] OpenGL Backend #172

@brenocq

Description

@brenocq

Feature description
This feature proposes the introduction of a Backend System for ImPlot3D. Currently, depth sorting is performed on the CPU at a per-triangle level (Z-sorting), which is computationally expensive for large datasets and fails to resolve visual artifacts when triangles intersect or overlap complexly. By supporting a dedicated OpenGL Backend, ImPlot3D can leverage the GPU's hardware depth buffer (Z-buffer) for per-pixel depth testing, ensuring perfect intersections and significantly higher performance. When no backend is initialized, ImPlot3D should fall back to CPU Z-sorting.

This issue will also resolve #171 #126 #121 #111 #100

Tasks

  • Study ImGui OpenGL backend
  • Define how this could be implemented
  • Create plot RGBA texture with hardcoded colors
  • Create plot depth texture
  • Render plot rect as plot RGBA texture
  • Create 3D rendering OpenGL shader
  • Render plot RGBA texture from ImDrawList3D using depth texture
  • Alpha Blending with sorted triangles
  • Per-pixel plot clipping
  • Instanced line rendering
  • Instanced marker rendering
  • Render images

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions