当前位置:网站首页>UE4 shadow: perobjectshadow verification
UE4 shadow: perobjectshadow verification
2022-07-18 20:57:00 【sh15285118586】
r.Shadow.PerObject
1 Turn on , 0 close
PerObjectShadow Include :
bCreateTranslucentObjectShadow || bCreateInsetObjectShadow || bCreateObjectShadowForStationaryLight
const bool bTranslucentObjectShadow = LightSceneInfo->Proxy->CastsTranslucentShadows() && PrimitiveSceneInfo->Proxy->CastsVolumetricTranslucentShadow();
const bool bInsetObjectShadow =
// Currently only supporting inset shadows on directional lights, but could be made to work with any whole scene shadows
LightSceneInfo->Proxy->GetLightType() == LightType_Directional
&& PrimitiveSceneInfo->Proxy->CastsInsetShadow();
const uint32 MinShadowResolution = FMath::Max<int32>(0, CVarMinShadowResolution.GetValueOnRenderThread());
const uint32 ShadowFadeResolution = FMath::Max<int32>(0, CVarShadowFadeResolution.GetValueOnRenderThread());
static TAutoConsoleVariable<int32> CVarShadowFadeResolution(
TEXT("r.Shadow.FadeResolution"),
64,
TEXT("Resolution in texels below which shadows are faded out"),
ECVF_Scalability | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarMinShadowResolution(
TEXT("r.Shadow.MinResolution"),
32,
TEXT("Minimum dimensions (in texels) allowed for rendering shadow subject depths"),
ECVF_RenderThreadSafe);
AmountShadow, Shadow transparency condition
MinShadowResolution ShadowFadeResolution Shadow fade adjustment , The size can understand the pixel value of the screen .
/**
* Helper function to determine fade alpha value for shadows based on resolution. In the below ASCII art (1) is
* the MinShadowResolution and (2) is the ShadowFadeResolution. Alpha will be 0 below the min resolution and 1
* above the fade resolution. In between it is going to be an exponential curve with the values between (1) and (2)
* being normalized in the 0..1 range.
*
*
* | /-------
* | /
* |/
* 1-----2-------
*
* @param MaxUnclampedResolution Requested resolution, unclamped so it can be below min
* @param ShadowFadeResolution Resolution at which fade begins
* @param MinShadowResolution Minimum resolution of shadow
*
* @return fade value between 0 and 1
*/
float CalculateShadowFadeAlpha(const float MaxUnclampedResolution, const uint32 ShadowFadeResolution, const uint32 MinShadowResolution)
{
// NB: MaxUnclampedResolution < 0 will return FadeAlpha = 0.0f.
float FadeAlpha = 0.0f;
// Shadow size is above fading resolution.
if (MaxUnclampedResolution > ShadowFadeResolution)
{
FadeAlpha = 1.0f;
}
// Shadow size is below fading resolution but above min resolution.
else if (MaxUnclampedResolution > MinShadowResolution)
{
const float Exponent = CVarShadowFadeExponent.GetValueOnRenderThread();
// Use the limit case ShadowFadeResolution = MinShadowResolution
// to gracefully handle this case.
if (MinShadowResolution >= ShadowFadeResolution)
{
const float SizeRatio = (float)(MaxUnclampedResolution - MinShadowResolution);
FadeAlpha = 1.0f - FMath::Pow(SizeRatio, Exponent);
}
else
{
const float InverseRange = 1.0f / (ShadowFadeResolution - MinShadowResolution);
const float FirstFadeValue = FMath::Pow(InverseRange, Exponent);
const float SizeRatio = (float)(MaxUnclampedResolution - MinShadowResolution) * InverseRange;
// Rescale the fade alpha to reduce the change between no fading and the first value, which reduces popping with small ShadowFadeExponent's
FadeAlpha = (FMath::Pow(SizeRatio, Exponent) - FirstFadeValue) / (1.0f - FirstFadeValue);
}
}
return FadeAlpha;
}


The camera is away from objects , The shadow faded away

边栏推荐
- VirtualBox virtual machine failed to start, e_ FAIL( 0x80004005)
- 面试问题五
- R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用step函数基于AIC指标实现逐步回归筛选最佳模型
- 剑指 Offer 53 - II. 0~n-1中缺失的数字
- Tableau JDBC connection graphdb
- 树莓派记录
- Play through ansible directory in one step
- Nexus5 root brush
- Opencv tutorial 02: core operations of opencv
- Electron installation configuration
猜你喜欢

There is something that turns vscode into an idea effect

一步到位玩透Ansible-目录

Remember these points and you can quickly find bugs

GD32F4(6):晶振引发串口乱码

宇宙第一 IDE 霸主,换人了。。。

摸清企业选址动机及需求,高效开展招商引资工作

实战项目:数据访问层时所遇问题

高数下|二重积分的计算1|高数叔|手写笔记

Find out the motivation and needs of enterprise location, and carry out investment attraction work efficiently

21. How does the program execute after entering the URL in the browser?
随机推荐
Tableau JDBC连接GraphDB
Sword finger offer 57 And are two numbers of S
R语言使用pcauchy函数生成柯西分布累积分布函数数据、使用plot函数可视化柯西分布累积分布函数数据(Cauchy distribution)
Development of power module based on stm32
我是猪代码
UE4阴影:PerObjectShadow验证
EPIC-KBS9工控机刷机文档
VirtualBox virtual machine failed to start, e_ FAIL( 0x80004005)
R语言ggplot2可视化:ggplot2可视化密度图(density plot)并使用geom_vline函数添加均值竖线、添加均值数值标签(Mean Line or Vertical Line )
Basic research on Chang'an chain TLS
Mathematical modeling - Classification Model (based on logistic regression)
你猜不到的代码
摸清企业选址动机及需求,高效开展招商引资工作
【js 封装一个简单的异步API,获取异步操作结果和过程解析】
数学建模不会 LaTex 排版 | 教你如何在 Word 中优雅地使用漂亮的 LaTex 公式
Sword finger offer 54 The k-th node of binary search tree
Tableau JDBC connection graphdb
I2C通信协议编程实现
YOLOv5改进之二十:Involution新神经网络算子引入网络
开口就要20k的软件测试工程师需要掌握哪些技能?有这些技能我敢要更高~