https://github.com/gkjohnson/unity-clip-shader
Unity shader and scripts for rendering solid clipped geometry
https://github.com/gkjohnson/unity-clip-shader
3d clip geometry graphics rendering shaders unity unity3d
Last synced: 7 months ago
JSON representation
Unity shader and scripts for rendering solid clipped geometry
- Host: GitHub
- URL: https://github.com/gkjohnson/unity-clip-shader
- Owner: gkjohnson
- License: mit
- Created: 2017-08-29T16:34:12.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-07-13T18:34:03.000Z (almost 8 years ago)
- Last Synced: 2025-04-15T19:48:45.192Z (about 1 year ago)
- Topics: 3d, clip, geometry, graphics, rendering, shaders, unity, unity3d
- Language: C#
- Size: 1.54 MB
- Stars: 50
- Watchers: 7
- Forks: 10
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# unity-clip-shader

Unity shader and scripts for rendering solid geometry clipped by a plane
## Use
Draws the geometry with a double sided stencil pass and draws a quad afterward to give the illusion of solid geometry. The geometry must be manifold or water-tight with no duplicate triangles or edges.
Add a `ClipRenderer` component to the GameObject to be rendered, and attach a `Clip Plane/Basic` material. The `ClipRenderer` component should be considered a replacement for the built-in `Renderer` component.
## Clip Material Options
**Use World Space**
Whether or not the plane provided to the material should be used in the local object space or in world space.
**Plane Vector**
A vector defining a plane in space. The XYZ vector defines the plane's normal, while the W component defines the distance from the origin.