Giter Club home page Giter Club logo

foliage-wind's Introduction

Foliage Wind in Unity's HDRP and URP

Animation

These are some experiments with the assets and wind system of Unity's demo project Book of the Dead. The wind system they built is described in this blog post. I updated the wind shader and wrote Custom Passes in the High Definition Render Pipeline and Universal Render Pipeline to integrate the wind system and assets in Unity 2020. I experimented a bit with getting basic audio volume level to control the wind strength. Like they also mentioned in their blog post. My HDRP implementation is on the main branch, while the URP version got a separate branch in this repository.

Wind Shader

The wind calculations are updated to work with current versions of ShaderGraph. Unfortunately the wind shader is only usable with assets of the Book of the Dead project! The pivot information for the trees, grass and bushes is baked into the assets' UV maps using different bit ranges for each value (see code example below). To reuse this wind system it would probably be easier to split the different shader parts for tree trunk, tree branches and grass into separate shaders. And then define the pivots by splitting the assets into multiple objects for trunk and branches. Just like Unity's Fontainebleau demo is doing it.

// packedData.x
// Bit 0-9 	= pivotPos0.z
// Bit 10-21 	= pivotPos0.y
// Bit 21-31 	= pivotPos0.x
//************
// packedData.y
// Bit 0      = pivotFwd1.y
// Bit 1-7    = pivotFwd1.z
// Bit 8-15   = pivotFwd1.x
// Bit 16 	= pivotFwd0.y
// Bit 17-23	= pivotFwd0.z
// Bit 24-31 	= pivotFwd0.x
//************
// packedData.z
// Bit 0 	= pivotPos1.z
// Bit 1-7      = pivotPos1.y
// Bit 8-16 	= pivotPos1.x

foliage-wind's People

Contributors

happy-turtle avatar

Watchers

James Cloos avatar  avatar

Forkers

kovacs-3d

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.