{!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} Checkerboard 노드 | Shader Graph | 10.8.0
docs.unity3d.com
"{0}"의 검색 결과

    목차 표시/숨기기

    Checkerboard 노드

    설명

    UV 입력을 기반으로 Color A 및 Color B 입력 간에 번갈아 나타나는 컬러의 체커보드를 생성합니다. 체커보드 스케일은 Frequency 입력에서 정의됩니다.

    포트

    이름 방향 Type 바인딩 설명
    UV 입력 벡터 2 UV 입력 UV 값
    Color A 입력 Color RGB None 첫 번째 체커 컬러
    Color B 입력 Color RGB None 두 번째 체커 컬러
    Frequency 입력 벡터 2 None 축당 체커보드 스케일
    Out 출력 벡터 2 None 출력 UV 값

    생성된 코드 예제

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

    void Unity_Checkerboard_float(float2 UV, float3 ColorA, float3 ColorB, float2 Frequency, out float3 Out)
    {
        UV = (UV.xy + 0.5) * Frequency;
        float4 derivatives = float4(ddx(UV), ddy(UV));
        float2 duv_length = sqrt(float2(dot(derivatives.xz, derivatives.xz), dot(derivatives.yw, derivatives.yw)));
        float width = 1.0;
        float2 distance3 = 4.0 * abs(frac(UV + 0.25) - 0.5) - width;
        float2 scale = 0.35 / duv_length.xy;
        float freqLimiter = sqrt(clamp(1.1f - max(duv_length.x, duv_length.y), 0.0, 1.0));
        float2 vector_alpha = clamp(distance3 * scale.xy, -1.0, 1.0);
        float alpha = saturate(0.5f + 0.5f * vector_alpha.x * vector_alpha.y * freqLimiter);
        Out = lerp(ColorA, ColorB, alpha.xxx);
    }
    
    문서 개요
    맨 위로
    Copyright © 2023 Unity Technologies — 상표 및 이용약관
    • 법률정보
    • 개인정보처리방침
    • 쿠키
    • 내 개인정보 판매 금지
    • Your Privacy Choices (Cookie Settings)