Search Unity

Sequins shader?

Discussion in 'Shaders' started by psdev, Mar 24, 2011.

  1. psdev

    psdev

    Joined:
    Feb 11, 2011
    Posts:
    53
    Hi,

    Does anyone know of an existing shader that can do sequin type fabric (no cloth just the sparkles and look of sequins)?

    If not, what approach would you take? I'm stumped on this one... :confused:
     
  2. brn

    brn

    Joined:
    Feb 8, 2011
    Posts:
    320
    hi psdev
    I think you should be able to get a good result out of a quite simple shader. Almost any specular or reflective shader. The key to a good result will be the normal map, the specular color and writing to the alpha channel so post effects like the very nice unity bloom will kick in properly.

    Normal map; Model the disc shape then bake out the normals. Take this then make a Tiling texture from it.
    Specular; If you want it to look metalic then make the specular color and the reflection color similar to your diffuse color.
    Alpha channel; If you write to the alpha channel using a custom lighting function if it is to be a surface shader you can boost the bloom and lens flares with great control. great to get those funky 70's video clip like effects.

    I hope this gives you some direction.

    Cheers
    Brn
     
  3. 2dfxman1

    2dfxman1

    Joined:
    Oct 6, 2010
    Posts:
    1,065
    This, it's just a shiny piece. Nothing complicated
     
  4. psdev

    psdev

    Joined:
    Feb 11, 2011
    Posts:
    53
    Thanks. Will this give a dynamic look to the reflections based in incidence angle of light etc? Also, how do you suggest I achieve the randomness of some sequinsglinting while others don't?

    i.e. have you noticed how because sequins are sewn into a fabric and each have a little bit of "play" rotation-wise, that a chief characteristic of this fabric is the fact that overall rotations or movement of the fabric cause almost a ripple like effect of specular highlights? It doesn't sound like the approach you mention will achieve that - and that seems like a procedural thing - how would you enhance what you mention to achieve this? thanks :)
     
  5. Frank Oz

    Frank Oz

    Joined:
    Oct 13, 2010
    Posts:
    1,560
    You could use an alpha which is ripple shaped, and made to use the reflection angle, then use that to control the amount of reflection/specularity of the sequins. You might be able to invert it so this alpha moves opposite directions to the angle of reflection to cause the ripple like effect. Then the reflection image itself as a kind of rainbowish colored image. Along with specularity, it "should" with some work, give the effect you're wanting, especially when coupled with a normal map that's highly tiled to represent the sequins themselves.
     
  6. brn

    brn

    Joined:
    Feb 8, 2011
    Posts:
    320
    Just gave the sequins thing a quick go. Heres the result with no real tricky stuff going on.Ive posted the normal map for you. Hope it helps.I Can do a web player if you want. You will have to wait just a short while for the shader though because the one I used is from my unreleased shader pack. Its the lowest spec free version though, only special thing it does is the Fresnel reflection.

    $Funky.jpg $sequins.png
     
    peroon likes this.
  7. Frank Oz

    Frank Oz

    Joined:
    Oct 13, 2010
    Posts:
    1,560
    Damn that looks good!
     
  8. psdev

    psdev

    Joined:
    Feb 11, 2011
    Posts:
    53
    WOW! That's fantastic! I'd be keen to see a webplayer version to see how it animates with moving lights or still lights and moving object. But that is better than I thought such a shader could look.

    Do you have a shader pack for sale? What's it called? I'll have to search for it at home - I can't seem to access the Asset Store behind our proxy).


    very cool - I appreciate the effort and can't wait to see it in action! :)
     
  9. brn

    brn

    Joined:
    Feb 8, 2011
    Posts:
    320
    Sorry psdev I haven't released the shader yet, Heres the web player though and honestly, I think you will be able to get pretty similar results out of the standard Diffuse+Bump+Spec unity shader. Infact if you take my normal map and spend a little time with it in Crazybump to create a spec map and some AO for a diffuse texture you might get better results than what I have posted, because I put very little time into my results.
     
    Last edited: Apr 14, 2011
  10. psdev

    psdev

    Joined:
    Feb 11, 2011
    Posts:
    53
    thanks. Please let me know when you do release them. I appreciate the webplayer upload so I have a goal to get my shader looking like :)

    Couple more questions though:
    How did you achieve this glow?


    And dumb question here. Is it possible to have an animated normal map in order to get some independent sequin movement? These look a bit like glued down sequins. (and that's not a complaint this looks great compared to what I thought was possible!)

    thanks :)