Skip to content

zzxzzk115/vrendergraph

Repository files navigation

vrendergraph

vrendergraph is a tiny data-driven render pipeline layer that builds a runtime FrameGraph from JSON.

CodeFactor

Editor Example Output

Goals:

  • Keep the runtime builder minimal and deterministic (execute passes in passes[] order).
  • Pass IO is described via inputs / outputs slot maps.
  • Optional meta field stores editor/tool UI state (node positions, zoom/pan, etc.) and is ignored by runtime.

JSON format

vrendergraph supports the legacy v0.2 shape and the v0.3 schema. v0.2 keeps slot connections as plain strings and resources as an external-resource array:

{
  "resources": ["backbuffer"],
  "passes": [
    {
      "id": "present",
      "type": "present",
      "inputs": {
        "color": "tone_mapping.ldr",
        "backbuffer": "backbuffer"
      }
    }
  ]
}

v0.3 adds explicit schema versioning, resource descriptors, pass conditions, view modes, and object-style resource references with selectors. Selectors are opaque to vrendergraph; engines can interpret fields such as view, time, mip, layer, or access.

{
  "version": 3,
  "resources": {
    "backbuffer": {
      "imported": true,
      "type": "texture",
      "extent": "swapchain",
      "format": "RGBA8"
    },
    "scene_color": {
      "type": "texture",
      "extent": "view",
      "format": "RGBA16F",
      "view": "inherit",
      "history": { "frames": 2 }
    }
  },
  "passes": [
    {
      "id": "taa",
      "type": "taa",
      "when": "xr || non_xr",
      "viewMode": "inherit",
      "inputs": {
        "current": { "resource": "scene_color", "view": "current", "time": "current" },
        "history": { "resource": "scene_color", "view": "current", "time": "previous" }
      },
      "outputs": {
        "color": { "resource": "taa.color", "view": "current", "time": "current" }
      }
    }
  ],
  "meta": {
    "editor": {
      "nodes": {
        "taa": { "pos": [0.0, 0.0] }
      }
    }
  }
}

Notes:

  • passes[] is required.
  • resources is optional.
  • v0.2 string refs are preserved and serialize as compact strings when no selector is present.
  • v0.3 object refs serialize selector fields next to resource for readability.
  • when, viewMode, resource desc fields, and selectors are intentionally engine-defined; vrendergraph stores them and passes resource descriptors to the importer.
  • meta{} is optional and intended for tools.

Example files:

  • examples/deferred_virtual/scene.v02.json
  • examples/deferred_virtual/scene.v03.json
  • examples/editor/scene.v03.json

Documentation

Editor helper header

vrendergraph_editor.hpp provides header-only helpers to read/write editor UI state into RenderGraphDesc::meta.

imgui.h and imnodes are needed.

License

This project is under the MIT license.

About

vrendergraph is a tiny data-driven render pipeline layer that builds a runtime FrameGraph from JSON.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Contributors

Generated from zzxzzk115/xmake-template