vault backup: 2024-06-21 18:28:18

This commit is contained in:
BlueRose 2024-06-21 18:28:18 +08:00
parent 6ddb534e37
commit ac8b84febf
2 changed files with 33 additions and 5 deletions

View File

@ -1 +1 @@
{"ECS资料":{"ECS资料":{"currentFile":{"count":1,"lastUpdated":1716465594941}}},"DebugView":{"DebugView":{"internalLink":{"count":1,"lastUpdated":1716796051996}}},".p4ignore":{".p4ignore":{"currentFile":{"count":1,"lastUpdated":1717048569032}}},"admin":{"admin":{"currentFile":{"count":1,"lastUpdated":1717123692206}}},"具体的命令应该说是":{"具体的命令应该说是":{"currentFile":{"count":1,"lastUpdated":1717749753511}}},"添加一个Idol.xxx标签。":{"添加一个Idol.xxx标签。":{"currentFile":{"count":2,"lastUpdated":1718092533903}}},"FGBufferData":{"FGBufferData":{"currentFile":{"count":1,"lastUpdated":1718936545718}}}}
{"ECS资料":{"ECS资料":{"currentFile":{"count":1,"lastUpdated":1716465594941}}},"DebugView":{"DebugView":{"internalLink":{"count":1,"lastUpdated":1716796051996}}},".p4ignore":{".p4ignore":{"currentFile":{"count":1,"lastUpdated":1717048569032}}},"admin":{"admin":{"currentFile":{"count":1,"lastUpdated":1717123692206}}},"具体的命令应该说是":{"具体的命令应该说是":{"currentFile":{"count":1,"lastUpdated":1717749753511}}},"添加一个Idol.xxx标签。":{"添加一个Idol.xxx标签。":{"currentFile":{"count":2,"lastUpdated":1718092533903}}},"FGBufferData":{"FGBufferData":{"currentFile":{"count":1,"lastUpdated":1718936545718}}},"中添加写入FGBufferData逻辑。代码如下":{"中添加写入FGBufferData逻辑。代码如下":{"currentFile":{"count":1,"lastUpdated":1718964454078}}}}

View File

@ -1,7 +1,3 @@
# TODO
- [ ] [[#BasePass]]
- [ ] [[#DeferredShadingCommon.ush]]
# Common
## Common.ush
添加结构体主要用在材质的CustomNode里。
@ -633,6 +629,38 @@ FDirectLighting IntegrateBxDF( FGBufferData GBuffer, half3 N, half3 V, half3 L,
```
## DeferredLightPixelShaders.usf
在DeferredLightPixelMain()中添加逻辑:
1. 非卡通材质正常渲染。
2. 材质材质只有在LightingChannel = 2时才会计算卡通光影效果。
```c++
bool UseToonShadow = IsToonShadingModel(ScreenSpaceData.GBuffer.ShadingModelID);
// LightingChannel Toon Shading only calculate light of LightingChannel = 2
BRANCH if (!UseToonShadow || (UseToonShadow && DeferredLightUniforms.LightingChannelMask & 0x4))
{
const float SceneDepth = CalcSceneDepth(InputParams.ScreenUV);
const FDerivedParams DerivedParams = GetDerivedParams(InputParams, SceneDepth);
FDeferredLightData LightData = InitDeferredLightFromUniforms(CURRENT_LIGHT_TYPE);
UpdateLightDataColor(LightData, InputParams, DerivedParams);
#if USE_HAIR_COMPLEX_TRANSMITTANCE
if (ScreenSpaceData.GBuffer.ShadingModelID == SHADINGMODELID_HAIR && ShouldUseHairComplexTransmittance(ScreenSpaceData.GBuffer))
{
LightData.HairTransmittance = EvaluateDualScattering(ScreenSpaceData.GBuffer, DerivedParams.CameraVector, -DeferredLightUniforms.Direction);
}
#endif
float Dither = InterleavedGradientNoise(InputParams.PixelPos, View.StateFrameIndexMod8);
float SurfaceShadow = 1.0f;
float4 LightAttenuation = GetLightAttenuationFromShadow(InputParams, SceneDepth);
float4 Radiance = GetDynamicLighting(DerivedParams.TranslatedWorldPosition, DerivedParams.CameraVector, ScreenSpaceData.GBuffer, ScreenSpaceData.AmbientOcclusion, ScreenSpaceData.GBuffer.ShadingModelID, LightData, LightAttenuation, Dither, uint2(InputParams.PixelPos), SurfaceShadow);
OutColor += Radiance;
}
```
# PostProcess
## ToneMapping
c++部分主要修改了: