GithubHelp home page GithubHelp logo

imclab / procamp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from keijiro/procamp

0.0 3.0 0.0 17.45 MB

A utility shader for adjusting videos.

License: MIT License

C# 71.87% HLSL 12.70% ShaderLab 15.42%

procamp's Introduction

ProcAmp

screenshot

gif

ProcAmp is a utility shader for adjusting videos. It's developed to provide optional functionalities of video playback with the VideoPlayer component that is newly introduced in Unity 5.6.

System Requirements

  • Unity 5.6

ProcAmp is compatible with all the platforms that supports VideoPlayer. If you find any problem with compatibility, plaese report it to Issues.

Features

  • Basic color adjustment (brightness, contrast and saturation).
  • Color balance (temperature and cyan-purple tint).
  • Chroma keying and spill removal.
  • Transform (trimming, scaling and position offset).
  • Color overlay (fade to color)

Implementation

There are two variants of implementation of ProcAmp.

  • The ProcAmp shader can be used with a material asset. It provides all the basic features of ProcAmp.

  • The ProcAmp component can be used with a game object. It also provides optional features that are useful in complex setups.

Examples of Use Cases

Apply ProcAmp and blit to the screen.

The ProcAmp component provides a simple rendering functionality that blits the resulting video to the screen with fit-to-screen scaling. This would be a handy option when trying to show the video in full-screen mode.

Typical steps to use

  • Create a VideoPlayer (drag & drop a video asset to the hierarchy).
  • Change Render Mode of the VideoPlayer to "API Only".
  • Add the ProcAmp component to the game object.
  • That's it!

Apply ProcAmp and show in a RawImage UI element.

When considering to support multiple resolution/aspect ratio, it's recommended using the RawImage component of the UI system to handle the situation properly. The TargetImage property of ProcAmp is used in such cases. With setting a RawImage to the property, it starts to update the RawImage with resulting video.

Typical steps to use

  • Create a UI canvas and add a RawImage to it.
  • Create a VideoPlayer (drag & drop a video asset to the hierarchy).
  • Change Render Mode of the VideoPlayer to "API Only".
  • Add the ProcAmp component to the game object. - Set the RawImage in the canvas to Target Image of the ProcAmp.

Use ProcAmp as a shader.

The ProcAmp shader ("Klak/Video/ProcAmp") is an unlit shader combined with the functionalities of ProcAmp. It's useful when using a material/renderer pair to display a video.

Typical steps to use

  • Create a quad object ("Create" -> "3D Object" -> "Quad").
  • Create a material and change shader to "Klak/Video/ProcAmp".
  • Set this material to the quad object.
  • Create a VideoPlayer (drag & drop a video asset to the hierarchy).
  • Change Render Mode of the VideoPlayer to "Material Override".
  • Set the quad object to the Renderer property.
  • Change Material Property to "_MainTex".

Apply ProcAmp and output to a RenderTexture.

When a RenderTexture is given to the TargetTexture property, it updates the given RenderTexture with resulting videos. This is useful when trying to use the video with other shaders or renderers.

Apply ProcAmp as an image effect.

The ProcAmp component works as an image effect when it's attached to a camera object. It overlays the resulting video onto the screen with fit-to-screen scaling.

License

MIT

Acknowledgement

The footage used in the example is originally created by LaBeouf, Rönkkö and Turner. That work was released under a Creative Commons Attribution Non- Commercial Share-Alike licence. See Acknowledgement.txt for further details.

procamp's People

Contributors

keijiro avatar

Watchers

 avatar  avatar  avatar

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.