• 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 /
avatar image
0
Question by Ebil · Feb 09, 2014 at 11:26 AM · terrainmeshproceduralinfinite terrain

No Procedural Terrain without lags?

Hello,

Im playing around with procedural terrain generation forever now. But somehow I can never get something to work without lag - is it just not possible in unity or what? Even if just a simple Terrain Object is created one after one, unity lags - afaik its not possible to do this multithreaded because it has to happen in the unity's main thread. Im now playing around with TerrainToolkit and create procedural terrains. As you can imagine calculations done by the toolkit take forever, applying the heightmap to a terrain also. Im sure the calculations could be done on the GPU, but applying a heightmap to a terrain not right?

So how does some guys get it to work, i see some vids on youtube and so where there is no lag - how is that possible? Just simple object creation in unity (whatever object) without getting a lag ...

Thanks in advance

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Dijit · May 05, 2014 at 10:08 AM

I may not be the best person too answer this. but nobody else has so I'll try.

I'm not very experienced but I've been looking into voxels recently.

In a tutorial I watched the presenter used "IEnumerator" as a function name for building the mesh, saying it would cause the the mesh calculations to be done in the background he had to make it "yield return 0;" at the end, whatever that means.

however even with that system there was still some Lag generated because unity had to calculate the noise for the mesh.

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
avatar image
0

Answer by Munkkeli · Jun 02, 2014 at 11:30 PM

You can generate all the terrain data and heightmaps in a new thread, then just apply the data to the terrain in the main thread.

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

21 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

Related Questions

Generating Structures on Infinite Terrain 0 Answers

How to generate a grid for procedurally generated platforms 1 Answer

How do I go about texturing a flat-shaded generated mesh? 1 Answer

Terrain detail meshes/trees via script? 2 Answers

The most efficient method of turning a voronoi graph into unity terrain object? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges