Search Unity

현재 터레인 전담팀이 운영되고 있으며, 팀의 첫 번째 성과로 업데이트된 터레인 시스템이 Unity 2018.3에 적용되어 공개될 예정입니다! 이번 업데이트에서는 GPU 활용도를 높여 툴과 성능이 개선되었습니다. 또한 고해상도(HD)경량(LW) 렌더 파이프라인에 대한 지원이 추가되며, 빌트인 렌더 파이프라인과 Unity의 기존 터레인 시스템과도 호환됩니다.

지금 Unity 2018.3 베타 버전을 다운로드해서 업데이트된 기능을 먼저 이용해 보세요! 단, 베타 버전은 아직 개발 단계이기 때문에 사용자 인터페이스 및 API는 추후 변경될 수 있습니다.

성능

성능 향상을 위해 터레인에 GPU 인스턴싱이 적용된 렌더 경로가 추가되었습니다. 대부분의 경우 인스턴싱을 사용하면 발생되는 드로우 콜의 수가 급격히 감소합니다. 유니티에서 자체적으로 진행한 여러 테스트 결과 CPU 비용이 50% 이상 절감되었습니다. 단, 실제 수치는 플랫폼과 사용 사례에 따라 다를 수 있습니다. 이번에 소개되는 렌더 경로를 선택하려면 Terrain 설정에서 ‘Draw Instanced’를 활성화하면 됩니다.

이 옵션을 활성화하면 하이트맵(height map), 스플랫맵(splat map)과 같은 무거운 터레인 데이터가 모두 GPU에서 텍스처로 변환됩니다. 또한 CPU에서 각 터레인 패치에 대한 커스텀 메시를 작성하는 대신 GPU 인스턴싱을 사용하여 단일 메시를 리플리케이트하고 하이트맵 텍스처를 샘플링하여 올바른 지오메트리를 생성할 수 있습니다. 이렇게 하면 인스턴스화된 드로우 콜 수가 적어도 수천 개의 커스텀 메시 드로우를 대체할 수 있으므로 터레인에 대한 CPU 워크로드가 크게 감소합니다.

또한 로드 시간도 단축됩니다. 커스텀 메시를 모두 빌드하는 과정을 스킵하고 GPU로 베이스맵(사전 블렌드된 LOD 텍스처)을 빌드할 수 있습니다. 이러한 유형의 작업은 GPU가 훨씬 빠르게 처리할 수 있습니다. 따라서 자체 커스텀 터레인 셰이더가 있는 경우 ‘빌드 베이스맵’ 셰이더를 오버라이드하고 일치하는 베이스맵 LOD 텍스처를 생성할 수 있습니다.

터레인 비주얼

인스턴싱을 사용하면 터레인 노멀의 시각적 품질이 개선됩니다. 하이트맵에서 생성되고 픽셀 셰이더에서 샘플링된 노멀 맵 텍스처에 터레인 메시 노멀을 저장하면 지오메트리에서 노멀을 분리합니다. 즉, 노멀은 메시 LOD 레벨과 별개로 관리됩니다. 따라서 ‘픽셀 에러율’을 높이면 버텍스 비용이 감소하여 결함도 줄어듭니다.

기존의 버텍스 단위 노멀(왼쪽)과 새로운 픽셀 단위 노멀(오른쪽)의 모습. 삼각형 수는 동일합니다.

또한 HD 렌더 파이프라인과 LW 렌더 파이프라인에 모두 적용할 수 있는 터레인 셰이더를 개발하고 인스턴스화된 렌더링에 대한 지원을 추가했습니다. 더욱 향상된 성능을 갖춘 HD 셰이더는 픽셀 단위 노멀을 비롯해 높이 및 밀도 블렌드 모드, 노멀 스케일링, 텍스처를 활용한 표면 금속성 및 평활도(smoothness) 등과 같은 다양한 신규 기능을 지원합니다. HD 터레인 셰이더는 단일 패스(pass)로 제한되지만, 한 개의 패스에서 최대 8개의 터레인 레이어 블렌딩을 지원합니다.

스크립터블 GPU 툴

에디터의 경우 커스텀 터레인 툴을 직접 제작할 수 있는 스크립트 API를 공개했으며, 다양한 유틸리티 함수를 제공하여 GPU에서의 원활한 타일 간 조형(sculpting) 및 페인팅 작업을 쉽게 구현할 수 있습니다. 새로운 TerrainAPI에는 터레인 툴의 기본 클래스인 TerrainPaintTool<T0>과 터레인 데이터 수정을 위한 유틸리티 함수가 있는 TerrainPaintUtility가 포함되어 있습니다.

이러한 변경 작업을 통해 기존의 모든 터레인 툴이 GPU 작업으로 전환되었습니다. 따라서 작업 속도가 크게 개선되었을 뿐만 아니라 브러시 크기가 더욱 커지고, 브러시 프리뷰가 개선되었으며, 자동으로 경계 부분을 부드럽게 처리해주는 심 스티칭(seam-stitching) 기능을 이용해 터레인 타일 경계면 전체를 페인트할 수 있습니다.

새로운 스탬프 터레인 툴(라이브 프리뷰)을 사용한 예시(2018.3b 6 버전에 포함 예정)

또한 브러시 회전, 랜덤화 옵션과 같은 브러시 기능뿐만 아니라 하이트맵 및 메시 스탬핑, 클론 브러시 등과 같은 고급 페인팅 툴에 대한 테스트를 시작했습니다. 2018.3에는 이러한 페인팅 툴이 아직 포함되지 않지만, 곧 출시될 예정이니 Unity 베타 페이지에서 소식을 확인하세요!

다중 터레인 지원

다중 터레인 타일에 대한 작업이 한결 쉬워졌습니다. 터레인 간 페인팅 작업을 원활하게 진행할 수 있을 뿐만 아니라, 인접한 터레인을 자동으로 연결할 수도 있습니다. 이전에는 스크립트를 작성하여 인접한 터레인을 수동으로 연결해야 했습니다.

터레인 설정에서 ‘Auto connect’를 활성화하면 그룹 ID가 동일한 인접 터레인이 자동으로 연결됩니다.

기존 터레인을 확장하는 경우 새로 추가된 ‘인접 터레인 생성(Create Neighbor Terrain)’ 툴을 사용하면 빈 경계면을 따라 일치하는 터레인 타일을 빠르게 추가할 수 있습니다.

 

 

또한 크기를 조정하고 해상도를 변경하는 작업으로 인해 발생하는 문제를 줄이기 위한 작업이 진행되고 있습니다. 이전에는 해상도를 변경하면 데이터가 삭제되고 모든 작업이 손실되었지만, 2018.3 버전에서는 하이트맵과 스플랫맵이 리샘플링됩니다. 모든 크기 조정 작업에 대한 개선도 빠른 시일 내에 이루어질 예정입니다.

새로운 에셋 유형

워크플로를 간소화하기 위해 터레인과 관련된 새로운 에셋 유형 두 가지, TerrainLayer 에셋과 Brush 에셋을 만들었습니다.

TerrainLayer를 이용하면 터레인 오브젝트와 상관없이 터레인 머티리얼을 정의할 수 있기 때문에 터레인이 여러 개라도 동일한 머티리얼을 쉽게 추적할 수 있습니다. 이렇게 하면 페인팅과 머티리얼 수정 작업이 원활해집니다. 또한 TerrainLayer 에셋을 확장하여 임의의 셰이딩 작업에 사용할 수 있는 ‘마스크맵(mask map)’ 텍스처를 지원하고, TerrainLayer 에셋에 대한 셰이더에 기반한 커스텀 GUI를 사용할 수 있는 스크립트 인터페이스를 지원합니다.
여기 보이는 브러시는 페인팅 및 조형 툴에서 사용하는 GPU 브러시 셰이프로, 이제 텍스처와 방사 감쇠 커브로 정의됩니다. 이렇게 하면 브러시 셰이프를 간편하게 만들고 조정할 수 있습니다. 이전에는 이름이 별도로 지정된 폴더에 복잡하게 제작된 이미지 파일을 붙여 넣어야만 했습니다.

또한 R16 텍스처 포맷(단일 채널 16비트 포맷)에 대한 지원도 추가되었습니다. 이를 통해 브러시 셰이프에 대한 8비트 양자화(quantization)를 방지할 수 있습니다. 즉, 하이트맵 스탬프로 사용될 경우 원치 않는 ‘테라싱(terracing, 계단 현상)’ 효과가 발생하지 않습니다.

‘테라싱’ 결함을 보이는 8비트 브러시 스탬프(상단)와 16비트 브러시 스탬프(하단).

유니티의 터레인 전담팀은 이제 막 한 걸음 내디디기 시작했으며, 앞으로도 개선 작업을 꾸준히 진행할 예정입니다. 피드백이 있으시면 언제든지 월드 빌딩(World Building) 관련 포럼에 글을 남겨주세요!

69 코멘트

코멘트 구독

코멘트를 달 수 없습니다.

  1. Excellent !
    Thankful

  2. Shame that grass and detail meshes do not work on HDRP, makes for very bland terrain currently :/

  3. Pierre Proudhon

    12월 5, 2018 1:49 오후

    Hello,

    Do you add something to get the world position and rotation of Detail mesh on the terrain. I Really need this feature and i didn’t find it in actual terrain tool. If it’s already possible to do that can you explain me how ? Thanks a lot

  4. John Rockefeller

    12월 4, 2018 2:46 오전

    VERY happy to see the Terrain engine get some love. Thank you. One suggestion: can you separate the splatmap from the Terrain.asset file? It would be very helpful to be able to export and import them as PNG or TIF or equivalent.

  5. 牛逼!unity~

  6. any chance that you can work on something that will assist people to create cave systems within this terrain?

    1. John Rockefeller

      12월 4, 2018 2:48 오전

      I don’t have any insider knowledge, but while I’d love caves, it might be more realistic to simply be able to poke holes in the terrain mesh sooner. Then, at least, we can use a mesh lined up with the hole to make a cave.

  7. 번역이 참 잘 되어 있는 것 같습니다. 이해를 돕는 적절한 의역과 함께…

  8. Spelling error: “publically” is not a word. It should be, believe it or not, “publicly”. Check your thesaurus.

  9. spherical terrain would be nice so that the terrain system can be used to create planetary terrain!

    1. In theory you can create Spherical Terrain using the terrain system. If you use the Latitude and Longitude values as your starting points, then convert to world coordinates using sin/cos conversion formula. You can then procedurally place a terrain, define it’s latitude/longitude/degrees per metre settings to create a patch of the world around the player using a noise generating system similar to libnoise. Knowing the latitude/longitude values for the terrain patch will allow placement of objects recorded at specific coordinates. I’ve been playing with this side of things for a while now and at least prior to these new terrain changes it was working as expected. Just need to look into the new way it works to see what needs to be changed to make it work.

  10. Ahmet Han Furkan Kahveci

    10월 19, 2018 10:22 오전

    Please let developers can change quality (low tris/low poly) terrain for mobile and standart render pipeline new mobile shaders.

  11. I advise Unity staff to add a Terrain roadmap as soon as possible, preferably after any Unity LA announcements. Doing this soon will enable the crowd to calm down as they view luminous promises like “some sort of hole hack”.

  12. Caves and Caverns with Terrains PLEASE!!!! I have my cutest sad puppy face on right now so you have to do it.

    1. Caves in terrain editor will never be a thing since it uses 2D heightmaps unless every game engine in the world change the way they generate/sculpt terrains.

      1. Nonsense. All Unity needs to do is support is cutting holes through the collision using an alpha mask, and developers can use cave kits etc. with having to generate their own costly custom collision for every terrain.

        1. (*without, not with)

        2. You have been able to use an alpha mask shader in conjuction with terrain to hide it for some time now. The problem is this doesn’t affect the terrain collider, but you could have a script that turns off collision with the terrain while the player is in that hole you created.

  13. I don’t know more expected improvements for us than a terrain system with caves, multi textures and generally everything that is needed to create an open world … there can only be an ai system .. but no. The landscape system is the foundation for everything. please do it. hoping for the best, Michael.

  14. Streaming terrain (from local source) a-la Google earth please.

  15. William DiGiacomo

    10월 13, 2018 1:23 오전

    Is anything being done about the issue with wind zones and terrain grasses? That being that wind direction does NOT have affect on the direction the grass waves? Re: 922123 – Wind Zones and Terrain Grass Texture Detail – 06/18/2017

  16. It’s nice to see more content moving to the GPU. Will it be possible to read and write the terrain height map buffer from a compute shader? It would be nice to have GPU access to terrain features to modify terrain height and textures at high speed during runtime.

    1. ++, asked the same down below (fun fact: also exactly at 6:05pm)
      They’ll have trouble with that because colliders/grass or even seperately stored tangents/normals might be out of date.
      Obvious answer would be to give tools PRECISE control over everything – when to update which layer, e.g. (copying from my post):
      Render to height and update just normals/tangents for rendering, update grass at intervals (low priority) and only recalculate colliders when finished. Similar to how tools interact with VegetationStudio already.
      This will be a huge win for true interactive terrain creation tools. I currently use a custom lightweight proxy terrain system, else I would spend 10x more time updating the terrain than I would actually simulating stuff. Needs adressing…

  17. please add GIS file support such as DEM and easier to manipulate scale for real world terrain for example group of terrain patch from tile raster.

  18. Planetary terrain possible? I mean cube rounded with stitch as 3 sided poles?

  19. Any hope for some spherical terrain? Such as planets.

  20. Robert Cummings

    10월 11, 2018 8:51 오후

    Please add a Terrain specific roadmap. Last I heard Will Goldstone had done some research into improved roadmaps.

    But until then, Terrain seems such a big thing so why not give it some space on the roadmap?

  21. It looks like a polished up, modernized, more accurate/better looking version of the old system, some some tool tweaks.

    Not exactly a leap forward in terms of terrain.

    Consider for example being able to destroy and create terrain in realtime, the ability to have 3D volumetric terrain with holes and caves and tunnels and overhands and all that unbridled 3D freedom, the ability to turn the level data into a geometry-shader-generated voxel world (ala minecraft but made into cubes on the gpu), being able to ‘paint materials’ onto the landscape at runtime as part of gameplay, etc…. Unity was allegedly starting to work on things along these lines YEARS ago and it still hasn’t seen the light of day and not a single mention of any of this in this blog post.

    Seems to me like decade-old terrain technology with icing on top.

  22. Even the Roblox terrain system has support for caves.

    1. Even? Roblox is a superior in-game game engine.

  23. Holes please terrain team.

    1. UG3 Productions

      10월 11, 2018 4:47 오후

      Creating caves and entrances would be HUGE agreed with u @Whippets

  24. Robert Cummings

    10월 11, 2018 2:10 오후

    Would be nice to edit the terrain height on their own layers as well, so I can make large topology changes on one and finer details (or load a map) on another, blend together for final height without destruction. I mean this for editor side only so the build gets a merged heightmap for memory/perf purposes.

    1. There’s an asset for that incase you didn’t know, although I suppose you do from the way you worded it.
      It’s called Mad Maps, and does that job superbly it seems.

  25. Do you have plans to implement origin reset for large worlds to avoid float precision errors that affects physics primarilly.

    1. how about to freeze the camera in origin and made the terrain moving instead

      1. That’s not as easy as it sounds. Code from other assets might malfunction, and forget about baking lightmaps…

  26. aaand just like that, the final thing i have been waiting for is about to land. Thanks guys, this and the VFX editor coming are a dream come true

  27. Do you consider updating tree creator trees? (With instancing)

  28. Hope the terrain team and the team that makes those toolkits can come together and make some good examples on different types of terrain – simple, detailed, with caves, with mesh cliffs (ie starcraft 2/dota 2) ++ because the tools and examples for different terrains has been incredibly lackluster ;/

  29. Could you expose access to height fields for allowing us to make our own colliders in the same vein that the TerrainCollider in Unity does without us having to use the Terrain system? I’d love that for a project I am working on that involves a large tile-based terrain that doesn’t work well with how Splat Maps work in Unity’s default terrain engine.

    1. Matthew Radford

      10월 11, 2018 5:48 오전

      This would be a dream. I’m facing this exact issue right now.

    2. Yes, we want to make it possible to create Terrain ‘from scratch’ in C#, which requires something along the lines of a standalone heightmap collider. But it doesn’t have an ETA yet.

      1. Somewhat related, please let us have access to the underlying heightfield directly so we can render to it (and replace it with an own RenderTexture if need be). To adress related issues such as colliders, grass, normals, … being out of date, just expose an API to give precise control over which layers to update in which areas. E.g. Render to height and update just normals/tangents for rendering, update grass at intervals (low priority) and only recalculate colliders when finished.
        This is an absolute must for terrain creation tools requiring true interactive speeds…
        Currently forced to create an own proxy terrain system, lightweight and super fast:
        https://gist.github.com/Seneral/6362c420a7a80228fc6614ff94763000

  30. So, no per pixel normal sampling in LWRP? ie it’ll look like that left image?

    1. Per-pixel normals should work in LWRP, HDRP and built-in renderers. But for HDRP or LWRP, you will need to upgrade to the latest preview packages to get the shaders with instancing support (version 4.0.1 — make sure you’ve turned on advanced -> Show Preview Packages in the Package Manager).

      1. Cool, sorry the post was just confusing. It says “The HD shader was further enhanced to support per-pixel normal” which implies that the LWRP doesn’t get this feature.

  31. Good first step. As others have pointed out, next we need some proper vegetation (plants/grass and trees), including support for wind zones or settings that impact both.

  32. Love the direction of the new terrain stuff, how do I punch a hole in it?
    I’ve got a cave, a tunnel, a subway system.
    Through the ground……into a hole :-)

  33. you can try also heightfield approach how Houdini is doing it https://vimeo.com/202435893 check time 4:33

  34. Nice changed to the terrain. The ability to use custom textures on the brush is nice, though I do still wish for the ability to create caves in the terrain, maybe converting terrains to voxel to do it. Good job though, really cool!

  35. It’s definitely a start. What I’d really love to see is procedural tools for splat mapping and detail distribution/randomization, a new terrain shader with texture array support(with a higher than 8 texture limit – also with procedural mix support, similarly to the MegaSplat asset, let me define a bunch of materials as lets say “dirt” and let me just paint “dirt”, at any point I want to be able to add or remove materials with automatic updates), some sort of object-to-terrain blending, and quality vegetation shaders(and by that I mean something that’s standard for like 10 years now, on top of PBR we need SSS as well(yes, I’ve seen ST8 with PBR shaders listed as a 2018.3 feature, however SpeedTree 8 modeler isn’t available yet and it’s listed as TBD on the SpeedTree website – and frankly considering how awful SpeedTree support was in Unity since it was introduced I don’t see why it’s even there, just write a few new shaders, touch up the billboard system and let us import meshes as trees easily(or add a shit ton of features to the TreeCreator, but that sounds unreasonable)).
    I was looking forward for some terrain improvements for a really long time, fingers crossed for 2019!

  36. Ahh, this all looks incredible! It’s fantastic to hear that Unity will have a dedicated terrain team now, it’s about time.

    I’m curious about things like custom shaders and whether or not they’ll still be supported? Also, it’d be great to be able to switch out materials/shaders for individual detail objects (like having different materials for each type of grass). A built-in system for building smooth ramps would be nice too.

    Anyways, it’s looking great guys! Thank you so much!

  37. would love it if you could paint with materials that have a height maps. Would make Megascan textures really come out how they are suppose to :)

  38. Hey, as long as you’re adding features to terrain, is there any plans for creating holes in terrain? Even if it’s limited to quads at the lowest level of detail, it would still allow caves and such.

    1. Holes are also being worked on actively.

  39. Your team may already be aware that a method exists where a second terrain could be made under the “ground terrain” in which a water shader would be applied so that instead of a water plane, we could have a “water terrain” so that we can raise and lower water on different areas of the “ground terrain”. I’d love to know your thoughts on such an implementation!

    1. Can’t you just use a quad and a mask for this?

      1. There are benefits to using a terrain which the shader moves the water texture based on the angle of the current triangle. in this way you could create slow moving rivers and fast moving waterfalls.

  40. This great news! Good job, just keep it up!

  41. Hey @Osama S.Ahmed! Unity Team is actually working on a new UI for the Editor: https://youtu.be/CWgi6hE26ig?t=311

  42. EXCELLENT!
    I’m loving the progress so far, looks like you guys are really focusing on making open-world much easier with the terrain engine (which, of course, would be the most popular use of a terrain engine I should imagine!)

    Are there any plans to focus attention on the vegetation system as well? Last I messed with it, vegetation rendering left…. much to be desired. Even with instancing enabled it tended to produce tons of small instanced batches instead of few large batches which would really help alleviate CPU pressure – third party solutions worked and were much faster, but had a tendency to be rather cumbersome.
    More focus on rendering smaller vegetation like grass and flowers in an efficient manner would be quite nice too.

    1. Yes, Grass, Details, etc. are being worked on currently.

      1. Great news! Since you are working on it, could you please decouple the foliage/vegetation system from the terrain so we can use it on any surface?

        Given the size of the target audience, I can’t imagine that you will want to put the effort in required to create a terrain system that can in realtime, procedurally update its mesh by using an algorithm such as Cubical Marching Squares or Manifold Dual Contouring to allow creation of No Man’s Sky like (but better) games with Unity. However, if you at least decouple your foliage/vegetation system from the terrain system, that would go a long way helping the people who are working on procedurally generated games by taking off that load of their shoulders.

  43. currently i’am using Unreal for my game but definitely i will pickup Unity on my next game project .. the engine features are flooding in each update . love to see the team changing the engine UI cause its look old and look forward to see more stuff for the HD pipeline .. Best regards

    1. Hey @Osama S.Ahmed! Unity Team is actually working on a new UI for the Editor: https://youtu.be/CWgi6hE26ig?t=311