{"id":19112740,"url":"https://github.com/pgrit/tinyembree","last_synced_at":"2025-04-30T22:14:42.394Z","repository":{"id":54690031,"uuid":"333425162","full_name":"pgrit/TinyEmbree","owner":"pgrit","description":"A very simple C# wrapper around a subset of the Embree ray tracing kernels.","archived":false,"fork":false,"pushed_at":"2025-04-10T15:12:50.000Z","size":28410,"stargazers_count":14,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T22:14:34.925Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","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/pgrit.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,"zenodo":null}},"created_at":"2021-01-27T13:13:47.000Z","updated_at":"2025-04-10T15:12:54.000Z","dependencies_parsed_at":"2025-04-10T16:35:35.409Z","dependency_job_id":null,"html_url":"https://github.com/pgrit/TinyEmbree","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrit%2FTinyEmbree","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrit%2FTinyEmbree/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrit%2FTinyEmbree/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pgrit%2FTinyEmbree/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pgrit","download_url":"https://codeload.github.com/pgrit/TinyEmbree/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251789618,"owners_count":21644086,"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-09T04:34:00.220Z","updated_at":"2025-04-30T22:14:42.376Z","avatar_url":"https://github.com/pgrit.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build](https://github.com/pgrit/TinyEmbree/workflows/Build/badge.svg)\n\u003ca href=\"https://www.nuget.org/packages/TinyEmbree/\"\u003e\n![NuGet Version](https://img.shields.io/nuget/v/TinyEmbree)\n\u003c/a\u003e\n\n# TinyEmbree\n\nA very simple C# wrapper around the [Embree](https://www.embree.org/) ray tracing kernels. Currently only supports simple triangle meshes with no motion blur etc.\nEmbree and our wrapper are automatically compiled for x86-64 Windows, Linux, and macOS with support for AVX and AVX2, and for arm64 macOS. On these platforms, you can directly use the [Nuget package](https://www.nuget.org/packages/TinyEmbree/).\nOther platforms need to compile both Embree and our C++ wrapper code from source, instructions are below.\n\n## Usage example\n\nThe following creates a trivial scene consisting of a single quad and intersects it with a ray:\n\n```C#\nRaytracer rt = new();\n\nrt.AddMesh(new(\n    new Vector3[] { // vertices\n        new(-1, 0, -1),\n        new( 1, 0, -1),\n        new( 1, 0,  1),\n        new(-1, 0,  1)\n    }, new int[] { // indices\n        0, 1, 2,\n        0, 2, 3\n    }\n));\n\nrt.CommitScene(); // builds the acceleration structures\n\n// Trace a single ray\nHit hit = rt.Trace(new Ray {\n    Origin = new(-0.5f, -10, 0),\n    Direction = new(0, 1, 0),\n    MinDistance = 1.0f\n});\n\nif (hit) {\n    Console.WriteLine($\"Hit: {hit.PrimId}, {hit.Distance}\");\n}\n```\n\n## Dependencies\n\n- [.NET 5.0](https://dotnet.microsoft.com/) (or newer)\n- a C++11 (or newer) compiler\n- CMake\n\n## Building from source\n\nThere is a PowerShell script that downloads the prebuilt binaries for Embree and TBB ([RenderLibs](https://github.com/pgrit/RenderLibs/)). It currently supports x64 Windows and Linux, and x64 and arm64 OSX. You can run it via\n```\npwsh ./make.ps1\n```\nprovided that [PowerShell](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell) is installed. The script is rather simple (download and extract zip, run CMake, copy binaries) and you can also manually perform the same steps.\n\nIf compilation was successful, the C# wrapper is also automatically built and tested by the script.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgrit%2Ftinyembree","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgrit%2Ftinyembree","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgrit%2Ftinyembree/lists"}