Giter VIP home page Giter VIP logo

green-screen-unity's Introduction

I try to filter chroma key using shader. The filtered green pixel replaced with the pixel of a render texture from another camera.

I'm using solution to filter chroma key with this technique: https://stackoverflow.com/questions/16909816/can-someone-please-explain-this-fragment-shader-it-is-a-chroma-key-filter-gree

See demo scene how to use it.

Preview: https://youtu.be/FE-bWpjSY5I

How to use:

  1. Have 2 cameras in your scene. Obe for the green screen video and another one for background screen(Or maybe only blank screen)
  2. Create material using shader/GreenScreenReplacer
  3. Get sample of your green screen color in your video into Green Screen variable in the material.
  4. Attach 'Camera Effect' script on green screen camera and 'Camera Replacer' script on background camera. Put material that you've made in phase 2 into both script.
  5. Play your scene and your video should be playing. Adjust threshold sensitivity to set the green filter.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.