Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by Grelf · Jan 28, 2018 at 01:21 AM · booleanmaskingmesh manipulationterrain-editorsubtract

Is there a preferred method of removing portions of terrain?

Objective: I wish to design a 3D game that allows players to place modular objects for building purposes. The placed objects will always be upright, and may occasionally clip through terrain to remain upright.

Question: Is there a performance friendly way to allow the placed object to delete/mask the intersecting terrain in run time, by the player?


I was contemplating 3 potential approaches, but alternatives are welcome:

  • Use some form of boolean subtract, but this could be costly during run time, and might not function well with complex geometry like terrain.

  • Design a voxel based terrain, where it deletes an area of voxels in a specified direction of the placed object.

  • Find a way to mask the undesired portion of terrain and it's attached physics.


I've attached an image of what I am trying to accomplish. Any suggestions on ways to possibly accomplish this scenario are greatly appreciated.alt text

objectinquiry.png (11.5 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Grelf · Feb 01, 2018 at 01:42 AM

Here is the progress of my research so far:

Voxel terrain (using the asset "Voxeland" as my point of reference):

Pros:

  1. Capable of high detail/realistic textures

  2. Allows easy creation of tunnels in terrain

  3. Supports decent water shaders

  4. Supports near limitless terrain sizes

  5. Can be edited by the player during run time, with manageable performance

Cons:

  1. Limitation on the maximum amount of textures. With texture arrays enabled, the number of possible block types (texture channels) is limited to 24 for all platforms that support texture arrays. When disabled, the maximum number of block types is limited to 4-16 depending on the build platform.

    Edit height map data with TerrainData.SetHeights:

Pros:

  1. Near limitless amount of textures can be used

  2. Easily customizable terrain deforming brushes and falloffs can be used to edit terrain by the player in run time

  3. CPU strain can be eased if using tessellation with GPU

  4. Works well with many mesh editors and shaders

Cons:

  1. Doesn't allow tunnels through terrain due to 0-1 black/white height map (A work around for tunnels, is a time consuming process of manually creating a new object to shape as the tunnel with the exit point matching the exact exterior of the intersecting terrain)

  2. May run into performance issues if running multiplayer, or too much terrain being edited (performance can be improved by using TerrainData.SetHeightsDelayLOD instead, followed by Terrain.ApplyDelayedHeightmapModification)

  3. Unable to undo terrain changes, as they override the height map

  4. Texture quality might suffer in and around terrain changes, if not using tesselation


Contrary to the high pros and low cons, the limitation on the amount textures for voxel terrain makes me lean towards editing the heightmap as my preffered method so far.

I will be looking into masking options next, to see if masking is a viable solution to my goal. With the little research I did on boolean subtracting meshes, it seemed far too unstable for complex meshes, for me to consider looking into that option further.

If anyone has any input on my current provided research, or any alternate solutions that I haven't considered yet, please advise.


Here are some of the sources of my current research, for any interested:

  1. Voxeland asset: https://assetstore.unity.com/packages/tools/terrain/voxeland-9180

  2. TerrainData.SetHeights: https://docs.unity3d.com/ScriptReference/TerrainData.SetHeights.html https://www.youtube.com/watch?v=qYOFnmTKqiM

  3. Tesselation:

https://docs.unity3d.com/Manual/SL-SurfaceShaderTessellation.html http://catlikecoding.com/unity/tutorials/advanced-rendering/tessellation/ https://www.youtube.com/watch?v=YDqwuM6eTjw https://assetstore.unity.com/packages/tools/particles-effects/deformable-surface-76468

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

123 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Operator (less than sign) cannot be used with a left hand side of type boolean and a right hand side of type float 1 Answer

For my tile puzzle game, how can i have the player cube only step on a tile once and if they step on the tile a second time the game will be lost? 2 Answers

Storing positions and booleans together 1 Answer

Attempting to set bool on targeted object - if target is set to true, move to next in list. 0 Answers

How to get onTriggerEnter to control a bool 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges