Code Monkey home page Code Monkey logo

invertex / unity-auto-rp-shader-keywords Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 7 KB

Automatically sets global shader keywords depending on whether URP or HDRP is currently installed as well as which is currently active, allowing you to properly conditionally compile your shaders for more than one pipeline and also have them swap shader variants automatically at runtime.

C# 100.00%
unity unity3d renderpipeline universal-render-pipeline high-definition-rendering-pipeline scripting

unity-auto-rp-shader-keywords's Introduction

Automatically sets global shader keywords depending on whether URP or HDRP is currently installed as well as which is currently active, allowing you to properly conditionally compile your shaders for more than one pipeline and also have them swap shader variants automatically at runtime.

In Unity 2021 this script will automatically detect when the pipeline has been removed/swapped and update its values. If you are on an older version, then you must either reimport the script or restart Unity for it to be able to apply its changes, since there does not appear to be any sort of fired events when pipeline is changed in older versions.

In most cases you should not need this script, but instead can simply use this to avoid issues with your shader being used in multiple pipelines: https://docs.unity3d.com/2021.2/Documentation/Manual/SL-PackageRequirements.html

Shader Keywords:

RP_URP_ACTIVE
RP_URP_INSTALLED
RP_HDRP_ACTIVE
RP_HDRP_INSTALLED

unity-auto-rp-shader-keywords's People

Contributors

invertex avatar

Stargazers

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