Search Unity

Adding detail texture to terrain

Discussion in 'Editor & General Support' started by Jonathan Czeck, Apr 7, 2005.

  1. Jonathan Czeck

    Jonathan Czeck

    Joined:
    Mar 17, 2005
    Posts:
    1,713
    I have a diffuse type material added to my terrain no problem. How would I go about making a detail texture?

    The only way I can think of doing it is having another material assigned to the terrain that has a texture with an alpha map and a small scale.

    I was going to use the one that is in the SAL under the Desert material, and then go about making one of my own.

    Would a Bumped style shader work better?

    Thanks!
    -Jon
     
  2. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    We are going to add a detail map shader to the builtin shaders.

    How important is it for you guys to modify the shaders?
    We won't have enough time to make the syntax nice and document it properly, but if people want to hack it, i can supply the shaders as a seperate download.
     
  3. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    You can certainly try it. Personally I prefer a normal detail map, but some people (like NVidia) are raving about that way of doing terrains.

    The nice thing about bumpmaps is that you can do that with the version of Unity you have now - use the bumpscale parameter to scale up your bumpmap.

    Play around. You can make bumpmaps fade out just like with traditional detail textures (from the texture import settings).
     
  4. marty

    marty

    Joined:
    Apr 27, 2005
    Posts:
    1,170
    Does Unity support Maya multitexturing?

    For those reading this post, but unfamiliar with the concept, multitexturing allows you have different UVW coordinate/tiling info for each of the textures in the same material. It's a very useful technique for doing shadowmaps. Maya does a great job of letting you create multitextured materials.
     
  5. NicholasFrancis

    NicholasFrancis

    Joined:
    Apr 8, 2005
    Posts:
    1,587
    Not in the way you're talking about, unfortunately... You can do multitexturing in shaders (the detail shader does this), but we only support getting 1 UV set on the models.
     
  6. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    5,203
    We will add support for multiple uv sets shortly after 1.0 is released.
     
  7. pdrummond

    pdrummond

    Joined:
    Jun 23, 2005
    Posts:
    185
    Are detail textures available in Unity now? If so, how do you use them? I looked in the manual, but there was only a brief mention.

    If I understand correctly, a detail texture is a secondary texture which is displayed when the viewer gets close to a model. This provides more detail and hides the blurriness of the main texture.

    I have a terrain model which is split into various polygon selections. The main selections define my cliffs and use a large texture, tiling it along the x axis. This creates a nice effect but I'd love to be able to apply a detail texture so the player sees this when they get very close.

    Any help on how to achieve this is much appreciated.
     

    Attached Files:

  8. Richard_B

    Richard_B

    Joined:
    Jul 22, 2005
    Posts:
    436
    Yes they are in theory - if you look at the pop-up list of shaders (in a material component) you will see one of them is called "DiffuseDetail". This gives the option of a primary mapped image and a "detail" image. However I didn't have much success in getting it to work. I could see the detail image being applied in the free scene view (texture mode), but it didn't seem to appear in the game view (been meaning to post about this for a while).

    Richard.
     
  9. David-Helgason

    David-Helgason

    Moderator

    Joined:
    Mar 29, 2005
    Posts:
    1,104
    We'll look into that. We're a bit vacation-hit this weekend, so don't expect a good answer untill next week.

    (it does sound a bit crazy, apologizing friday afternoon for not being able to give a response over the weekend... but that's us)

    d.
     
  10. Richard_B

    Richard_B

    Joined:
    Jul 22, 2005
    Posts:
    436
    Sheeesh - not working all weekend! :)

    Actually I am not terraining at the moment so not in a hurry. I will double check to see if I can get it working tho.

    Richard.
     
  11. pdrummond

    pdrummond

    Joined:
    Jun 23, 2005
    Posts:
    185
    Thanks. I'll try this out and see what happens.
     
  12. Jonathan Czeck

    Jonathan Czeck

    Joined:
    Mar 17, 2005
    Posts:
    1,713
    I have used Detail Shaders no problem on my Radeon 9200... do you perhaps have a GeForce 2 MX or something similar? They weren't working on there at the time I tried... I think I filed a bug report on that.

    Try placing the Ground from Standard Assets/Meshes into your scene, then selecting the actual Ground object and changing the shader to the detail shader from Diffuse. Then use the same texture map as the diffuse one as the detail, but set the scale of the detail one to 4,4.

    That works for me. Check that you have Pixel Lights on in Render Settings. I can post a before/after picture if anyone wants one.

    Cheers,
    -Jon
     
  13. Richard_B

    Richard_B

    Joined:
    Jul 22, 2005
    Posts:
    436
    Mmmm...OK - it seems to be working fine now - not sure what was happening last time.

    thanks,
    Richard.
     
  14. guategeek_legacy

    guategeek_legacy

    Joined:
    Jun 22, 2005
    Posts:
    659
    Please post a before after pic for me to stare at :p Jeff
     
  15. Jonathan Czeck

    Jonathan Czeck

    Joined:
    Mar 17, 2005
    Posts:
    1,713
    Here is a before/after from the ground object in the Physics Demo project. The detail is the same as the main texture, except 1/4 the size. (A scale of 4)

    -Jon
     

    Attached Files: