{"id":17879819,"url":"https://github.com/otdavies/unitychromakey","last_synced_at":"2025-04-12T22:20:33.481Z","repository":{"id":116892812,"uuid":"291174145","full_name":"otdavies/UnityChromakey","owner":"otdavies","description":"A simple, yet powerful chromakey / greenscreen solution for Unity. Designed to be used with virtual production.","archived":false,"fork":false,"pushed_at":"2025-02-28T08:26:20.000Z","size":50306,"stargazers_count":232,"open_issues_count":5,"forks_count":40,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-28T01:04:55.823Z","etag":null,"topics":["chroma","chroma-key","chromakey","despill","green","greenscreen","key","screen","shader","unity","virtualproduction"],"latest_commit_sha":null,"homepage":"","language":"ShaderLab","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/otdavies.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":"2020-08-29T00:50:14.000Z","updated_at":"2025-03-05T14:44:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"81041b8d-e4dd-4ed5-b634-a65ef87d6323","html_url":"https://github.com/otdavies/UnityChromakey","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otdavies%2FUnityChromakey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otdavies%2FUnityChromakey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otdavies%2FUnityChromakey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otdavies%2FUnityChromakey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/otdavies","download_url":"https://codeload.github.com/otdavies/UnityChromakey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247105498,"owners_count":20884450,"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":["chroma","chroma-key","chromakey","despill","green","greenscreen","key","screen","shader","unity","virtualproduction"],"created_at":"2024-10-28T12:07:57.096Z","updated_at":"2025-04-04T02:04:17.471Z","avatar_url":"https://github.com/otdavies.png","language":"ShaderLab","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UnityChromakey\n*Disclaimer: Unity has changed a lot since I originally implemented this simple shader, it may no longer work as intended in all render pipelines and conditions.*\n\nA simple, yet powerful chromakey / greenscreen solution for Unity. Designed to be used with virtual production.\n\n## Usage\n**This shader works in HDRP \u0026 URP**\n\nOnce you've got the files in your project: Assign the chromakey shader to a material of your choice and attach that material to a quad / plane. Provide an image to the material or use a VideoPlayer to feed an image in. \n\n**Why this approach?** It is the most verstile. Screenspace effects are complicated, clunky and difficult to modify. Screenspace effects also cannot be placed in worldspace easily. This shader is simple, only a few hundred lines and *is a single pass*. It is excellent for quickly blocking out greenscreen footage or even final composites.\nThis repository is *not* an entire project. You don't need all my project cruft *yuck*. This is simply a few files you can toss into your project and *actually use*.\n\n## Features\n* **Standard Chromakeying:** (*green screen only*). Modification would be required to work with a bluescreen (Would require Despill algorithm changes)\n* **Simple edge feathering:** This is a single-pixel blur approach, but enough for 99% of shots (when do you actually need a crazy 15 pixel deep blur?!?). I will probably expand the kernel to a larger box blur in the future.\n* **Simple edge sharpening:** (Sharpen up blurred edges to give a more anti-aliased feeling as opposed to just blur)\n* **Despill correction:** Getting rid of that pesky green light bleed\n* Simple usage, only a single shader and a single-pass\n* Example presets you can load onto the material (for the existing examples)\n\n## Examples\n\n**Note:** Have mercy on the GIF compression and the fact that this footage was downloaded from YouTube, so it already has compression artifacts within it. It would look *considerably* better with nice clean source footage.\n\n![](Examples/Images/Shia.gif)\n![](Examples/Images/Shia2.gif)\n![](Examples/Images/Distant.gif)\n\n**Note:** This is an example of Despill correction being toggled. Watch the edges for green.\n\n![](Examples/Images/Despill.gif)\n\n**Note:** This is *reflective* armor. Reflective. The nightmare for greenscreen. Looks pretty good to me!\n\n![](Examples/Images/ReflectiveArmor.png)\n\nHere are the controls used to tune for the following images:\n\n![](Examples/Images/Controls.png)\n![](Examples/Images/Armorguywithoutchroma.png)\n![](Examples/Images/Armorguywithchroma.png)\n\n**Note:** This is me controlling the strength of the Despill correction.\n\n![](Examples/Images/DespillWorstCaseExample.gif)\n\n**Example of really poor greenscreen situation + DSLR as webcam:**\n![](Examples/Images/1080p30fps.gif)\n\n## Modification\nYou are free to modify and improve on this simple approach. I suggest creating a pull request with your changes!\n\n## Primary sources in the creation of this tool\nhttp://gc-films.com/chromakey.html\n\nhttps://benmcewan.com/blog/2018/05/20/understanding-despill-algorithms/\n\n## Disclaimers\nExample images are random and off the internet. They are not mine and I don't pretend they are.\n\nThis shader hasn't been heavily optimized yet, but appears to perform quite well. It is untested on mobile platforms, but theoretically should work.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotdavies%2Funitychromakey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fotdavies%2Funitychromakey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotdavies%2Funitychromakey/lists"}