tmpvar.com wrench logo

POC / Shader Editor

Keywords

PassCreate(passName)

Add a pass with the unique name passName, this creates a renderpass that can be refererenced from other passes.

PassGetSampler(sourcePassName, sourcePassOutput)

Note: this is only allowed inside a PassCreate block

Fetch the output from another pass as a sampler2D

PassStore(format, outputName, value)

Note: this is only allowed inside a PassCreate block

Store a value in the specified outputName at the thread's current. This is effectively writing to one of the global out variables

  • formats: rgba8, r32f, etc..

PassSetSize(width, height)

Note: this is only allowed inside a PassCreate block

Sets the width and height of the pass. If not provided, it will default to the viewport size.

TODO: add support for scaling this relative to the viewport size

DEVLOG

Future

  • expand PassGetSampler to allow configuration (filtering, clamping mode, etc...)

  • implement PassSetInvocations(int)

  • implement PassSetMipmapBuilder()

  • implement PassParamF32(rangeStart, rangeEnd, initialValue, scale) Add a pass specific float slider with the given range and initial value scales: linear

  • add gltf loader/viewer

  • consider persisting undo/redo snapshot

Pending

  • handle nested PassGetSampler inside PassStore
  • ignore Pass* instructions that live in comments
  • add expression solver to allow pass size to be scaled

2024-09-08

  • implement PassSetSize(w, h)
  • actually resize render target based on PassSetSize
  • rename programs to passes
  • persist editor state on reload (e.g., cursor position and viewport)
  • make parser bugs not break the entire editing experience (try/catch)