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
1
Question by kubas0707 · Mar 12, 2016 at 05:50 PM · c#perlin noise

Symmetrical perlin noise

Hi all! I have problem with a perlin noise. It generates strange symmetrical shapes:

alt text

My code:

 float landscape = Mathf.PerlinNoise(settings.lanscapeXScale * x * settings.sizeOfBlock + settings.landscapeSeed, settings.landscapeZScale * z * settings.sizeOfBlock + settings.landscapeSeed)*settings.landscapeInfluence;
 if (settings.mountainsFrom < landscape / settings.landscapeInfluence)
 landscape = 1.0f;
 float height = Mathf.PerlinNoise(settings.heightXScale*landscape * x * settings.sizeOfBlock + settings.heightSeed, settings.heightZScale*landscape * z * settings.sizeOfBlock + settings.heightSeed);

sva66my1.png (453.6 kB)
Comment
Add comment · Show 7
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 OllysCoding · Mar 12, 2016 at 07:04 PM 1
Share

Hard to see from your code what the actual numbers are, since they are all stored in variables, but if you start from say (-10, -10) and go to (10, 10) on $$anonymous$$athf.PerlinNoise() then you may face symmetrical shapes. Try starting from (0,0) and going to(20, 20) then taking 10 away from the x and z coordinates of each block.

Also, I'm working on block based terrain at the moment, if you find an efficient way to stop unity lagging from way to many gameobjects let me know.

avatar image Salmjak OllysCoding · Mar 12, 2016 at 08:58 PM 0
Share

@OllysCoding You shouldn't use the in game cube-models. I don't think the occlusion culling will work correctly and thus it will render all sides of all cubes although they're not visible to the player (need confimation on this).

You should also use chunks, and only create chunks that are visible to $$anonymous$$imize the number of cubes/blocks in the world at one time. Chunks are grid parts of your overall world terrain. So the world might be 128x128x128 and consist of 64 ((128/32)^3) 32x32x32 chunks and you would only ever have the visible chunks rendered/created at any time.

To make creation and deletion of terrain work anywhere acceptable you should pool (reuse) all your gameobjects (so ins$$anonymous$$d of e.g. instantiating/destroying new/old terrain you move the position of all cubes in one chunk to new positions in another chunk).

Regarding OPs question you are probably right, there is a looping of the values somewhere.

avatar image OllysCoding Salmjak · Mar 12, 2016 at 11:50 PM 0
Share

I am looking into chunks and what not. Occlusion culling will not work anyway because there are NPC's wandering off camera doing jobs assigned by the player.

I guess a complex chunk system will be the best option...

Show more comments
Show more comments
avatar image savlon · Mar 12, 2016 at 10:00 PM 0
Share

Look at the documentation for the $$anonymous$$athf.PerlinNoise function. $$anonymous$$y guess would be you're not working in float space. An example would be: pX = transform.position.x + x / chunkWidth, pY = transform.position.y + y / chunkHeight.

1 Reply

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by kubas0707 · Mar 13, 2016 at 09:07 AM

Perlin noise is symmetrical for positive and negative values. Solution was to add huge number to coordinates of perlin noise.

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

7 People are following this question.

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

Related Questions

Mathf.PerlinNoise does not work 0 Answers

How to make Perlin Noise Seemless on a sphere? 1 Answer

Following the trail of Perlin Noise random movement? 1 Answer

Calmp gradient between 0 and 1? 0 Answers

Array with pushing values? 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