On this page, we are going to read a simple noise function. Noise functions are one of the most common tools in computer graphics to create complex or realistic patterns like this landscape. Because they are so common, many tools and frameworks give us various implementations of noise functions for free, and we tend to take them for granted without having to understand how they work.

このページでは、シンプルなノイズ関数について解説していきます。ノイズ関数は、この風景のように複雑でリアルなパターンを生成するために使える、コンピューターグラフィックスの基本的なツールの1つです。その汎用性の高さから、多くのツールやフレームワークには様々なノイズ関数の標準で実装されていて、原理を理解しなくても当たり前のように使うことができます。

Drawing Landscape

https://codepen.io/kynd/pen/ZYEVRGN

And, we have AI these days. About 50% of my code day-to-day is already written by AI, and I'm totally fine when I know what it is doing. I'm happy not to repeat boilerplate and stuff. But I feel a little anxiety when I use a piece of code I don't fully understand. Sometimes, it is useful to deep dive into something you don’t know and explore until you feel good.

さらに、最近はAIがあります。自分の場合、日常的なコードの50%くらいはすでにAIが書いていて、それが何をしているのか理解できる限り全く問題は感じません。定型的な作業などを繰り返さなくて良いのは幸せです。ですが完全に理解していないコードを使うときには、少し不安になります。時には、知らないことついて深く掘り下げて、納得いくまで探求することも役に立ちます。

For writing this page, I asked an AI to read the example and directly quote the explanations. AI can be a great tool to help you learn, rather than a black box that makes people dumb.

このページではAIにサンプルを読ませ、その説明を直接引用しました。AIは、人々を考えなくするブラックボックスではなく、学習を助ける優れたツールになり得りえます。

<aside> 💡

This page (or all of my articles in general) is written for someone like me, who is more visually and scrappy prototyping oriented rather than a trained programmer or mathematician. If you have a computer science degree, this might not be for you.

このページ(他の記事も)は、コンピューターサイエンスの学位を持つような専門的な技術者や数学者ではなく、自分を含めた見た目やざっくりとしたプロトタイピングを優先する人向けに書かれています。コンピューターサイエンスの学位を持った人にはこのページはあまり参考にならないかもしれません。

</aside>

1D noise function

This is our sample code (written by AI as well). It is a simple value noise function that takes a float number as input and returns another float number.

これがサンプルコードです(これもAIが書きました)。これは単純なバリューノイズ関数で、浮動小数点数を入力として受け取り、別の浮動小数点数を返します。