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

    목차 표시/숨기기

    Normal From Texture 노드

    설명

    Texture 입력에서 정의된 하이트맵을 노멀 맵으로 전환합니다. UV 값과 샘플러 상태는 각각 UV 및 Sampler 입력에서 정의될 수 있습니다. 이 포트에 아무것도 연결되지 않으면 입력의 기본값을 사용합니다. 자세한 내용은 포트 바인딩을 참조하십시오.

    생성된 노멀 맵의 강도는 Offset 및 Strength 입력에서 정의될 수 있습니다. 여기서 Offset은 노멀 디테일의 최대 거리를 정의하고, Strength는 결과에 대한 멀티플라이어 역할을 합니다.

    Custom Function 노드 또는 하위 그래프가 포함된 그래프에서 이 노드를 사용하는 동안 텍스처 샘플링 오류가 발생하면 10.3 이상 버전으로 업그레이드하여 해결할 수 있습니다.

    포트

    이름 방향 Type 바인딩 설명
    Texture 입력 Texture None 하이트맵
    UV 입력 벡터 2 UV 텍스처 좌표
    Sampler 입력 샘플러 상태 None 텍스처의 샘플러
    Offset 입력 플로트 None 샘플을 오프셋할 양
    Strength 입력 플로트 None 강도 멀티플라이어
    Out 출력 벡터 3 None 출력 값

    생성된 코드 예제

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

    void Unity_NormalFromTexture_float(Texture texture, SamplerState Sampler, float2 UV, float Offset, float Strength, out float3 Out)
    {
        Offset = pow(Offset, 3) * 0.1;
        float2 offsetU = float2(UV.x + Offset, UV.y);
        float2 offsetV = float2(UV.x, UV.y + Offset);
        float normalSample = Texture.Sample(Sampler, UV);
        float uSample = Texture.Sample(Sampler, offsetU);
        float vSample = Texture.Sample(Sampler, offsetV);
        float3 va = float3(1, 0, (uSample - normalSample) * Strength);
        float3 vb = float3(0, 1, (vSample - normalSample) * Strength);
        Out = normalize(cross(va, vb));
    }
    
    문서 개요
    맨 위로
    Copyright © 2023 Unity Technologies — 상표 및 이용약관
    • 법률정보
    • 개인정보처리방침
    • 쿠키
    • 내 개인정보 판매 금지
    • Your Privacy Choices (Cookie Settings)