{"id":16784736,"url":"https://github.com/lommix/solis_2d","last_synced_at":"2025-03-22T00:32:13.521Z","repository":{"id":257823909,"uuid":"869402055","full_name":"Lommix/solis_2d","owner":"Lommix","description":"2D global illumination using radiance cascade for the bevy-engine.","archived":false,"fork":false,"pushed_at":"2025-01-08T13:00:08.000Z","size":13025,"stargazers_count":26,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T06:35:53.736Z","etag":null,"topics":["2d","bevy","gamedev","gi","lighning","shader"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lommix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2024-10-08T08:31:59.000Z","updated_at":"2025-03-13T07:52:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"0d030bf9-c897-4fe8-9620-4b16264a8fb5","html_url":"https://github.com/Lommix/solis_2d","commit_stats":null,"previous_names":["lommix/solis_2d"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lommix%2Fsolis_2d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lommix%2Fsolis_2d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lommix%2Fsolis_2d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lommix%2Fsolis_2d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lommix","download_url":"https://codeload.github.com/Lommix/solis_2d/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244890102,"owners_count":20527030,"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":["2d","bevy","gamedev","gi","lighning","shader"],"created_at":"2024-10-13T08:06:59.367Z","updated_at":"2025-03-22T00:32:13.514Z","avatar_url":"https://github.com/Lommix.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solis 2D\n\n[![License: MIT or Apache 2.0](https://img.shields.io/badge/License-MIT%20or%20Apache2-blue.svg)](./LICENSE)\n[![Crate](https://img.shields.io/crates/v/solis_2d.svg)](https://crates.io/crates/solis_2d)\n\n### 2D global illumination with radiance cascades.\n\n![title img](docs/screen.png)\n\nFeaturing realistic 2D light, shadow and normal map calculation using\na optimized version of radiance cascade.\n\nThis crate is currently work in progress.\n\nAiming to be compatible with all targets.\n\n### Checkout out the examples\n\n```bash\ncargo run --example light --features=dev\ncargo run --example simple --features=dev\n```\n\n### How to use\n\nAdd the `SolisPlugin`.\n\n```rust\napp.add_plugins(SolisPlugin::default());\n```\n\nCreate a special Camera2D with `hdr:true`.\n\n```rust\nRadianceCameraBundle {\n    camera_bundle: Camera2dBundle {\n        camera: Camera {\n            hdr: true,\n            ..default()\n        },\n        ..default()\n    },\n    radiance_cfg: RadianceConfig{..} // quality, perfomance \u0026 effects\n    ..default()\n}\n```\n\nAdd `Emitter` Components to your entities. A Emitter can emit light\nand be also an occluder at the same time. Any Emitter with a zero color (black)\nor 0. Intensity just acts like an occluder.\nIntensity below `0.` acts as a negative emitter and subtracts light from\nthe scene.\n\n```rust\ncmd.spawn((\n    SpriteBundle {\n        texture: server.load(\"box.png\"),\n        transform: Transform::from_xyz((x as f32) * 400., (y as f32) * 400., 1.),\n        ..default()\n    },\n    Emitter {\n        intensity: 0.0,\n        color: Color::BLACK,\n        shape: SdfShape::Rect(Vec2::new(50., 25.)),\n    },\n));\n\n```\n\n### Normal Maps\n\nNormal maps are currently very experimental. For normals to work,\nyou need to provide a texture with the scenes normals. This is done\nby syncing a second sprite with the normal on another render layer with\na second camera. (checkout the light example)\n\n```rust\n// you have to resize the image, each time the window resizes\nlet image_handle = images.add(create_image(Vec2::new(1024., 1024.)));\n\n// add this component to the radiance camera\ncmd.spawn((\n    RadianceCameraBundle { .. },\n    NormalTarget(image_handle.clone()),\n));\n\n// spawn the normal camera\ncmd.spawn((\n    Camera2dBundle {\n        camera: Camera {\n            target: RenderTarget::Image(image_handle),\n            ..default()\n        },\n        ..default()\n    },\n    RenderLayers::layer(3), // any layer \u003e 0 will do\n));\n\n// spawn a normal map sprite\ncmd.spawn((\n    SpriteBundle {\n        texture: server.load(\"boxn.png\"),\n        ..default()\n    },\n    RenderLayers::layer(3),\n    Spin(rand),\n));\n```\n\nhttps://github.com/user-attachments/assets/858d7842-aed2-46b7-b001-7b87aa3e8ac0\n\nhttps://github.com/user-attachments/assets/5c98a8c4-ae5b-4019-b147-ceba065f074b\n\n# Amazing resources:\n\n[Gm Shader Blog](https://mini.gmshaders.com/p/radiance-cascades2)\n\n[Json's RC Blog](https://jason.today/rc)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flommix%2Fsolis_2d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flommix%2Fsolis_2d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flommix%2Fsolis_2d/lists"}