Search Unity

Dissolve Shader - Guidance image

Discussion in 'Shaders' started by BeautifulFish, Oct 1, 2014.

  1. BeautifulFish

    BeautifulFish

    Joined:
    Sep 25, 2014
    Posts:
    55
    Hi,

    I'm using this shader I found on unify - http://wiki.unity3d.com/index.php?title=Dissolve_With_Texture

    I'm using cloud like images, black and white currently to get the effect I want.

    But i'm curious as to how this works, how it splices the image. So I can perhaps make custom dissolve patterns. E.g. from top to bottom (if possible)

    Thanks
     
  2. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    In its current state the shader makes the _SliceGuide texture use the same UV coordinates that the _MainTexture uses - the first uv set.

    IF your mesh has unique UVs (as in: no UVs going outside the 0-1 UV space, no UVs on top of each other) you can stay on that uv set. But commonly the first uv set is used for tiling diffuse and normal maps, mirrored stuff that lies outside the default UV space and such... which can make it hard to use it for the slice guide.
    The 2nd uv set however per Unity default is used for lightmapping and requires unique UVs in the first place - so you might end up using the uv2_SliceGuide instead of uv_SliceGuide inside the input struct.

    Now you can paint whatever patterns you like on your model and save that data in a texture that works with either the first or the second uv set.
    That might get a little tricky for a gradient ramp that goes from top to bottom of your mesh.
    Here's a way to achieve this effect with a 3d software package like Maya:

    creating_slice_texture_for_dissolve_shader.jpg
     
  3. BeautifulFish

    BeautifulFish

    Joined:
    Sep 25, 2014
    Posts:
    55
    Wow thanks for the great reply! That's some really interesting stuff for me to look into. Really cool example with the chameleon as well I appreciate it!