Search Unity

dx11 tessellation hair, how can you make it in unity?

Discussion in 'Editor & General Support' started by sharpshot124, Dec 13, 2012.

  1. sharpshot124

    sharpshot124

    Joined:
    Apr 7, 2012
    Posts:
    18
    in the butterfly effect they used really nice looking hair that was made using tessellation, but hey don't really give a clue on how to make it, they just say it came from nvidia. i looked on the nvidia site and all i saw was the hair demonstration, but not any way to make it. so does anyone know how to recreate the hair from the butterfly effect short film?
     
  2. ChaseRLewis73003

    ChaseRLewis73003

    Joined:
    Apr 23, 2012
    Posts:
    85
    That type of rendering uses guide splines to build a 3d texture (or simulate one) based on some algorithm then does a ray based volumetric render. Or at least that's how it's done in maya and it seems really similar to that method. Not simple to implement at all.
     
  3. sharpshot124

    sharpshot124

    Joined:
    Apr 7, 2012
    Posts:
    18
    thx for the info, any way u could tell me how to implement it? or tell me where to learn how? i am experienced with programming concepts, c#, js, and have a basic knowledge of cg shader language
     
  4. brilliantgames

    brilliantgames

    Joined:
    Jan 7, 2012
    Posts:
    1,937
    I heard they are going to make this feature available in the near future...
     
  5. sharpshot124

    sharpshot124

    Joined:
    Apr 7, 2012
    Posts:
    18
    any clue on how far away "soon" is? i kinda need it soon, im willing to learn how to do it but i need to find a source 1st
     
  6. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    The outline of the process is something like:

    1) you have a mesh that "emits" the hair (e.g. a scalp). This is a triangular mesh.
    2) a hull shader will "emit" some number of hairs from each triangle (computes tessellation per triangle edges, using "isoline" domain). The tessellator unit will produce lines for each hair from here.
    3) a domain shader receives tessellated hair vertices and does any shading or whatever else you need
    4) a geometry shader expands lines into thicker quads (for performance reasons you usually can't tessellate up to individual hair strand level; you'll want each tessellated thingy to represent several hairs using a texture).

    So that's the outline, and yes, it requires knowing a thing or two about hull/domain/geometry shaders and shaders in general. But it's not Unity specific really, you could use any DX11/GL4.2 knowledge here.
     
  7. sharpshot124

    sharpshot124

    Joined:
    Apr 7, 2012
    Posts:
    18
    thx a lot, i will look into these things and try to figure it out, and if i figure it out perhaps ill look into making a full tutorial for others