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
1
Question by z3nth10n · Nov 28, 2014 at 10:15 PM · distortionlibnoise

How to distort Voronoi using LibNoise

Hi, first, sorry for bad English. ;) (I need at least one answer (I now this question can be hard to ask, but please, try to answer, thanks :) ), so I will try to explain as clear as possible, if you don't understand something, you can ask me by comments ^^)

Well, I'm making some tests with LibNoise, and well, now I want to distort Voronoi.

The explanation (of all the thing I made)

First, I started searching "Voronoi Libnoise" in Google, and I found this image:

distorted voronoi

Then, I started to read the website, the tutorial says this:

 DistortedVoronoiBiome(X, Z) := VoronoiBiome(X + PerlinX(X, Z), Z + PerlinZ(X, Z))

That means that mixing Perlin in the Voronoi Algorithm you get something like the image #1...

So having this information, I started searching in LibNoise how to do this, and I found Turbulence class (that uses Perlin Noise), and this what I did:

 Texture2D tex;
 int size = 512;
 float power = 1;
 
 void Start() {
     Generate();
 }
 
 void OnGUI() {
     if(tex != null) {
         //Display tex...
     }
 }
 
 void Generate() {
     tex = new Texture2D(size, size);
     var gen = new Voronoi();
     var mod = new LibNoise.Operator.Turbulence(power, gen);
     for(int i = 0; i < size; i++) {
         for(int j = 0; j < size; j++) {
             float c = Mathf.Abs(((float)mod.GetValue((double)i, (double)j, 0)));
             tex.SetPixel(i, j, new Color(c, c, c));
         }
     }
     tex.Apply();
 }

The problem

The problem is that I don't get the desired effect, I only get this:

problem

The cell's shape don't change, only the border of the cells get granulated, so, I need to know how can I make something like the image #1...

Other things I tried

I tried, other classes like Displace and Terrace, without luck (I only get the same effect), maybe I'm not using it correctly, so I need some help about how can I figure this out...

Any suggestions?

Thanks in advance. ^^

Bye.

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

0 Replies

· Add your reply
  • Sort: 

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

26 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

Related Questions

I need no perspective distortion for some part of screen 0 Answers

Android Splash Screen Stretches 1 Answer

Blurred texture on range 1 Answer

How to measure fisheye lens distortion? 0 Answers

[libnoise port] spherical texture is one pixel too wide 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