Search Unity

Creating a snow soft body shader

Discussion in 'Shaders' started by monsterlullaby, Jan 19, 2017.

  1. monsterlullaby

    monsterlullaby

    Joined:
    Sep 27, 2016
    Posts:
    5
    Hi guys, as part of my dissertation project I have to create a snow shader which will have deformable snow. Just search snow deformation shader in youtube to find stuff which I'm trying to recreate. Ideally the snow will be like a soft body simulation like water where the snow tumbles around objects. I have some questions regarding this:

    1. Is it possible?
    2. How can I create this effect and what books/resources are there for me to learn shader programming?

    Currently I've scoured the internet for good resources and found a few but none which are helping me with my local qualm of creating a snow shader with soft body physics.

    I'm a bit stuck. Help!
     
  2. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
    Well, depending on what kind of effect you want. If you take a look at prey for the gods (made with unity), I would say yes it is totally possible. If you want to do some really crazy simulations like disney did for frozen (Video, Paper), I would say no, not with unity.
    Uh... Well that's a pretty rough start. If you have no knowledge of shader programming at all, this will be far from easy to accomplish! My first thought would be to use a second camera rendering from top down on the map (Either the whole map, or just following the player if it is ok to lose tracks again) and rendering a specific layer there that stores information about movement of the snow (Like a vector field). You could feed this render texture to the snow shader to know how to transform the vertices every frame. This would work well even with more than one object interacting with the snow, however it will take quite some time to set it up and get it working. Otherwise you could store simple positions of one object interacting with the snow and just push the snow away from those positions. This asset might also be interesting as a reference. If it does not have to be a shader, you could use mesh deformation operations. Or something like flex (This is not really the right path if you have implement everything on your own in the end).

    As for learning how to program shaders:
    - Take a look at the shader examples of unity
    - For method references you need this site

    I don't really have any references on how to start.

    I hope this helps :)