본문으로 바로가기

PBR-BRDF-Disney-Unity-1

category Technical Report/Unity Shader 2022. 3. 2. 17:01
반응형

원문 : https://developpaper.com/pbr-brdf-disney-unity-1/

Disney BRDF source code : https://github.com/wdas/brdf/blob/main/src/brdfs/disney.brdf

 

 

GitHub - wdas/brdf: BRDF Explorer

BRDF Explorer. Contribute to wdas/brdf development by creating an account on GitHub.

github.com

 


analytic

# Copyright Disney Enterprises, Inc.  All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License
# and the following modification to it: Section 6 Trademarks.
# deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the
# trade names, trademarks, service marks, or product names of the
# Licensor and its affiliates, except as required for reproducing
# the content of the NOTICE file.
#
# You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
# variables go here...
# [type] [name] [min val] [max val] [default val]


::begin parameters

color baseColor .82 .67 .16
//Solid colored

float metallic 0 1 0
//Metallicity (metal (0 = dielectric, 1 = metal, semiconductor between 0-1) do not use semiconductor modulation effect unless special needs

float subsurface 0 1 0
//Subsurface, controlling diffuse shape

float specular 0 1 .5
//Specular reflection intensity, instead of refractive index

float roughness 0 1 .5
//Roughness, controlling diffuse and specular reflections

float specularTint 0 1 0
//Specular reflection color, the concession of physics to art

float anisotropic 0 1 0
//Anisotropy, aspect ratio of highlights

float sheen 0 1 0
//Gloss, for cloth

float sheenTint 0 1 .5
//Sheen color control

float clearcoat 0 1 0
//Varnish, second high gloss

float clearcoatGloss 0 1 1
//Gloss of varnish, 0 = "Satin", 1 = "gloss"

::end parameters



::begin shader

//PI
const float PI = 3.14159265358979323846;

//Square
float sqr(float x) { return x*x; }

// schlickfresnel Fresnel
float SchlickFresnel(float u)
{
    float m = clamp(1-u, 0, 1);
              //Reverse and limit to 0-1
    float m2 = m*m;
              //Square
    return m2*m2*m; //  5th power
}

float GTR1(float NdotH, float a)
{
    if (a >= 1) return 1/PI;
    //If a is greater than or equal to 1, the reciprocal of PI is returned
    float a2 = a*a;
    float t = 1 + (a2-1)*NdotH*NdotH;
    return (a2-1) / (PI*log(a2)*t);
}

float GTR2(float NdotH, float a)
{
    float a2 = a*a;
    float t = 1 + (a2-1)*NdotH*NdotH;
    return a2 / (PI * t*t);
}

float GTR2_aniso(float NdotH, float HdotX, float HdotY, float ax, float ay)
{
    return 1 / (PI * ax*ay * sqr( sqr(HdotX/ax) + sqr(HdotY/ay) + NdotH*NdotH ));
}

float smithG_GGX(float NdotV, float alphaG)
{
    float a = alphaG*alphaG;
    float b = NdotV*NdotV;
    return 1 / (NdotV + sqrt(a + b - a*b));
}

float smithG_GGX_aniso(float NdotV, float VdotX, float VdotY, float ax, float ay)
{
    return 1 / (NdotV + sqrt( sqr(VdotX*ax) + sqr(VdotY*ay) + sqr(NdotV) ));
}

vec3 mon2lin(vec3 x)
{
    return vec3(pow(x[0], 2.2), pow(x[1], 2.2), pow(x[2], 2.2));
}

vec3 BRDF( vec3 L, vec3 V, vec3 N, vec3 X, vec3 Y )
{
    float NdotL = dot(N,L);
    float NdotV = dot(N,V);

    if (NdotL < 0 || NdotV < 0) return vec3(0);
    //Constraints, if less than 0, are meaningless

    vec3 H = normalize(L+V);
    float NdotH = dot(N,H);
    float LdotH = dot(L,H);
    vec3 Cdlin = mon2lin(baseColor);
    float Cdlum = .3*Cdlin[0] + .6*Cdlin[1]  + .1*Cdlin[2]; // luminance approx.
    vec3 Ctint = Cdlum > 0 ? Cdlin/Cdlum : vec3(1); // normalize lum. to isolate hue+sat
    vec3 Cspec0 = mix(specular*.08*mix(vec3(1), Ctint, specularTint), Cdlin, metallic);
    vec3 Csheen = mix(vec3(1), Ctint, sheenTint);

    //Diffuse Fresnel - from 1 of normal incidence to 0.5 of grazing
    //Diffuse reflectance is mixed according to roughness

    float FL = SchlickFresnel(NdotL), FV = SchlickFresnel(NdotV);
    float Fd90 = 0.5 + 2 * LdotH*LdotH * roughness;
    float Fd = mix(1.0, Fd90, FL) * mix(1.0, Fd90, FV);

     //Hanrahan Krueger BRDF approximation based on isotropic BSSRDF
     //1.25 scale for (approximate) retained albedo
     //Fss90 is used to "flatten" roughness based retroreflection

    float Fss90 = LdotH*LdotH*roughness;
    float Fss = mix(1.0, Fss90, FL) * mix(1.0, Fss90, FV);
    float ss = 1.25 * (Fss * (1 / (NdotL + NdotV) - .5) + .5);

    // specular
    float aspect = sqrt(1-anisotropic*.9);
    float ax = max(.001, sqr(roughness)/aspect);
    float ay = max(.001, sqr(roughness)*aspect);
    float Ds = GTR2_aniso(NdotH, dot(H, X), dot(H, Y), ax, ay);
    float FH = SchlickFresnel(LdotH);
    vec3 Fs = mix(Cspec0, vec3(1), FH);
    float Gs;
    Gs  = smithG_GGX_aniso(NdotL, dot(L, X), dot(L, Y), ax, ay);
    Gs *= smithG_GGX_aniso(NdotV, dot(V, X), dot(V, Y), ax, ay);

    // sheen
    vec3 Fsheen = FH * sheen * Csheen;

    // clearcoat (ior = 1.5 -> F0 = 0.04)
    float Dr = GTR1(NdotH, mix(.1,.001,clearcoatGloss));
    float Fr = mix(.04, 1.0, FH);
    float Gr = smithG_GGX(NdotL, .25) * smithG_GGX(NdotV, .25);
    return ((1/PI) * mix(Fd, ss, subsurface)*Cdlin + Fsheen)
        * (1-metallic)
        + Gs*Fs*Ds + .25*clearcoat*Gr*Fr*Dr;
}


::end shader

 

Implementation of Disney BRDF decomposition

경로 및 분석 : 첫째, 데이터 리소스, 방정식이 계산되기 전 액세스 데이터의 정확성.
일치하는 텍스처 리소스가 정확해야 합니다. 감마 공간 선형 공간 데이터 리소스를 구별합니다. PBR 워크플로에서는 Specular 흐름과 Metallic 워크플로의 두 가지 방향이 있습니다. 최근 몇 년 동안 Metallic 워크플로는 주로 게임에서 채널 분할이 반복(매개변수가 더 직관적이고 수치 계산이 더 정확함)에 도움이 되어 더 많은 시간과 비용을 절약할 수 있기 때문에 주로 사용되었습니다. 그리고 이 노트도 Metallic flow를 기반으로 합니다. 다른 워크플로 방향 맵핑 리소스도 다릅니다.

 

둘째, 디즈니 함수 분석(source code analysis):

 

디즈니 BRDF 모델 방정식(Disney BRDF model equation)

방정식에 대한 간략한 설명 : 미세 표면 및 에너지 보존 이론을 기반으로 합니다.

* 일반적으로 Lambert 디퓨즈 항으로 표현되는 것으로 가정되는 확산은 상수 값입니다.
* 오른쪽의 분수 형태는 스페큘러 스페큘러입니다 :
  
D는 미세 표면의 노멀 방향의 분포입니다. 스페큘러 하이라이트, 스페큘러 모양(Specular shape);
  
F는 프레넬 반사 계수입니다.
   G는 미세 표면의 지오메트리 변화, 미세 지오메트리 항(term) , 미세 표면의 그림자 및 마스크(마스크) 및 계수입니다.
  
θ H는 노멀 N과 하프 벡터 h, ndoth 사이의 각도입니다.
  
θ D는 L과 H 하프 벡터 H(또는 대칭적으로 V와 H), ldoth 또는 vdoth 사이의 "차이" 각도입니다.
   θ L은 노멀 n, ndotl에 대한 L 벡터의 입사각입니다. θ V는 노멀 n, ndotv에 대한 V 벡터의 입사각입니다.

ldoth와 vdoth의 대각선 각도는 같습니다. 내적은 cos 각을 계산하는 것이며 효과는 동일합니다. 아래 범례 참조: 2017 – mirror D observation


전체 기능은 언뜻 보기에 너무 복잡하고 거대합니다. 내부 매개변수도 복잡하고 혼란스럽습니다. 그래서 더 좋은 방법이 있습니다. 분할하십시오. (함수는 diffuse + specular)

파트 I : Diffuse subsurface scattering : Diffuse reflection term(문헌에 따르면 Diffuse relfection 용어는 subsurface scattering 용어를 가리킵니다.)

Diffuseion(확산) 모델. 일반적으로 램버트 확산의 일정한 값으로 표현된다고 가정합니다(모든 방향의 난반사 강도가 동일하므로 π로 나누어야 함). 따라서 일반 Lambert는 BRDF Lambert와 다릅니다(일반 Lambert 라이트 모드 NDL 계수는 BRDF 난반사 방정식의 일부입니다). 잡담 : 모든 것은 산란되며, 금속도 예외는 아닙니다. 오직 불충분한 계산 및 시뮬레이션에서 의도적으로 무시됩니다(에너지 보존-energy conversation, 오직 블랙홀만 에너지를 반사하지 않고 에너지를 완전히 흡수할 수 있음).

 

Three basic BRDF diffusion models: Lambert, Oren Nayar, Hanrahan Krueger

Disney diffuse

among

Parameters :
* Basecolor surface color (Metallicsetup에서 맵 금속 정보에 따라 계산된 diffcolor) )
* Roughness
* cosθl NdotL
* cosθv NdotV
* cos θ D ldoth or vdoth

cos θ D는 두 가지 방식으로 작성됩니다. 하나는 unity ldoth이고, 다른 하나는 Disney ldoth이고, 다른 하나는 UE Voh입니다.


// Unity UnityStandardBRDF. Cginc file
//Note: Disney diffuse must be multiplied by diffuse albedo / PI. This is done outside of this function.
half DisneyDiffuse(half NdotV, half NdotL, half LdotH, half perceptualRoughness)
{
    half fd90 = 0.5 + 2 * LdotH * LdotH * perceptualRoughness;
    //Two Schlick Fresnel terms
    half lightScatter   = (1 + (fd90 - 1) * Pow5(1 - NdotL));
    half viewScatter    = (1 + (fd90 - 1) * Pow5(1 - NdotV));
    return lightScatter * viewScatter;
}

//BRDF1_Unity_PBS 
//Disney diffuse item
    half diffuseTerm = DisneyDiffuse(nv, nl, lh, perceptualRoughness) * nl;
//I took NL here

// UE4 BRDF. In the ush file
// [Burley 2012, "Physically-Based Shading at Disney"]
float3 Diffuse_Burley( float3 DiffuseColor, float Roughness, float NoV, float NoL, float VoH )
{
    float FD90 = 0.5 + 2 * VoH * VoH * Roughness;
    float FdV = 1 + (FD90 - 1) * Pow5( 1 - NoV );
    float FdL = 1 + (FD90 - 1) * Pow5( 1 - NoL );
    return DiffuseColor * ( (1 / PI) * FdV * FdL );
}

 

Part II : 공식의 오른쪽 부분(표면 반사: 정반사 항)

유니티 구현은 G 항목을 V 항목으로 대체하는 DFG(디즈니) – > > DFV(유니티) 공식과 다소 다르지만 전체 프레임워크는 동일합니다. unity URP lit shader의 디렉셔널 라이팅 섹션에 자세한 설명이 있습니다.

 

2.1, D(θ h) 스페큘러 D 관찰(미세 표면 노멀 방향의 분포) 스페큘러 반사 하이라이트(specular reflection highlight), 하이라이트 모양.

Merl chromium에는 여러 대칭 분포(Mirror distributions)가 적합합니다.
왼쪽 : 스페큘러 피크 로그 θ H(도-degrees)의 로그 스케일 플롯;
Black = Chromium, red = GGX(α= 0.006), Green = Beckmann(M = 0.013), blue = blinnphong(n = 12000).
오른쪽: 크롬, GGX 및 Beckmann 의 스포트라이트 응답.

일반화된 Trowbridge Reitz 또는 GTR로 소개되거나 불리우는 것입니다.

Parameters:
C scaling constant(스케일링 상수)
α The roughness parameter (일반적으로 자각하는 거친정도의 맵) 은 0~1 사이입니다.
θ H is ndh
γ Index value

 

다양한 γ GTR 분포 곡선과 θ H 관계

BRDF에서 GTR 2(메인 미러 로브)는 기본 매터리얼의 이방성(anisotropic) 및/또는 등방성(isotropic) 금속 또는 비금속(일반적으로 low-하이라이트로 알려짐)에 먼저 사용됩니다. GTR 1(보조 미러 로브)은 등방성 및 비금속성인 상부 투명 코팅 재료(일반적으로 upper-하이라이트로 알려진 클리어코트 배니쉬 매터리얼)에 두번째로 사용됩니다.(자동차 페인트와 같은 2개의 레이어 하이라이트 개념 : 금속 레이어(Metal layer) + 배니쉬 레이어(varnish layer), 배니쉬의 두께는 계산에 포함됩니다. 배니쉬는 상단에 금속은 하단에 있으며 두 레이어 모두 다른 하이라이트 효과를 가지고 있습니다. 개발 동향: 더 복잡한 다중 레이어 하이라이트 계산)


// UnityBuiltin UnityStandardBRDF. Cginc file
inline float GGXTerm (float NdotH, float roughness)
{
// corresponding to Disney GTR2 lower layer
    float a2 = roughness * roughness;
    float d = (NdotH * a2 - NdotH) * NdotH + 1.0f; // 2 mad
    return UNITY_ INV_ PI * a2 / (d * d + 1e-7f); // This feature is not suitable for running on mobile,
                                             //Therefore, epsilon is less than half
}

// UE4 BRDF. Anisotropic GGX in ush file
// [Burley 2012, "Physically-Based Shading at Disney"]
float D_GGXaniso( float ax, float ay, float NoH, float3 H, float3 X, float3 Y )
{
    float XoH = dot( X, H );
    float YoH = dot( Y, H );
    float d = XoH*XoH / (ax*ax) + YoH*YoH / (ay*ay) + NoH*NoH;
    return 1 / ( PI * ax*ay * d*d );
}

 

Disney GTR (gtr1 is γ= 1. GTR2 is γ= 2)

 


float GTR1(float NdotH, float a)
{
    if (a >= 1) return 1/PI;
    //If a is greater than or equal to 1, the reciprocal of PI is returned
    float a2 = a*a;
    float t = 1 + (a2-1)*NdotH*NdotH;
    return (a2-1) / (PI*log(a2)*t);
}
float GTR2(float NdotH, float a)
{
    float a2 = a*a;
    float t = 1 + (a2-1)*NdotH*NdotH;
    return a2 / (PI * t*t);
}

//Different versions
float GTR2_aniso(float NdotH, float HdotX, float HdotY, float ax, float ay)
{
    return 1 / (PI * ax*ay * sqr( sqr(HdotX/ax) + sqr(HdotY/ay) + NdotH*NdotH ));
}

 

2017 – 미러 D 관찰은 미세 측면의 노멀이 M = h를 충족하는 비율(아래 그림에서 원으로 표시)을 계산하는데 사용됩니다. 조건이 충족되면 미세 표면이 L에서 V로 빛을 반사하고 수식 사이에 m-Term 벡터가 작성됩니다.

2017-brdf는 들어오는 광선과 나가는 광선 사이의 거리를 무시합니다. 원 영역의 크기 정의는 이론적 계산(미세면의 비율 계산)에서 매우 중요합니다. 샘플링 범위는 성능과 직접 연결됩니다.

2017-bssrdf 들어오고 나가는 광선 거리 계산

 

원의 크기를 판단값으로 설정하여 렌더링의 정확도를 결정합니다.

2.2、F( θ d) Mirror f observation (Fresnel reflection)

Paramters :
F0 정반사율, LERP(상수값, 알베도, 메탈릭)로 구합니다. 상수값은 데이터 색상 공간과 직접 관련됩니다. 색 공간은 다르고 값도 다릅니다.
cos θ D를 작성하는 두 가지 다른 방법이 있습니다. 하나는 HDL(unity ldoth, Disney ldoth)이고 다른 하나는 HDV(UE Voh)입니다.
가십: 모든 것에는 프레넬 반사가 있습니다.

Fresnel reflex on the left

//Dot (V, H) is used in the formula. By default, unity passes in dot (L, H), dot(V, H)는 공식에 사용됩니다. 기본적으로 Unity는 dot(L, H)으로 전달됩니다.
//Because a large number of calculations of BRDF use the dot product of L and h, and H is the half angle vector of L and V, the included angle of LH and VH is the same. BRDF의 많은 계산은 L과 h의 내적을 사용하고 H는 L과 V의 반각 벡터이기 때문에 LH와 VH의 끼인각은 동일합니다.
//You don't need one more variable. 변수가 하나 더 필요하지 않습니다.
// UnityBuiltin UnityStandardBRDF. Cginc file

Inline half pow5 (half x) // performance optimization
{
    return x*x * x*x * x;
}
Inline half3 fresnelterm (half3 F0, half COSA) // corresponding to Disney f
{
    half t = Pow5 (1 - cosA);   //  Ala Schlick interpolation
    //Dot (V, H) is used in the formula. By default, unity passes in dot (L, H)
    //Because a large number of calculations of BRDF use the dot product of L and h, and H is the half angle vector of L and V, the included angle of LH and VH is the same. No need for one more variable .
    return F0 + (1-F0) * t;
}

// UE4 BRDF. In the ush file
// [Schlick 1994, "An Inexpensive BRDF Model for Physically-Based Rendering"]
float3 F_Schlick( float3 SpecularColor, float VoH )
{
    float Fc = Pow5( 1 - VoH );                      // 1 sub, 3 mul
    //return Fc + (1 - Fc) * SpecularColor;        // 1 add, 3 mad

    // Anything less than 2% is physically impossible and is instead considered to be shadowing
    return saturate( 50.0 * SpecularColor.g ) * Fc + (1 - Fc) * SpecularColor;

}

float3 F_Fresnel( float3 SpecularColor, float VoH )
{
    float3 SpecularColorSqrt = sqrt( clamp( float3(0, 0, 0), float3(0.99, 0.99, 0.99), SpecularColor ) );
    float3 n = ( 1 + SpecularColorSqrt ) / ( 1 - SpecularColorSqrt );
    float3 g = sqrt( n*n + VoH*VoH - 1 );
    return 0.5 * Square( (g - VoH) / (g + VoH) ) * ( 1 + Square( ((g+VoH)*VoH - 1) / ((g-VoH)*VoH + 1) ) );
}

 

2.3, G( θ l, θ v) mirror g 미시적(microscopic) 표면 지오메트릭 변화, 미시적 기하학적 용어, 미시적 표면의 그림자 및 마스크(마스크)(단일 V 용어는 동등함)가 가장 복잡한 용어

 

BRDF-V

Merl 100 재료의 알베도 맵.
왼쪽: 50개의 smooth material, 오른쪽: 50개의 rough material.

여러 스페큘러 g 모델의 알베도 맵을 비교합니다. 모든 플롯은 동일한 D(GGX/TR) 및 f 인자를 사용합니다.
Left: smooth surface( α= 0.02); Right: rough surface( α= 0.5)。 “No G” 모드는 g 와 1 / cos θ lcos θ V 인자를 제외합니다.

세 가지 대략적인 분포 모델 : Kurt의 경험적 모델(데이터 피팅), Walter의 Smith g 도함수, 자유 매개변수로서의 Schlick의 단순 도함수 러프니스

이 텍스트 섹션은 그림(미시적 그림자 및 마스크(마스크))에 해당하며 반사 모델을 한 번만 계산합니다. 일부 광선에는 입사 및 출구 예제가 없습니다. 하나의 효과적인 반사만 계산됩니다.

이 문서에서 더 복잡한 알고리즘인 다중 반사 계산도 일반적인 베이킹을 사용합니다.


// UnityBuiltin UnityStandardBRDF. Cginc file
//Low effect version V item, but better performance
//Note: the visibility term is the complete form of Torrance sparrow model, including geometric terms: v = g / (N.L * N.V)
//This makes it easier to swap geometry items and has more optimization space (except perhaps in the case of the cooktorrance geom item)
//General Smith Schlick visibility terminology

inline half SmithVisibilityTerm (half NdotL, half NdotV, half k)
{
    half gL = NdotL * (1-k) + k;
    half gV = NdotV * (1-k) + k;
    return 1.0 / (gL * gV + 1e-5f); // This feature is not suitable for running on mobile,
                                     //Therefore, epsilon is less than a value that can be expressed as half
}

//Smith Schlick is Beckman's work
inline half SmithBeckmannVisibilityTerm (half NdotL, half NdotV, half roughness)
{
    half c = 0.797884560802865h; // c = sqrt(2 / Pi)
    half k = roughness * c;
    return SmithVisibilityTerm (NdotL, NdotV, k) * 0.25f; // *  0.25 is 1 / 4 of the visibility item
}

//High effect version V item
// Ref:  http://jcgt.org/published/0003/02/03/paper.pdf 2014 literature
//Calculation of visibility items, including geometric functions and trim coefficients
inline float SmithJointGGXVisibilityTerm (float NdotL, float NdotV, float roughness)
{
    #If 0 // it is closed by default. Note: This is frostbite's GGX Smith joint scheme (accurate, but it requires two prescriptions, which is uneconomical)
        //Original recipe:
        //  lambda_v    = (-1 + sqrt(a2 * (1 - NdotL2) / NdotL2 + 1)) * 0.5f;
        //  lambda_l    = (-1 + sqrt(a2 * (1 - NdotV2) / NdotV2 + 1)) * 0.5f;
        //  G           = 1 / (1 + lambda_v + lambda_l);
        //Reorder the code to make it more optimized
        half a          = roughness;
        half a2         = a * a;
        half lambdaV    = NdotL * sqrt((-NdotV * a2 + NdotV) * NdotV + a2);
        half lambdaL    = NdotV * sqrt((-NdotL * a2 + NdotL) * NdotL + a2);
        //Simplified visibility terms: (2.0f * ndotl * ndotv) / ((4.0f * ndotl * ndotv) * (lambda_v + lambda_l + 1e-5f));
        return 0.5f / (lambdaV + lambdaL + 1e-5f);  // This feature is not suitable for running on mobile,
                                                    //Therefore, epsilon is less than a value that can be expressed as half
    #else
        //Take this part
        //Approximate value (simplified sqrt, mathematically incorrect, but close enough)
        //This part is the GGX Smith joint approximation scheme of repawn entertainment
        float a = roughness;
        float lambdaV = NdotL * (NdotV * (1 - a) + a);
        float lambdaL = NdotV * (NdotL * (1 - a) + a);
        #if defined(SHADER_API_SWITCH)
            return 0.5f / (lambdaV + lambdaL + 1e-4f); // Solution to hlslcc rounding error
        #else
            return 0.5f / (lambdaV + lambdaL + 1e-5f);
        #endif
    #endif
}

// UE
//Smith GGX item g, same sex version
float smithG_GGX(float NdotV, float alphaG)
{
    float a = alphaG * alphaG;
    float b = NdotV * NdotV;
    return 1 / (NdotV + sqrt(a + b - a * b));
}
//Smith GGX item g, version of each item
// Derived G function for GGX
float smithG_GGX_aniso(float dotVN, float dotVX, float dotVY, float ax, float ay)
{
    return 1.0 / (dotVN + sqrt(pow(dotVX * ax, 2.0) + pow(dotVY * ay, 2.0) + pow(dotVN, 2.0)));
}
//GGX varnish geometry
// G GGX function for clearcoat
float G_GGX(float dotVN, float alphag)
{
        float a = alphag * alphag;
        float b = dotVN * dotVN;
        return 1.0 / (dotVN + sqrt(a + b - a * b));
}

 

2.31, 1/4cos θ lcos θ V 미세 기하항의 도함수, 미세 표면과 매크로 표면의 수 차이를 수정하는 데 사용되는 수정 계수(전체)

미세 표면의 형태로 구체적으로 기술되지 않은 물리적으로 실현 가능한 대부분의 모델은 분포 함수, 프레넬 계수 및 기하학적 그림자 계수로 간주될 수 있는 기타 요소도 있기 때문에 여전히 미세 표면 모델로 설명할 수 있습니다. 유일한 실제 차이점은 미세 표면 모델과 다른 모델 사이에 명시적 보정 계수가 포함되어 있는지 여부입니다.

명시적 보정 계수(Explict correction factor)

명시적 보정 계수는 미세 표면 모델에서 파생됩니다. 이 요소가 포함되지 않은 모델의 경우 트림을 사용하십시오. 숨겨진 그림자는 모델을 D 및 F θ lcos θ V로 나누어 요소를 결정함으로써 4cos를 곱할 수 있습니다.

Unity V 항(G 항에 해당) : BRDF 함수 피팅 최적화 항
pbr-brdf-disney-unity-3의 directbdrf 함수 조각에 대한 설명을 참조하십시오.

2.4. Cloth;

2.5. Rainbow (rainbow can give art a colorful Black: P, skip, have time to further study)


Required References:
Substance PBR instruction manual
https://link.zhihu.com/?target=https%3A//academy.substance3d.com/courses/pbrguide
Eight monkey PBR instruction manual
https://marmoset.co/posts/basic-theory-of-physically-based-rendering/marmoset.co
Siggraph 2012 original article: 2012 physically based shading at Disney
https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdfmedia.disneyanimation.com
My sorted Chinese version:
https://link.zhihu.com/?target=https%3A//github.com/MasterWangdaoyong/Shader-Graph/tree/main/Show/PBR-BRDF-Disney-Unity
Siggraph 2017 original article: 2017 reflection models (BRDF)
https://cgg.mff.cuni.cz/~pepca/lectures/pdf/pg2-05-brdf.en.pdfcgg.mff.cuni.cz
Yan Lingqi (Yan Shen):
https://link.zhihu.com/?target=http%3A//games-cn.org/
I hope there are also friends learning 101102201202 to discuss communication:)
Personal learning notes address:
https://github.com/MasterWangdaoyong/Shader-Graph/tree/main/Unity_SourceCodegithub.com
MasterWangdaoyong/Shader-Graph
https://github.com/MasterWangdaoyong/Shader-Graph/tree/main/Unity_SourceCodegithub.com
Hairy Nebula:https://zhuanlan.zhihu.com/p/60977923
Yuxuan:https://zhuanlan.zhihu.com/p/137039291
Xiong Xinke: source code analysis Chapter 10 Chapter 11
Feng Lele: introduction essentials Chapter 18

 

 

반응형