Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Unity 2022.2 is now available as the latest Tech release.
    Dismiss Notice
  3. We are making some changes to the DOTS forums.
    Dismiss Notice
  4. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

tessellation tiling

Discussion in 'Editor & General Support' started by Jmanpie, Mar 8, 2013.

  1. Jmanpie

    Jmanpie

    Joined:
    Oct 7, 2012
    Posts:
    132
    Hey guys i was just wondering is there any reason why tessellation doesn't let you tile the displacement map this is the main one as well as it handles the height if you have a tillable texture and you increase the tiling it just doesn't work (dx 11 tessellation bumped specular). I increased the height on the second image so you can see what is happening the displacement is set to alpha from grey scale.

    $example.png
     
  2. Ceryni

    Ceryni

    Joined:
    Apr 6, 2013
    Posts:
    8
    Hi,

    i had the same issue. Just multiply your texture coordinates by your tiling factor like this:

    Code (csharp):
    1.  
    2. void disp (inout appdata v)
    3.         {
    4.             float d = tex2Dlod(_DispTex ,float4(v.texcoord.xy*_Tiling,0,0)).r * _Displacement;
    5.             v.vertex.xyz += v.normal *d;
    6.         }
    7.  
     
  3. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,745
    nice, can you offer a screenshot too?
     
  4. Ceryni

    Ceryni

    Joined:
    Apr 6, 2013
    Posts:
    8
    $dx11_tess_terrain.jpg

    I am currently trying to make an TerrainSystem for educational Purpose. (As you can see its very bad atm)
     
  5. Sahkan

    Sahkan

    Joined:
    Mar 3, 2013
    Posts:
    204
    Is it requiring unity 4.1 or 4.1.2 ? cus it dosnt work for me and i'v got unity 4.0.1 .
     
  6. Sahkan

    Sahkan

    Joined:
    Mar 3, 2013
    Posts:
    204
    Ok i had to add a varible _Tiling and an slider, what about Offseting, what can i do it ?
     
  7. Ceryni

    Ceryni

    Joined:
    Apr 6, 2013
    Posts:
    8
    actually its the same just add your offset to the uvs. If you want a different offset for the y-direction you have to split th uv in x and y like that:

    Code (csharp):
    1. float4((v.texcoord.x*30+0.1f)(v.texcoord.y*30+0.2f),0,0)
     
  8. William White

    William White

    Joined:
    Nov 7, 2013
    Posts:
    4
    Hi, Ceryni

    I am trying to make it work but I am completely lost!
    Could you please share the shader?

    W
     
  9. hdd-op

    hdd-op

    Joined:
    Dec 30, 2013
    Posts:
    5
    Any news about heightmap tiling
     
  10. smirlianos

    smirlianos

    Joined:
    Aug 2, 2012
    Posts:
    177
    It doesn't seem to work...
    Can someone post the full shader?
     
  11. Jmanpie

    Jmanpie

    Joined:
    Oct 7, 2012
    Posts:
    132
    Okay so locate the tessellation shader Assets -> standard assets -> tessellation shaders double click BumpedSpecularDisplacment
    Navigate to line 38
    insert the following over the disp void function

    Code (csharp):
    1. float4 _ParallaxMap_ST;
    2.  
    3. void disp (inout appdata v)
    4. {
    5.         float d = tex2Dlod(_ParallaxMap, float4(v.texcoord.xy * _ParallaxMap_ST,0,0)).a * _Parallax;
    6.         v.vertex.xyz += v.normal * d;
    7. }
    8.