mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Reuse normal offset calculation for nodes
This commit is contained in:
parent
4801bdf45a
commit
b651bbf446
2 changed files with 16 additions and 5 deletions
|
@ -74,8 +74,7 @@ vec3 getLightSpacePosition()
|
|||
#if DRAW_TYPE == NDT_PLANTLIKE
|
||||
pLightSpace = m_ShadowViewProj * vec4(worldPosition, 1.0);
|
||||
#else
|
||||
float offsetScale = (0.0057 * getLinearDepth() + normalOffsetScale);
|
||||
pLightSpace = m_ShadowViewProj * vec4(worldPosition + offsetScale * normalize(vNormal), 1.0);
|
||||
pLightSpace = m_ShadowViewProj * vec4(worldPosition + normalOffsetScale * normalize(vNormal), 1.0);
|
||||
#endif
|
||||
pLightSpace = getPerspectiveFactor(pLightSpace);
|
||||
return pLightSpace.xyz * 0.5 + 0.5;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue