← All projects
Project record1 mention
Originally shared on Hacker News

SDF instruction interpreter shader prototype

An experimental rendering project in which SDF functions act as instructions: the CPU builds up instruction lists that are sent to the shader, and the fragment shader executes them like a mini bytecode interpreter. The screen is tiled so that no fragment has to evaluate too many instructions.

Last shared
01 / The problem

What it addresses

Avoiding too many SDF instructions being evaluated per fragment when the shader interprets CPU-built instruction lists.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. SDF instruction interpreter shader prototype

    An experimental rendering project in which SDF functions act as instructions: the CPU builds up instruction lists that are sent to the shader, and the fragment shader executes them like a mini bytecode interpreter. The screen is tiled so that no fragment has to evaluate too many instructions.

    Problem: Avoiding too many SDF instructions being evaluated per fragment when the shader interprets CPU-built instruction lists.

    Posted by @jkcxn · Original source ↗

    Source text · @jkcxn · · Source ↗

    I've done this for a project where the SDF functions are basically instructions, and you can build up instrictions on the CPU to send to the shader. and then the fragment shader runs them like a mini bytecode interpreter. You can tile up the screen to avoid having too many instructions per fragment.