Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nomand/RevealShader
Unity Shader experiment
https://github.com/nomand/RevealShader
shader shaders unity-editor unity-scripts unity3d
Last synced: about 1 month ago
JSON representation
Unity Shader experiment
- Host: GitHub
- URL: https://github.com/nomand/RevealShader
- Owner: nomand
- License: mit
- Created: 2018-05-31T06:38:57.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-21T00:56:01.000Z (about 6 years ago)
- Last Synced: 2024-02-22T10:34:17.913Z (5 months ago)
- Topics: shader, shaders, unity-editor, unity-scripts, unity3d
- Language: C#
- Size: 6.74 MB
- Stars: 63
- Watchers: 10
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Lists
- anything_about_game - RevealShader
- awesome - nomand/RevealShader - Unity Shader experiment (C\#)
- anything_about_game - RevealShader
README
# Reveal Shader
This is a set of shaders for Unity3D. It maps worldspace position of a gameObject and draws to a `RenderTexture` in relation to world bounds and remaps it back onto the world as a mask, allowing for various shader effects.
### Features:
* Black and White to RGB texture reveal shader
* Transparent to Opaque RGB Texture reveal shader
* Displacement Tesselation shader
* Auto and Manual world bounds lookup
* Fading over time
* Adaptive RenderTexture aspect ratio
* Custom inpspectorThe RenderTexture mask generation and re-projection happens separately from the surface shaders, so any combination of them is possible and adding new shaders is trivial without affecting the setup.
### Download
Download the `UnityPackage` from [Releases](/Releases) to get a clean import.### License
All code licensed under MIT License. Refer to [License.md](License.md) for full terms.
Pull requests welcome.### Usage
Effects rely on object materials having a shader property `"_Splat"` to assign the `RenderTexture` and offset parameters. Objects without a compatible shader will be skipped.
Use `Runningtap/Reveal/B&W2RGB` or `.../A2RGB` shaders on paintable objects.Add [`Painter.cs`](/Assets/Runningtap/Reveal/Scripts/Painter.cs) to the scene.
Pick `Lookup Mode`.
* Auto will iterate through all the world objects to calculate bounds. Use this for quick preview.
* Manual will enable a box collider to set bounds manually. Use this for builds and complex scenes. BoxCollider will be turned off on start to disable physics.Pick `SplatMap Resolution`
* **32**x - **2048**x, more resolutions can be added in the `Resolution` enum.`Use Relative` enables non-power of two resolution for the `RenderTexture`, based on world bounds to avoid overly stretched mask pixels. This will be calculated automatically, keeping the longest edge to selected resolution.
`Fade Over Time` allows for non-permanent mask drawing - stroke fades from oldest pixel. `Fade Speed` will be available if selected.
Add a parent `gameObject` containing all the paintable objects to `World`
Make sure `RevealRTX` is plugged into the Render Texture Shader.
`Brush` is a gameObject that will 'draw' the mask onto `RenderTexture`. Only XZ coordinates are considered.
`Brush Size` will change the size of the area drawn onto the `RenderTexture`.
`Brush Strength` determines stroke opacity.
`Splat Map Preview` will display current `RenderTexture` resolution and texture in play mode.