Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by AlucardJay · Aug 25, 2012 at 05:46 PM · perlinperlinnoise

Is this reading the full range of Perlin Noise?

Hi all =]

I have written a script to take samples across the Mathf.PerlinNoise spectrum, and am surprised at the result. So I have come to ask, is this a full sweep of the Perlin Noise 'map', or am I just getting a high-res sample of a small area? I have done more subdivisions (higher resolution of samples between 0-1), but it just follows the pattern in the pictured curve. I am passing values between zero and one to values in static function PerlinNoise (x : float, y : float) : float (I hope!). Is this the full output? My (limited) understanding was the greater the number of samples (the more times you sub-divided between 0-1), the more uneven the output would become (i.e. heaps of jaggies). This is the first time I have used perlin, so if I'm waaay off, please tell me =]

 var step : Vector2 = Vector2( starFieldSize.x / starCount.x, starFieldSize.y / starCount.y );
 var index : int = 0;
 for (var v:int = 0; v < starCount.y; v ++)
 {
     for (var i:int = 0; i < starCount.x; i ++)
     {
         // get perlin var for X-Y (i-v) coords
         var perlinCalc : Vector3 = new Vector3( (i * step.x), (v * step.y), 0 );
         
         perlinCalc.z = Mathf.PerlinNoise( perlinCalc.x / starFieldSize.x, perlinCalc.y / starFieldSize.y );
         
         Debug.Log ( "perlinCalc + " + perlinCalc + " : perlin = " + perlinCalc.z );
         
         starPos[index ++] = new Vector3( perlinCalc.x - randomizePos.x + (2.0 * perlinCalc.z * randomizePos.x), perlinCalc.y - randomizePos.y + (2.0 * perlinCalc.z * randomizePos.y), 0.0 + (randomizePos.z * perlinCalc.z) );
     }
 }


alt text

perlinmap.png (232.3 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
2
Best Answer

Answer by ScroodgeM · Aug 25, 2012 at 08:29 PM

why do you limit yourself in 0...1 range in input parameters?

alt text


1.png (139.5 kB)
Comment
Add comment · Show 1 · 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 AlucardJay · Aug 25, 2012 at 09:07 PM 0
Share

Oh, so I was just reading a small sample! So a value greater than one increases the noise in the returned float .... after immediately changing the line :

     //perlinCalc.z = $$anonymous$$athf.PerlinNoise( perlinCalc.x / starFieldSize.x, perlinCalc.y / starFieldSize.y );
     perlinCalc.z = $$anonymous$$athf.PerlinNoise( $$anonymous$$athf.Abs(perlinCalc.x), $$anonymous$$athf.Abs(perlinCalc.y) );

I finally had a result I was after. Thankyou =]

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

8 People are following this question.

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

Related Questions

Perlin Noise Implementation 2 Answers

Help Perlin Noise for Cubes? 1 Answer

Need help with undocumented Mathf.PerlinNoise 1 Answer

Perfomance Issue With Minecraft Clone. 0 Answers

Why is perlin noise generating flat 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