Skip to content

Extract built-in shader packages for editor tooling. - #271

Open
tychedelia wants to merge 1 commit into
mainfrom
py-shader-packages
Open

tychedelia wants to merge 1 commit into
mainfrom
py-shader-packages

Conversation

@tychedelia

@tychedelia tychedelia commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

Objective

When users install our wheel via pypi, we need a way for them to be able to access the shader source for shader tooling via wgsl-analyzer.

This allows the root processing_py module to function as a CLI and adds a new command that allows users to create a wesl.toml:

python -m processing_py shaders init

Testing

Needs uv and a recent wgsl-analyzer (just use VS Code).

  1. Build a wheel from this branch:

    gh pr checkout 271
    git submodule update --init
    cd crates/processing_pyo3
    uv run maturin build --release -o /tmp/pp-wheel
    
  2. Make a fresh project and install it:

    mkdir /tmp/shader-demo && cd /tmp/shader-demo
    uv venv && uv pip install /tmp/pp-wheel/*.whl
    
  3. Write the shader packages and the manifest:

    .venv/bin/python -m processing_py shaders init
    cat wesl.toml
    
  4. Add a shader that imports from both packages, as shaders/noise.wesl:

    import { lygia::generative::snoise::snoise33 };
    import { processing::{globals, VertexOutput} };
    
    @group(3) @binding(0) var<uniform> color: vec4<f32>;
    
    @fragment
    fn fragment(mesh: VertexOutput) -> @location(0) vec4<f32> {
        let p = mesh.world_position.xyz * 0.02 + globals.time * 0.1;
        let n = snoise33(p) * 0.5 + 0.5;
        return vec4(vec3(n), 1.0) * color;
    }

    Open the folder in VS Code.

@tychedelia
tychedelia added this pull request to stack #277 November 13, 2026 01:16
@tychedelia
tychedelia requested a review from catilac November 13, 2026 01:33
@tychedelia
tychedelia marked this pull request as ready for review November 13, 2026 01:33
@github-actions

Copy link
Copy Markdown

Visual regression: 1 changed of 43 cases

case status detail
py_flocking_gpu ❌ changed 7.99% of pixels differ

If these changes are intentional, add the deliberate-rendering-change label.

baseline 21a2dda7ac · adapter llvmpipe (LLVM 20.1.2, 256 bits) (Vulkan, Mesa 25.2.8-0ubuntu0.24.04.4 (LLVM 20.1.2))

Open the visual report · workflow run

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant