• 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 /
This question was closed Sep 28, 2015 at 05:19 PM by getyour411 for the following reason:

Problem is not reproducible or outdated

avatar image
0
Question by fred_gds · Dec 30, 2013 at 11:35 PM · editorraycastterrainperformanceheightmap

Physics Raycast taking forever

Hey,

I am doing some physics ray cast to adapt my terrain to the objects on top of it. I'm doing this by laying a grid over the terrain but actually calculating a grid of 100x100 already takes 5-6 secs and a grid of 500x500 takes about 3-4 minutes,

I mean I could take that as I can wait that long but I actually need to calculate a grid of 6000x6000 to calculate the entire mesh of my map. so already 1000x1000 takes so long that I actually think that unity crashes (waited over 20 minutes without any reaction).

So I calculate that in the editor on a Macbook Pro (from 2013). Surely not the most powerful device but the best I actually have.

I also already change form a sphereCast to a simple rayCast but the performance difference was pretty much nothing (5 or 6 seconds on a 500x500 grid).

So is there anyway to calculate it faster?

I already thought about dividing the grid into multiple smaller grids but actually I was unable to set up a system which does it good.

If anybody has a idea how I could calculate this, that would be great.

Comment
Add comment · Show 2
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 YoungDeveloper · Dec 31, 2013 at 12:01 AM 0
Share

Does the grid necessary needs to be from ray casts ? If yes, then optimizing code is always an option i think.

avatar image HuskyPanda213 · Dec 31, 2013 at 01:46 AM 0
Share

Example of code maybe, or use terrain setheights and get heights ins$$anonymous$$d of ray casts.

0 Replies

  • Sort: 

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

20 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

Related Questions

How to improve the Performance of Removing Trees during runtime? 1 Answer

flatten Terrrain under object 2 Answers

[semi-solved] My .raw heigtmap repeats itself? 1 Answer

How do I decrease baking time? 1 Answer

How can i stop the car penetrating into the terrain 1 Answer


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