All Projects → RoyTheunissen → Gpu Spline Deformation

RoyTheunissen / Gpu Spline Deformation

Licence: other
Baking spline deformation to a texture then applying it to a mesh via a shader.

Projects that are alternatives of or similar to Gpu Spline Deformation

Lowpolyshaders
Unity shaders optimized for Low Poly models.
Stars: ✭ 157 (+201.92%)
Mutual labels:  unity, shaders, shader
Unity Script Collection
A maintained collection of useful & free unity scripts / library's / plugins and extensions
Stars: ✭ 3,640 (+6900%)
Mutual labels:  unity, shaders, shader
Rimlight
Customizable rimlight shader for Unity that includes pulsation and noise scrolling. Give your scenes that extra oomph!
Stars: ✭ 170 (+226.92%)
Mutual labels:  unity, shaders, shader
3d Game Shaders For Beginners
🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
Stars: ✭ 11,698 (+22396.15%)
Mutual labels:  unity, shaders, shader
Unity Shadergraph Sandbox
✏️ Collection of ShaderGraph examples for Unity.
Stars: ✭ 525 (+909.62%)
Mutual labels:  unity, shaders, shader
Unitylibrary
📚 Library of all kind of scripts, snippets & shaders for Unity
Stars: ✭ 1,968 (+3684.62%)
Mutual labels:  unity, shaders, shader
Unity Shaders
✨ Shader demo - More than 300 examples
Stars: ✭ 198 (+280.77%)
Mutual labels:  unity, shaders, shader
Nvjob Water Shader Simple And Fast
#NVJOB Simple Water Shaders. Free Unity Asset.
Stars: ✭ 172 (+230.77%)
Mutual labels:  unity, shaders, shader
Unity Frosted Glass
❄️ Test of a frosted glass material in Unity.
Stars: ✭ 506 (+873.08%)
Mutual labels:  unity, shaders, shader
Stablefluids
A straightforward GPU implementation of Jos Stam's "Stable Fluids" on Unity.
Stars: ✭ 430 (+726.92%)
Mutual labels:  unity, shader, gpu
Unity3d Cg Programming
Various shaders.
Stars: ✭ 800 (+1438.46%)
Mutual labels:  unity, shader, gpu
Hologramshader
✏️ Test of an hologram material made in Unity.
Stars: ✭ 684 (+1215.38%)
Mutual labels:  unity, shaders, shader
Shadergraph Custom Nodes
🔨 Collection of custom nodes for ShaderGraph.
Stars: ✭ 53 (+1.92%)
Mutual labels:  unity, shaders, shader
Unity Texture Curve
✏️ Example showing how to bake an AnimatedCurve into a Texture and use it in a shader.
Stars: ✭ 149 (+186.54%)
Mutual labels:  unity, shaders, shader
Shadergum
Unity3D GPU Sculpt & Morph
Stars: ✭ 125 (+140.38%)
Mutual labels:  shaders, shader, gpu
Spheredissolve
Customizable procedural spherical dissolve shader for Unity3D, for all your customizable procedural spherical dissolve needs!
Stars: ✭ 311 (+498.08%)
Mutual labels:  unity, shaders, shader
Texturepanner
This repository hosts a shader for Unity3D whose main goal is to facilitate the creation of neon-like signs, conveyor belts and basically whatever based on scrolling textures
Stars: ✭ 528 (+915.38%)
Mutual labels:  unity, shaders, shader
Radialprogressbar
Customizable radial progress bar shader for Unity3D. Allows you to set arc range, minimum and maximum colors, textures, radius, and a few more things. Create HP Bars, Speedometers, rank progress, etc!
Stars: ✭ 714 (+1273.08%)
Mutual labels:  unity, shaders, shader
Uraymarching
Raymarching Shader Generator in Unity
Stars: ✭ 793 (+1425%)
Mutual labels:  unity, shader
Pcx
Point cloud importer & renderer for Unity
Stars: ✭ 806 (+1450%)
Mutual labels:  unity, shader

Roy Theunissen License: MIT GitHub Follow Twitter

Sample for baking deformation to a texture then applying it to a mesh via a shader.

About the Project

I saw Simon Trümpler's Tileable Liquid Mesh on Spline and I was wondering how the mesh was following the spline exactly. It gave me the idea of baking the deformation to a texture somehow, which actually turned out to be really simple.

Video | Article

Example

Getting Started

  • Add the package to your Unity project (tips on how to install it are in the Installation section)
  • Create the mesh you will be deforming that's pointing in the forward Z axis. Samples are provided.
    • Make sure it has a material with the Deformation Lookup Shader shader.
    • If the mesh does not start at (0, 0, 0) and stop at (0, 0, 1), adjust the Z Start and Z End properties accordingly.
  • Implement the IDeformationProvider interface in the script that is responsible for the deformation that you want to bake or use the provided BezierSpline script.
  • Add a DeformationTextureRenderer script to the scene. I recommend adding it next to the mesh you'll be deforming.
  • Assign the script responsible for the deformation to the Deformation Provider field.
    • Assign the material for the mesh that will be deformed (this is necessary for assigning it dynamically created textures)
  • You should now see the mesh deform along whatever deformation is provided via the script.

Troubleshooting

  • If the mesh is not deforming, check that Amount is set to 1 in the material. This feature exists for quickly toggling the effect on and off to see what it does.
  • If the mesh is not deforming, check that it has the right material, shader and texture assigned
  • Make sure the correct texture asset and/or material are assigned in the Deformation Texture Renderer
  • If you are seeing artifacts or incorrect deformation:
    • Make sure the resolution is sufficiently large. Set the mode to Dynamic and try out larger resolutions until the artifacts disappear
    • Make sure Z Start and Z End are set correctly in the material
    • Make sure the texture's wrap mode is set to clamp. For looping meshes you may want the X-axis to be set to Repeat

Installation

OpenUPM

The package is available on the openupm registry. It's recommended to install it via openupm-cli.

openupm add com.roytheunissen.gpusplinedeformation

Manifest

You can also install via git URL by adding this entry in your manifest.json

"com.roytheunissen.gpusplinedeformation": "https://github.com/RoyTheunissen/GPU-Spline-Deformation.git"

Unity Package Manager

from Window->Package Manager, click on the + sign and Add from git: https://github.com/RoyTheunissen/GPU-Spline-Deformation.git

Contact

Roy Theunissen

[email protected]

Acknowledgements

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].