vault backup: 2024-02-28 17:33:14
This commit is contained in:
@@ -111,3 +111,61 @@ const float3 WaterDiffuseIndirectIlluminance = DiffuseIndirectLighting * PI;// D
|
||||
8. Out.MRT[0].rgb *= ViewPreExposure;
|
||||
|
||||
### 1553:FinalizeVirtualTextureFeedback
|
||||
|
||||
# UE5
|
||||
|
||||
## Lumen相关
|
||||
- GetSkyLighting()
|
||||
- Lumen
|
||||
- GetTranslucencyGIVolumeLighting()
|
||||
- SkyLighting
|
||||
- GetEffectiveSkySHDiffuse()
|
||||
- GetVolumetricLightmapSkyBentNormal()
|
||||
- GetSkyBentNormalAndOcclusion()
|
||||
|
||||
**GetSkyLighting()** 演示了采样SkyLight与Lumen的方法。
|
||||
|
||||
### SkyLighting
|
||||
GetEffectiveSkySHDiffuse()是一个宏,会根据平台指向下面2个函数:
|
||||
```c++
|
||||
/**
|
||||
* Computes sky diffuse lighting from the SH irradiance map.
|
||||
* This has the SH basis evaluation and diffuse convolution weights combined for minimal ALU's - see "Stupid Spherical Harmonics (SH) Tricks"
|
||||
*/
|
||||
float3 GetSkySHDiffuse(float3 Normal)
|
||||
{
|
||||
float4 NormalVector = float4(Normal, 1.0f);
|
||||
float3 Intermediate0, Intermediate1, Intermediate2;
|
||||
Intermediate0.x = dot(SkyIrradianceEnvironmentMap[0], NormalVector);
|
||||
Intermediate0.y = dot(SkyIrradianceEnvironmentMap[1], NormalVector);
|
||||
Intermediate0.z = dot(SkyIrradianceEnvironmentMap[2], NormalVector);
|
||||
|
||||
float4 vB = NormalVector.xyzz * NormalVector.yzzx;
|
||||
Intermediate1.x = dot(SkyIrradianceEnvironmentMap[3], vB);
|
||||
Intermediate1.y = dot(SkyIrradianceEnvironmentMap[4], vB);
|
||||
Intermediate1.z = dot(SkyIrradianceEnvironmentMap[5], vB);
|
||||
|
||||
float vC = NormalVector.x * NormalVector.x - NormalVector.y * NormalVector.y;
|
||||
Intermediate2 = SkyIrradianceEnvironmentMap[6].xyz * vC;
|
||||
|
||||
// max to not get negative colors
|
||||
return max(0, Intermediate0 + Intermediate1 + Intermediate2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes sky diffuse lighting from the SH irradiance map.
|
||||
* This has the SH basis evaluation and diffuse convolution weights combined for minimal ALU's - see "Stupid Spherical Harmonics (SH) Tricks"
|
||||
* Only does the first 3 components for speed.
|
||||
*/
|
||||
float3 GetSkySHDiffuseSimple(float3 Normal)
|
||||
{
|
||||
float4 NormalVector = float4(Normal, 1);
|
||||
|
||||
float3 Intermediate0;
|
||||
Intermediate0.x = dot(SkyIrradianceEnvironmentMap[0], NormalVector);
|
||||
Intermediate0.y = dot(SkyIrradianceEnvironmentMap[1], NormalVector);
|
||||
Intermediate0.z = dot(SkyIrradianceEnvironmentMap[2], NormalVector);
|
||||
// max to not get negative colors
|
||||
return max(0, Intermediate0);
|
||||
}
|
||||
```
|
Reference in New Issue
Block a user