MIT License

项目介绍

otdavies/UnityChromakey 是一个托管在 GitHub 上的开源项目,主要使用 ShaderLab 编写,采用 MIT License 许可证,目前获得 259 个 Star、45 次 Fork。

仓库全名
otdavies/UnityChromakey
开源许可证
MIT License
Star 数
259
Fork 数
45
未关闭 Issue
5

README 摘要

UnityChromakey 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. A simple, yet powerful chromakey / greenscreen solution for Unity. Designed to be used with virtual production. Usage This shader works in HDRP & URP Once you've got the files in your project: Assign the chromakey shader to a material of your…

完整内容见 GitHub 原始 README 或本页 。

常见问题

UnityChromakey 用什么语言开发?

主要使用 ShaderLab 编写,采用 MIT License 许可证,目前有 259 个 Star。

UnityChromakey 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 UnityChromakey 的源码?

可以直接克隆仓库:git clone https://github.com/otdavies/UnityChromakey.git,默认分支为 master;安装与运行步骤见仓库 README。

UnityChromakey 最近还在维护吗?

仓库最近一次更新为 2025年2月28日,当前有 5 个未关闭 Issue;Star 数为 259,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

A simple, yet powerful chromakey / greenscreen solution for Unity. Designed to be used with virtual production.

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
359
价值分
169
活跃状态
活跃

语言占比

ShaderLab

README

UnityChromakey

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.

A simple, yet powerful chromakey / greenscreen solution for Unity. Designed to be used with virtual production.

Usage

This shader works in HDRP & URP

Once 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.

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. This 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.

Features

  • Standard Chromakeying: (green screen only). Modification would be required to work with a bluescreen (Would require Despill algorithm changes)
  • 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.
  • Simple edge sharpening: (Sharpen up blurred edges to give a more anti-aliased feeling as opposed to just blur)
  • Despill correction: Getting rid of that pesky green light bleed
  • Simple usage, only a single shader and a single-pass
  • Example presets you can load onto the material (for the existing examples)

Examples

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.

Note: This is an example of Despill correction being toggled. Watch the edges for green.

Note: This is reflective armor. Reflective. The nightmare for greenscreen. Looks pretty good to me!

Here are the controls used to tune for the following images:

Note: This is me controlling the strength of the Despill correction.

Example of really poor greenscreen situation + DSLR as webcam:

Modification

You are free to modify and improve on this simple approach. I suggest creating a pull request with your changes!

Primary sources in the creation of this tool

http://gc-films.com/chromakey.html

https://benmcewan.com/blog/2018/05/20/understanding-despill-algorithms/

Disclaimers

Example images are random and off the internet. They are not mine and I don’t pretend they are.

This shader hasn’t been heavily optimized yet, but appears to perform quite well. It is untested on mobile platforms, but theoretically should work.

评论

暂无评论