{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Voronoi 노드 | Shader Graph | 10.8.0
docs.unity3d.com
"{0}"의 검색 결과

    목차 표시/숨기기

    Voronoi 노드

    설명

    UV 입력을 기반으로 Voronoi 또는 Worley 노이즈를 생성합니다. Voronoi 노이즈는 픽셀과 포인트 격자 간의 거리를 계산하여 생성됩니다. Angle Offset 입력에서 제어되는 의사 난수로 이러한 포인트를 오프셋하여 셀 클러스터를 생성할 수 있습니다. 이러한 셀의 스케일과 결과 노이즈는 Cell Density 입력에서 제어됩니다. Cells 출력에는 원시 셀 데이터가 들어 있습니다.

    포트

    이름 방향 Type 바인딩 설명
    UV 입력 벡터 2 UV 입력 UV 값
    Angle Offset 입력 플로트 None 포인트의 오프셋 값
    Cell Density 입력 플로트 None 생성된 셀의 밀도
    Out 출력 플로트 None 출력 노이즈 값
    Cells 출력 플로트 None 원시 셀 데이터

    생성된 코드 예제

    다음 예제 코드는 이 노드의 가능한 결과 중 하나입니다.

    inline float2 unity_voronoi_noise_randomVector (float2 UV, float offset)
    {
        float2x2 m = float2x2(15.27, 47.63, 99.41, 89.98);
        UV = frac(sin(mul(UV, m)) * 46839.32);
        return float2(sin(UV.y*+offset)*0.5+0.5, cos(UV.x*offset)*0.5+0.5);
    }
    
    void Unity_Voronoi_float(float2 UV, float AngleOffset, float CellDensity, out float Out, out float Cells)
    {
        float2 g = floor(UV * CellDensity);
        float2 f = frac(UV * CellDensity);
        float t = 8.0;
        float3 res = float3(8.0, 0.0, 0.0);
    
        for(int y=-1; y<=1; y++)
        {
            for(int x=-1; x<=1; x++)
            {
                float2 lattice = float2(x,y);
                float2 offset = unity_voronoi_noise_randomVector(lattice + g, AngleOffset);
                float d = distance(lattice + offset, f);
                if(d < res.x)
                {
                    res = float3(d, offset.x, offset.y);
                    Out = res.x;
                    Cells = res.y;
                }
            }
        }
    }
    
    문서 개요
    맨 위로
    Copyright © 2023 Unity Technologies — 상표 및 이용약관
    • 법률정보
    • 개인정보처리방침
    • 쿠키
    • 내 개인정보 판매 금지
    • Your Privacy Choices (Cookie Settings)