升级6.4.升级水,升级天气

This commit is contained in:
2026-04-05 00:26:54 +08:00
parent 63bc9b5536
commit 5f7cbfb713
635 changed files with 34718 additions and 22567 deletions

View File

@@ -11,9 +11,7 @@
// These are per cascade, set per chunk instance.
CBUFFER_START(CrestChunkGeometryData)
float _Crest_ChunkMeshScaleAlpha;
float _Crest_ChunkMeshScaleAlphaSource;
float _Crest_ChunkGeometryGridWidth;
float _Crest_ChunkGeometryGridWidthSource;
CBUFFER_END
m_CrestNameSpace
@@ -93,6 +91,22 @@ void SnapAndTransitionVertLayout(in const float i_meshScaleAlpha, in const Casca
SnapAndTransitionVertLayout(UNITY_MATRIX_M, i_meshScaleAlpha, i_cascadeData0, i_geometryGridSize, io_worldPos, o_lodAlpha);
}
// Fix precision errors at edges.
void PatchVerticeLayout(const float2 i_ObjectPosition, const float2 i_CameraPosition, inout float2 io_PositionWS)
{
// Scale up by small "epsilon" to solve numerical issues. Expand slightly about tile center.
// :WaterGridPrecisionErrors
const float2 center = i_ObjectPosition;
const float2 camera = abs(i_CameraPosition);
// Scale "epsilon" by distance from zero. Gaps look bad from above surface, and
// overlaps look bad from below surface. We want to close gaps without introducing
// overlaps. A fixed "epsilon" will either not solve gaps at large distances or
// introduce too many overlaps at small distances. Even with scaling, there are
// still unsolvable overlaps underwater (especially at large distances). 100,000
// (0.00001) is the maximum position before Unity warns the user of precision issues.
io_PositionWS = lerp(center, io_PositionWS, lerp(1.0, 1.01, max(camera.x, camera.y) * 0.00001));
}
m_CrestNameSpaceEnd
#endif // CREST_WATER_VERT_HELPERS_H