• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by UnSpotibleShadow · Jan 16, 2015 at 01:18 PM · shadertexturemovietexture

ChromaKey MovieTexture

Hi!

I'm trying to make a "Holographic" video with someone in front of a green screen. i would like to get rid of the greenscreen in the video and render the person only in it.

i already did some reasearch on Chroma keying but all the options are paid.. Anyone any idea of a free option to render my Movietexture without greenscreen ingame?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by UnSpotibleShadow · Jan 20, 2015 at 09:44 AM

Worked it out!

Using a custom shader to render the cutout from the original MovieTexture renders a "hologram" like video

 Shader "MovieWithSeperateAlpha" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} _Mask ("Culling Mask", 2D) = "white" {} _Cutoff ("Cutoff", Range (0,1)) = .5 }
 
  SubShader 
  {
      Tags {"Queue"="Transparent"}
  
      ZWrite Off
      Blend SrcAlpha OneMinusSrcAlpha
  
      Pass 
      {    
          CGPROGRAM 
 // Upgrade NOTE: excluded shader from OpenGL ES 2.0 because it does not contain a surface program or both vertex and fragment programs.
 #pragma exclude_renderers gles
              #pragma fragment frag 
              #include "UnityCG.cginc"  
  
              sampler2D _MainTex; 
              sampler2D _Mask; 
  
              struct v2f 
              { 
                  float4 pos : POSITION; 
                  float4 uv : TEXCOORD0; 
              }; 
  
              half4 frag (v2f i) : COLOR 
              { 
                  half4 color = tex2D(_MainTex, i.uv.xy); 
                  half4 color2 = tex2D(_Mask, i.uv.xy); 
  
                  return half4(color.r, color.g, color.b, color2.r); 
              } 
          ENDCG         
      }    
  }
  
  Fallback "Transparent/Diffuse" 
 }


The _MainTex is the full video with green/blue screen full video with green/blue screen The _Mask is a the video rendered with UltraKey/ChromaKey usage and a Alpha Output which will output a  blackwhite


alphawally.png (34.3 kB)
rgbwally.png (291.3 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by BabilinApps · Oct 13, 2015 at 07:51 PM

I made a post on the forums on how to create a chroma key shader. It get's the job done and it's free: http://forum.unity3d.com/threads/chroma-key-in-unity-5.359119/

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Difference between TRANSFORM_TEX and MultiplyUV 0 Answers

Shader light fix? 1 Answer

how to import a mixed texture from blender 2 Answers

Quad Material Texture Rendering Dark 1 Answer

Same float4 -> float conversion method produces different results in C# vs. shader 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges