Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

3D snoise artifact on x=y=z

オープン
#71 コメント 1 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
csharp, unity

調査の方向性

Unity.Mathematics.noise.snoise(float3) の実装から始め、提供されている Unity3D NoiseBugRepro スクリプトを実行します。(2.00, 2.00, 2.00) における値を近傍の入力値と比較し、その後、アーティファクトが除去され、サンプリングした線に沿って出力が滑らかに変化することを確認します。

索引モデルが issue の本文から書いたものです。

説明

The "snoise(float3 v)" function has artefacts in a line exactly at x=y=z.
This artefact seems to repeat in multiple places (always along the line x=y=z relative to a noise cell maybe?).

This produces obvious artefacts when used in my voxel engine in Unity3D,
which currently uses marching cubes to display the isosurface at value 0 of the 3d noise.

bug_img01

The relevant code is this:
valueForMarchingCubes = Unity.Mathematics.noise.snoise(pos3d / 100f) + 0.42f;

A reproduceable Unity3D script:

using UnityEngine;
using Unity.Mathematics;
using static Unity.Mathematics.math;

public class NoiseBugRepro : MonoBehaviour {
    // Start is called before the first frame update
    void Start () {
        string output = "";
        for (int i = 0; i<20; ++i) {
            float x = lerp(1.8f, 2.2f, i / 20f);
            float3 pos = float3(x, 2f, 2f);

            float val = noise.snoise(pos / 20f);

            output += string.Format("noise.snoise({0:F2}, {1:F2}, {2:F2}) -> {3:F6}\n", pos.x, pos.y, pos.z, val);
        }

        Debug.Log(output);
    }
}

Output that shows the artefact when exactly on the x=y=z line:

noise.snoise(1.80, 2.00, 2.00) -> -0.373848
noise.snoise(1.82, 2.00, 2.00) -> -0.372971
noise.snoise(1.84, 2.00, 2.00) -> -0.372090
noise.snoise(1.86, 2.00, 2.00) -> -0.371204
noise.snoise(1.88, 2.00, 2.00) -> -0.370314
noise.snoise(1.90, 2.00, 2.00) -> -0.369420
noise.snoise(1.92, 2.00, 2.00) -> -0.368521
noise.snoise(1.94, 2.00, 2.00) -> -0.367619
noise.snoise(1.96, 2.00, 2.00) -> -0.366712
noise.snoise(1.98, 2.00, 2.00) -> -0.365801
noise.snoise(2.00, 2.00, 2.00) -> -0.571772
noise.snoise(2.02, 2.00, 2.00) -> -0.363966
noise.snoise(2.04, 2.00, 2.00) -> -0.363043
noise.snoise(2.06, 2.00, 2.00) -> -0.362115
noise.snoise(2.08, 2.00, 2.00) -> -0.361184
noise.snoise(2.10, 2.00, 2.00) -> -0.360248
noise.snoise(2.12, 2.00, 2.00) -> -0.359309
noise.snoise(2.14, 2.00, 2.00) -> -0.358365
noise.snoise(2.16, 2.00, 2.00) -> -0.357418
noise.snoise(2.18, 2.00, 2.00) -> -0.356467
主要言語
C#
スター
1.4k
フォーク
159
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Unity-Technologies/Unity.Mathematics のほかの issue

Unity-Technologies/Unity.Mathematics の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。