PERLIN NOISE in Unity - Procedural Generation Tutorial

preview_player
Показать описание
Let's have a look at Perlin Noise in Unity.

More on procedural generation:

····················································································

········································­­·······································­·­····

Edited by the lovely Sofibab.

········································­­·······································­·­····

► All content by Brackeys is 100% free. I believe that education should be available for everyone. Any support is truly appreciated so I can keep on making the content free of charge.

········································­­·······································­·­····
♪ Baby Plays Electro Games
Рекомендации по теме
Комментарии
Автор

Hey everyone! Hope you like the video :)

This video is very introductory and doesn't go in depth with stuff like how perlin noise is generated or how it can be layered (in octaves) to give more interesting results. If you want to learn more about this sort of stuff I suggest you check out Sebastian Lague and Catlike Coding. They both have some great resources on this! There is a link in the description for that :)

Stay awesome!

Brackeys
Автор

Thank you Brackeys !!! Even though it's a long time since you poseted your last video. The channel still help me consistently. Best luck for you. Whatever now you're dealing with, you get our best hope.

gamedevbaiyi
Автор

You've got no idea how amazing these videos are.

MaeveFirstborn
Автор

Brackeys, my boi did it again! *Our voices are heard!* I salute you!

Some people me including wanted this, feelsgoodman when it appears on my feed! Love the recent standalone tuts for deeper understanding of Unity3d.

veno
Автор

I take this moment to thank to Asbjørn Thirslund for all of his videos. I learnt unity by watching your videos. I have been following you since "Make a game series", but I never actually shown my gratitude to you. So A biggg thank you to you for all your tutorials whether it be a small one or a complete series. Thanks to you I myself and many like me are game developers.

monishvyas
Автор

I wish I had a group of Scandinavian friends to make a game with.

marumisu
Автор

Brackeys!! You're awesome dude!
I LOVE your content!
Thanks to you I've become a game developer! <3

xannydoesstuff
Автор

Dude, you're killing it! Literally every time I look something up with the word "Unity" in it one of your epic videos comes up. Keep up the hard work!

paytondugas
Автор

For anyone who is in 2D and tried using the Sprite Renderer, you can't as it doesn't allow for textures due to overriding them with the texture from the sprite you are using . You have to use something like a quad (mesh filter) with a mesh renderer which will use the created texture directly and then set the material to unlit > texture like Brackeys does.

SmleyFce-nvlh
Автор

when u write the code and it works in the first go

That moment is heaven

VoidAshen
Автор

I hope you are still reading comments on this channel because I need to tell you how awesome you are.

kristianthaler
Автор

Nice. I look forward to the tutorial on procedural terrain generation. Thanks for this.

xxDeathStarxx
Автор

Thank you!!! This was all I needed to get my procedural world generation working for my game, this was the only thing I was having difficulty figuring out, thanks! :D

AdrienSanctioned
Автор

Script:
public int width = 256;
public int height = 256;

public float scale = 20;

public float offsetX = 100f;
public float offsetY = 100f;

void Start()
{
offsetX = Random.Range(0,
offsetY = Random.Range(0,
}
void Update()
{
Renderer renderer = GetComponent<Renderer>();
renderer.material.mainTexture = GenerateTexture();
}

Texture2D GenerateTexture()
{
Texture2D texture = new Texture2D(width, height);

for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
{
Color color = calculateColor(x, y);
texture.SetPixel(x, y, color);
}
}
texture.Apply();
return texture;
}
Color calculateColor(int x, int y)
{
float xCoord = (float)x / width * scale * offsetX;
float yCoord = (float)y / width * scale * offsetY;
float sample = Mathf.PerlinNoise(xCoord, yCoord);
return new Color(sample, sample, sample);
}

arthurmartirosyan
Автор

Wow i am so amazed at how professional your tutorials are let me just say thanks, thank you for these tutorials u go and make these for us and they are amazing i am truly thankfull

blazeminer
Автор

Instead of putting the generation into the update method, you could just put it into the OnDrawGizmos(). It then allows you to change the parameter. To reduce the calculation amount, you could add a dirty flag with setter on each parameter and only then reproduce a new noise texture.

tjkerman
Автор

Q: "How to procedurally generate in unity?"
Answer from Brackeys: "Call the Mathf.Perlin funktion!"...

Honestly I was expecting a little more explanation of the math behind this rather than just showing one specific usecase of the perlin noise :(

IndieMarkus
Автор

really high quality content! Found your channel today and already watched A LOT. thank you!

maldoran
Автор

Great video, been waiting for this for a long time

blitzinbeats
Автор

I don't even make games and yet I find this entertaining

coolmatt