{"id":19562682,"url":"https://github.com/jamsocket/limelight","last_synced_at":"2025-04-27T00:31:55.615Z","repository":{"id":45407860,"uuid":"430901208","full_name":"jamsocket/limelight","owner":"jamsocket","description":"Rust WebGL2 wrapper with a focus on making high-performance WebAssembly graphics code easier to write and maintain","archived":false,"fork":false,"pushed_at":"2024-01-22T14:38:43.000Z","size":10481,"stargazers_count":33,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-31T11:44:51.944Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamsocket.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-22T23:52:25.000Z","updated_at":"2023-08-01T15:26:58.000Z","dependencies_parsed_at":"2024-05-16T06:32:06.312Z","dependency_job_id":"21d4df74-bca5-4f26-914e-dd52be8758f7","html_url":"https://github.com/jamsocket/limelight","commit_stats":null,"previous_names":["jamsocket/limelight"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamsocket%2Flimelight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamsocket%2Flimelight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamsocket%2Flimelight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamsocket%2Flimelight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamsocket","download_url":"https://codeload.github.com/jamsocket/limelight/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224050672,"owners_count":17247380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T05:15:21.643Z","updated_at":"2024-11-11T05:15:22.645Z","avatar_url":"https://github.com/jamsocket.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Limelight\n\n[![GitHub Repo stars](https://img.shields.io/github/stars/drifting-in-space/limelight?style=social)](https://github.com/drifting-in-space/limelight)\n[![crates.io](https://img.shields.io/crates/v/limelight.svg)](https://crates.io/crates/limelight)\n[![docs.rs](https://img.shields.io/badge/docs-release-brightgreen)](https://docs.rs/limelight/)\n[![Rust](https://github.com/drifting-in-space/limelight/actions/workflows/rust.yml/badge.svg)](https://github.com/drifting-in-space/limelight/actions/workflows/rust.yml)\n\nLimelight is a `WebGL2` wrapper with a focus on making high-performance WebAssembly graphics code easier to write and maintain.\n\nhttps://user-images.githubusercontent.com/46173/146214698-784404f2-633c-4180-acda-1e8d64189e76.mov\n\n[live demo](https://drifting-in-space.github.io/limelight/primitive-scene/) ([code](https://github.com/drifting-in-space/limelight/tree/main/examples/primitive-scene))\n\nSpecifically, `limelight`:\n- Provides a functional interface that **abstracts away the statefulness of WebGL**.\n  It accomplishes this by using a *shadow GPU* that tracks the GPU's state, diffs it with the\n  desired state, and sends only the necessary instructions to WebGL.\n- Provides abstractions for buffers and uniforms that **defer GPU data transfer until the next draw cycle**.\n- Provides a **typed interface to uniforms and buffers**, and automatically generates bindings\n  between shader attributes and Rust `struct`s through a derive macro.\n- Provides an **interface for transforms** like zoom and pan through [`limelight-transform`](https://github.com/drifting-in-space/limelight/tree/main/transform).\n- Provides 2D **shape primitives** like circles and lines through [`limelight-primitives`](https://github.com/drifting-in-space/limelight/tree/main/primitives).\n\n# Getting started\n\n\u003ca href=\"https://drifting-in-space.github.io/limelight/05-primitives/\"\u003e\u003cimg style=\"width: 300px;\" src=\"https://github.com/drifting-in-space/limelight/raw/main/assets/05-primitives.png\" alt=\"Abstract art made from circles and rectangles.\" /\u003e\u003c/a\u003e\n\n([full code](https://github.com/drifting-in-space/limelight/tree/main/examples/05-primitives),\n[demo](https://drifting-in-space.github.io/limelight/05-primitives/))\n\nThis example uses [`limelight-primitives`](https://github.com/drifting-in-space/limelight/tree/main/primitives)\nand [`limelight-yew`](https://github.com/drifting-in-space/limelight/tree/main/yew) to construct a basic, static image\nmade from circles and rectangles.\n\n```rust\nuse anyhow::Result;\nuse limelight::{renderer::Drawable, Renderer};\nuse limelight_primitives::{Circle, CircleLayer, Rect, RectLayer};\nuse limelight_yew::{LimelightComponent, LimelightController};\n\nstruct Primitives {\n    rects: RectLayer,\n    circles: CircleLayer,\n}\n\nimpl LimelightController for Primitives {\n    fn draw(\n        \u0026mut self,\n        renderer: \u0026mut Renderer,\n        _ts: f64,\n    ) -\u003e Result\u003climelight_yew::ShouldRequestAnimationFrame\u003e {\n        self.rects.draw(renderer)?;\n        self.circles.draw(renderer)?;\n\n        Ok(false)\n    }\n}\n\nimpl Default for Primitives {\n    fn default() -\u003e Self {\n        let rects = RectLayer::new();\n        let circles = CircleLayer::new();\n\n        rects.buffer().set_data(vec![\n            Rect {\n                lower_right: [0.4, 0.1],\n                upper_left: [-0.8, 0.2],\n                color: palette::named::TOMATO.into(),\n            },\n            Rect {\n                lower_right: [0.4, 0.25],\n                upper_left: [-0.6, 0.5],\n                color: palette::named::SLATEBLUE.into(),\n            },\n        ]);\n\n        circles.buffer().set_data(vec![\n            Circle {\n                position: [0., 0.25],\n                radius: 0.2,\n                color: palette::named::WHITE.into(),\n            },\n            Circle {\n                position: [0., 0.25],\n                radius: 0.1,\n                color: palette::named::ORANGERED.into(),\n            },\n        ]);\n\n        Primitives { rects, circles }\n    }\n}\n\nfn main() {\n    console_error_panic_hook::set_once();\n    wasm_logger::init(wasm_logger::Config::default());\n    yew::start_app::\u003cLimelightComponent\u003cPrimitives\u003e\u003e();\n}\n```\n\n# More Examples\n\n- [Instancing](https://drifting-in-space.github.io/limelight/instances/) ([code](https://github.com/drifting-in-space/limelight/tree/main/examples/instances))\n- [Pong](https://drifting-in-space.github.io/limelight/pong/)  ([code](https://github.com/drifting-in-space/limelight/tree/main/examples/pong))\n- [Zooming / panning](https://drifting-in-space.github.io/limelight/zoom-pan/) ([code](https://github.com/drifting-in-space/limelight/tree/main/examples/zoom-pan))\n- [Full-canvas shader](https://drifting-in-space.github.io/limelight/shaderfun/) ([code](https://github.com/drifting-in-space/limelight/tree/main/examples/shaderfun))\n- [Primitive scene](https://drifting-in-space.github.io/limelight/primitive-scene/) ([code](https://github.com/drifting-in-space/limelight/tree/main/examples/primitive-scene))\n- [3D snowflake](https://drifting-in-space.github.io/limelight/snowflake/) ([code](https://github.com/drifting-in-space/limelight/tree/main/examples/snowflake))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamsocket%2Flimelight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamsocket%2Flimelight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamsocket%2Flimelight/lists"}