Skip to main content

Symbolic Scene Language - Convert geometric expressions to shader code for sphere-traced rendering

Project description

SySL: Symbolic Scene Language

License: MIT Python 3.8+ PyPI - Version

SySL extends GeoLiPI by adding material-related symbols to geometric expressions. It provides an shader evaluation pipeline that converts symbolic scene expressions into GLSL shader code, enabling sphere-traced rendering and real-time interactive WebGL visualization.

SySL Rendering Examples

Applications

1. Paper-Ready Renders

Generate high-quality renders of primitive assemblies without mesh conversion. I used this system for rendering primitive assemblies for paper figures in a recent work Residual Primitive Fitting of 3D Shapes with SuperFrusta.

Primitive Assembly Render

2. Interactive Web Visualization

Create standalone HTML files for interactive 3D visualization. Useful for debugging, or stand alone apps.

Interactive Demo

3. Interactive Assembly editor.

Create an standalone app for editing textured (deployable) primitive assemblies.

Editing Demo

4. Animation Sequences

Generate frame-by-frame renders for animations.

Editing Demo

Features

  • Material Expressions: Define materials with albedo, metallic, roughness, emissive properties
  • Multiple Render Modes: From simple Inigo-style to PBR-quality Matthieu-style rendering
  • Shader Code Generation: Convert symbolic expressions to optimized GLSL
  • Interactive Visualization: Generate standalone HTML files with WebGL rendering
  • Jupyter Integration: Inline visualization in notebooks
  • Offline Rendering: Headless rendering via ModernGL (optional)
  • Image Effects (IMFX): Post-processing effects like outlines, dithering, anti-aliasing

Installation

From PyPI (recommended)

SySL is published on PyPI under the name sysl3d. For most users this is the easiest way to get started:

pip install sysl3d

You will also need GeoLiPI, which provides the geometric expression system that SySL builds on:

pip install geolipi

From source

git clone https://github.com/bardofcodes/sysl.git
cd sysl

# Install dependencies
pip install -r requirements.txt

# Editable install for development
pip install -e .

Quick Start

Basic example

import geolipi.symbolic as gls
import sysl.symbolic as sls
from sysl.shader import DEFAULT_SETTINGS, RenderMode, evaluate_to_shader
from sysl.shader_runtime import create_shader_html

# Create simple geometry
geometry = gls.Sphere3D((1.0,))

# Define a basic V4 material (albedo, emissive, mrc)
material = sls.MaterialV4(
    (1.0, 0.2, 0.1),  # albedo
    (0.0, 0.0, 0.0),  # emissive
    (0.5, 0.3, 0.0),  # metallic / roughness / clearcoat
)
scene = sls.MatSolidV4(geometry, material)

# Choose a render mode and settings
settings = dict(DEFAULT_SETTINGS)
settings["render_mode"] = RenderMode.V4

# Generate shader
shader_code, uniforms, textures = evaluate_to_shader(scene, settings=settings)

# Generate HTML viewer
html_code = create_shader_html(
    shader_code,
    uniforms,
    textures,
    show_controls=True,
)

# Save to a file and serve via a simple HTTP server
with open("sysl_example.html", "w") as f:
    f.write(html_code)

Jupyter Notebook

from IPython.display import HTML, display
from sysl.shader_runtime.generate_shader_html import make_jupyter_compatible_html

wrapped = make_jupyter_compatible_html(html_code)
display(HTML(wrapped))

Jupyter Notebook

See notebooks/ for examples.

Render Modes

SySL supports multiple rendering pipelines, each with different visual characteristics:

Mode Description Use Case Source
V1 Simple Inigo-style Fast preview, basic shading ShaderToy
V2 Inigo + Color Simple colored renders ShaderToy
V3 J. Matthieu-style Material functions with (p, n) ShaderToy
V4 Adapted Matthieu Local materials + mixing (default) ShaderToy
V5 Toon Shader NPR stylized rendering ShaderToy
V6 Dithered Shader V2 + Dithering + outline ShaderToy

Selecting a render mode

You can select different render modes via the RenderMode enum:

from sysl.shader import DEFAULT_SETTINGS, RenderMode, evaluate_to_shader

settings = dict(DEFAULT_SETTINGS)
settings["render_mode"] = RenderMode.V4  # v1–v6

shader_code, uniforms, textures = evaluate_to_shader(expression, settings=settings)

API overview

The main entry points most users interact with are:

  • sysl.evaluate_to_shader(expression, mode=\"singlepass\" | \"multipass\", settings=None)
  • sysl.create_shader_html(shader_code, uniforms, textures, show_controls=False, ...)
  • sysl.symbolic – symbolic building blocks (materials, combinators, fields, etc.)

See the examples in examples/ and notebooks/ for more complete workflows.

Image Effects (IMFX)

Post-processing effects available in multi-pass rendering:

  • Outlines: Edge detection for shape boundaries

  • Selection Highlight: Highlight specific primitives (used in editing mode)

  • Dithering: Stylized dither patterns

  • FXAA: Fast approximate anti-aliasing

Project Structure

sysl/
├── sysl/
│   ├── symbolic/        # Material symbols and MatSolid definitions
│   ├── shader/          # Expression → GLSL shader conversion
│   │   ├── shader_templates/  # GLSL template modules
│   │   └── utils/       # UBO packing, texture encoding
│   ├── shader_runtime/  # HTML generation, offline rendering
│   └── torch_compute/   # PyTorch-based evaluation (optional)
├── scripts/             # Example scripts
├── notebooks/           # Jupyter notebook examples
├── tests/               # Pytest-based test suite
└── assets/              # Images for documentation

Acknowledgments

This project builds heavily on the excellent work from the ShaderToy community:

  • Inigo Quilez (iquilezles.org) - SDF primitives, combinators, and basic sphere tracing / rendering techniques
  • Matthieu Jacquemet (ShaderToy) - A material system + alternate rendering system.

Important License Note: The MIT license applies to the Python code in this repository. The GLSL shader templates are derived from ShaderToy contributions and retain their original authors' licensing terms. Please respect the original authors' licenses when using generated shader code.

Citation

If you use SySL in your research, please cite:

@misc{ganeshan2025superfit,
  title={Residual Primitive Fitting of 3D Shapes with SuperFrusta}, 
  author={Aditya Ganeshan and Matheus Gadelha and Thibault Groueix and Zhiqin Chen and Siddhartha Chaudhuri and Vladimir Kim and Wang Yifan and Daniel Ritchie},
  year={2025},
  eprint={2512.09201},
  archivePrefix={arXiv},
  primaryClass={cs.GR},
  url={https://arxiv.org/abs/2512.09201}, 
}

@article{ganeshan2025migumi,
  author = {Ganeshan, Aditya and Fleischer, Kurt and Jakob, Wenzel and Shamir, Ariel and Ritchie, Daniel and Igarashi, Takeo and Larsson, Maria},
  title = {MiGumi: Making Tightly Coupled Integral Joints Millable},
  year = {2025},
  publisher = {Association for Computing Machinery},
  volume = {44},
  number = {6},
  url = {https://doi.org/10.1145/3763304},
  doi = {10.1145/3763304},
  journal = {ACM Trans. Graph.},
  articleno = {193},
}

Known Limitations & Future Work

  • Code Duplication: Shader templates have some duplication that could be refactored
  • Complex Scenes: Very complex scenes may benefit from cone tracing (not yet implemented)
  • WebGPU: Currently WebGL only; WGPU support planned
  • Configuration Persistence: Saving/loading editor configurations not yet supported

See sysl/shader/shader_templates/future_shaders.md for planned shader additions.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Note: Shader templates derived from ShaderToy retain their original licensing.

Maintenance & contributions

SySL is currently solo-maintained. Releases, versioning, and roadmap decisions are made by the maintainer and may evolve as the surrounding research/software does.

At this time the project has a closed contribution policy:

  • External pull requests are not accepted by default.
  • Bug reports and feature requests are still welcome via GitHub issues.

If this policy changes in the future, the README and CONTRIBUTING.md will be updated to reflect the new contribution model.

Contact


This project is under active development. APIs may change between versions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sysl3d-0.1.0.tar.gz (29.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sysl3d-0.1.0-py3-none-any.whl (197.8 kB view details)

Uploaded Python 3

File details

Details for the file sysl3d-0.1.0.tar.gz.

File metadata

  • Download URL: sysl3d-0.1.0.tar.gz
  • Upload date:
  • Size: 29.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for sysl3d-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7a3467dcbe9c14b843f7dbf9e8e6cf6b4bbe876b24569c551b4477de35068b42
MD5 1a4cf1f0cdfac2f5d815fce343696a7a
BLAKE2b-256 90f1ac19468bc1ca94f2c8a86763c466f155a763687609076b9cc88e314e371f

See more details on using hashes here.

File details

Details for the file sysl3d-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sysl3d-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 197.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for sysl3d-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c8bf91abe6b03f56ac9aabccee5a7a54e96c3713e7a2e5c5fb7056ad2e7be385
MD5 d14772e92141622baf1bb8bd802a4f82
BLAKE2b-256 f48557ffcaa457512761f495f8c4cc954b96213855ce88a1603ea387adb1a69e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page