GithubHelp home page GithubHelp logo

avatarchik / recolor-shader-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nicholas-maltbie/recolor-shader-example

0.0 1.0 0.0 17.5 MB

Example Showing How a Recolor Shader in Unity Works

License: MIT License

Shell 100.00%

recolor-shader-example's Introduction

Recolor Shader Example

Example of recolored cats with a rotating gif

This project demonstrates an example of how to use the Recolor shader developed in Unity's Universal Render Pipeline to recolor a grey scale image using two different colors dynamically. I have made a video, Custom Color Shader! Dynamic Recoloring Explained, which talks through the examples of this project and how the shader works.

This shader was developed as part of the Falling Parkour Project here - https://github.com/nicholas-maltbie/FallingParkour

This project is developed using Unity LTS Release 2021.1.19f1. Install this version of Unity from Unity Hub using this unity hub link unityhub://2021.1.19f1/d0d1bb862f9d

Example recoloring of a grey scale pattern into different color combinations

This is an open source project licensed under a MIT License. Feel free to use a build of the project for your own work. If you see an error in the project or have any suggestions, write an issue or make a pull request, I'll happy include any suggestions or ideas into the project.

Examples

Rendering of the stages within one of the shader graphs for recoloring a grey scale texture to be multiple colors

Here is a summary of the various examples in this project. Each link provides a tutorial on how part of the shader works and the final link shows the completed shader in action.

  1. Hello Shaders - Basic Shader introduction.
  2. Colored Shaders - Create a solid color shader.
  3. Recoloring Images - Recoloring a black and white image.
  4. Combining Images - Combining two images together.
  5. Final Combination - Recoloring a black and white image two different colors.

After going through these tutorials, you will know how to dynamically recolor grey scale using the shaders and materials in this project!

Varying the colors on a box with a triangle pattern

Project Layout

Here is a description of the various directories in the project

  • Assets/Recolor/Materials contains the materials for the project.
  • Assets/Recolor/Models contains the models used in the project.
  • Assets/Recolor/Scenes contains various scenes for the example project. Each scene is numbered and progress in order 1, 2, ... This readme file will explain the assets in each scene.
  • Assets/Recolor/Shaders contains the shaders for the project.
  • Assets/Recolor/Textures contains the image textures used in examples

Development

If you want to help with the project, feel free to make some changes and submit a PR to the repo.

When working with the project, make sure to setup the .githook if you want to edit the code in the project. In order to do this, use the following command to reconfigure the core.hooksPath for your repository

git config --local core.hooksPath .githooks

recolor-shader-example's People

Contributors

nicholas-maltbie avatar

Watchers

 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.