콘텐츠로 건너뛰기

[Mobile shader] Dual Lobe GGX works

Unity3D URP

Dual Lobe GGX works

preview

Dual Lobe Debug view.

// Specular term
	half perceptualRoughness = SmoothnessToPerceptualRoughness(smoothness);
	half roughness = PerceptualRoughnessToRoughness(perceptualRoughness);

	half a = roughness;
	half a2 = a*a;

	half d = nh * nh * (a2 - 1.h) + 1.00001h;
	half specularTerm = a2 / (max(0.1h, lh*lh) * (roughness + 0.5h) * (d * d) * 4);
	
	float Lobe0Roughness = max(saturate(specularTerm ), 0.002f);
	float Lobe1Roughness = clamp(specularTerm, 0.0, 100.0) *  _LobeWeight;
	
#if defined(DUAL_LOBE_GGX)
    float sAO = saturate(-0.3f + nv * nv);
    sAO =  lerp(pow(ao, 8.00f), 1.0f, sAO);
	half SpecularOcclusion = sAO;
	specularTerm = (Lobe0Roughness / 2 + Lobe1Roughness) * SpecularOcclusion ;
	return half4(specularTerm.xxx,1);
#else
	specularTerm = clamp(specularTerm, 0.0, 100.0); // Prevent FP16 overflow on mobiles
#endifCode language: PHP (php)

태그:

“[Mobile shader] Dual Lobe GGX works”의 1개의 댓글

  1. 핑백: Advanced Skin Shader for Next-Gen Mobile games. – leegoonz technical art director

댓글 남기기

MY NAME IS JP에서 더 알아보기

지금 구독하여 계속 읽고 전체 아카이브에 액세스하세요.

Continue reading