#contents

----


- COLOR(#30c030){GBufferへの書き込み}
MainPS COLOR(#3030c0){(PixelShaderOutputCommon.usf)}
 FPixelShaderInOut_MainPS  COLOR(#3030c0){(BasePassPixelShader.usf)}
-- COLOR(#30c030){Indirect Light、Sky Lightの計算}
GetPrecomputedIndirectLightingAndSkyLight COLOR(#3030c0){(BasePassPixelShader.usf)}
---COLOR(#30c030){Sky Lightの計算}
GetSkyLighting COLOR(#3030c0){(BasePassPixelShader.usf)}

- COLOR(#30c030){Gバッファからシェーディング}
DirectionalPixelMain COLOR(#3030c0){(DeferredLightPixelShaders.usf)}
-- COLOR(#30c030){動的ライトの計算}
GetDynamicLighting COLOR(#3030c0){(DeferredLightingCommon.usf)}

- 動的影付け
Main (ShadowProjectionPixelShader.usf)
Shadow変数が影の強さ。0.0 - 影



* GetPrecomputedIndirectLightingAndSkyLight [#b1fca4b2]
GBufferのMRT[0]に書き出される

* GetDynamicLighting [#k7f3b590]
記述が無い場合は下記設定でスクリーンショット
- マテリアル
-- BaseColor : 1.0, 1.0, 1.0
-- Metalic : 0.0
-- Roughtness 1.0
-- Specular : 0.5
- ライト
-- ディフューズライト1灯のみ
-- Intencity : 6.0
-- Color : 0.0, 1.0, 0.0

** 基本パラメーター [#l94a890a]
- Default Lit
&ref(Rendering-DefaultLit.png,,50%);
- GBuffer.DiffuseColor
&ref(Rendering-GBuffer.DeffuseColor.png,,50%);
- GBuffer.SpecularColor
&ref(Rendering-GBuffer.SpecularColor.png,,50%);
- LightColor
&ref(Rendering-LightColor.png,,50%);

** ライティングフロー [#x1bcecfc]

SurfaceShading
 ↓
LightAccumulator_Add


*** SurfaceLighting [#odb01557]
#code(C,nonumber,nomenu){{
float3 SurfaceLighting = SurfaceShading(GBuffer, LobeRoughness, LobeEnergy, L, V, N, Random);
}}
&ref(Rendering-SurfaceLighting.png,,50%);

- SurfaceShadingの中身
#code(C,nonumber,nomenu){{
float3 StandardShading( float3 DiffuseColor, float3 SpecularColor, float3 LobeRoughness, float3 LobeEnergy, float3 L, float3 V, half3 N )
{
	float3 H = normalize(V + L);
	float NoL = saturate( dot(N, L) );
	float NoV = saturate( abs( dot(N, V) ) + 1e-5 );
	float NoH = saturate( dot(N, H) );
	float VoH = saturate( dot(V, H) );
	
	// Generalized microfacet specular
	float D = D_GGX( LobeRoughness[1], NoH ) * LobeEnergy[1];
	float Vis = Vis_SmithJointApprox( LobeRoughness[1], NoV, NoL );
	float3 F = F_Schlick( SpecularColor, VoH );

	float3 Diffuse = Diffuse_Lambert( DiffuseColor );
	//float3 Diffuse = Diffuse_Burley( DiffuseColor, LobeRoughness[1], NoV, NoL, VoH );
	//float3 Diffuse = Diffuse_OrenNayar( DiffuseColor, LobeRoughness[1], NoV, NoL, VoH );

	return Diffuse * LobeEnergy[2] + (D * Vis) * F;
}
}}
++ Diffuse * LobeEnergy[2] = x
&ref(Rendering-SurfaceLighting-Diffuse.png,,50%); * &ref(Rendering-SurfaceLighting-LobeEnegy[2].png,,50%); = &ref(Rendering-SurfaceLighting-Diffuse-x-LobeEnegy[2].png,,50%);
++ (D * Vis) * F = y
(&ref(Rendering-SurfaceLighting-D(Roughness_1.0).png,,50%); * &ref(Rendering-SurfaceLighting-Vis(Roughness_1.0).png,,50%); ) * &ref(Rendering-SurfaceLighting-F.png,,50%); = &ref(Rendering-SurfaceLighting-(D-x-Vis)-x-F.png,,50%);
++ x + y = return
&ref(Rendering-SurfaceLighting-Diffuse-x-LobeEnegy[2].png,,50%); + &ref(Rendering-SurfaceLighting-(D-x-Vis)-x-F.png,,50%); = &ref(Rendering-SurfaceLighting.png,,50%);


----
-- Roughness = 0.0の時
++ Diffuse * LobeEnergy[2] = x
&ref(Rendering-SurfaceLighting-Diffuse.png,,50%); * &ref(Rendering-SurfaceLighting-LobeEnegy[2](Roughness_0.0).png,,50%); = &ref(Rendering-SurfaceLighting-Diffuse-x-LobeEnegy[2](Roughness_0.0).png,,50%);
++ (D * Vis) * F = y
(&ref(Rendering-SurfaceLighting-D(Roughness_0.0).png,,50%); * &ref(Rendering-SurfaceLighting-Vis(Roughness_0.0).png,,50%); ) * &ref(Rendering-SurfaceLighting-F.png,,50%); = &ref(Rendering-SurfaceLighting-(D-x-Vis)-x-F(Roughtness_0.0).png,,50%);
++ x + y = return
&ref(Rendering-SurfaceLighting-Diffuse-x-LobeEnegy[2](Roughness_0.0).png,,50%); + &ref(Rendering-SurfaceLighting-(D-x-Vis)-x-F(Roughtness_0.0).png,,50%); = &ref(Rendering-SurfaceLighting(Roughness_0.0).png,,50%);

-- 調整してみるとSurface Lightingにスペキュラが入っている
&ref(Rendering-SurfaceLighting-Roughness_0.0_Adjust.png,,50%);



*** ライトカラーとの合成 [#j09d29bc]
#code(C,nonumber,nomenu){{
LightAccumulator_Add(LightAccumulator, SurfaceLighting, (1.0/PI), LightColor * (NoL * SurfaceAttenuation), bNeedsSeparateSubsurfaceLightAccumulation);
}}
- (NoL * SurfaceAttenuation) = 
&ref(Rendering-NoL.png,,50%); * &ref(Rendering-SurfaceAttenuation.png,,50%); = &ref(Rendering-NoL-x-SurfaceAttenuation.png,,50%);
- LightColor * (NoL * SurfaceAttenuation) = x
&ref(Rendering-LightColor.png,,50%); * &ref(Rendering-NoL-x-SurfaceAttenuation.png,,50%); = &ref(Rendering-LightColor-x-(NoL-x-SurfaceAttenuation).png,,50%);

- SurfaceLighting * x = 
&ref(Rendering-SurfaceLighting.png,,50%); * &ref(Rendering-LightColor-x-(NoL-x-SurfaceAttenuation).png,,50%); = &ref(Rendering-GetDynamicLighting.png,,50%);

----
- Roughness = 0.0の時
- SurfaceLighting * x = 
&ref(Rendering-SurfaceLighting(Roughness_0.0).png,,50%); * &ref(Rendering-LightColor-x-(NoL-x-SurfaceAttenuation).png,,50%); = &ref(Rendering-GetDynamicLighting(Roughness_0.0).png,,50%);

    ホーム 一覧 単語検索 最終更新 バックアップ リンク元   ヘルプ   最終更新のRSS