- 丘陵.unity: 地形材质优化(增大tileSize), 添加枯草2种, 替换树木为杨树+阔叶树, 平滑平坦区域过渡, Splatmap用Perlin噪声平滑混合减少突兀边界, 调整减少黄色层次 - 丘陵注册到程序: AB打包, SAMap.txt, SQLite数据库(替换平原), 本地化XML, 8192x8192地图图片(含绿色起点区域) - 海岛/沙漠/山地: PermissibleArea MeshRenderer统一禁用, 移除临时砾石道路层 - 山地/海岛/沙漠: 地形材质参数调整
51 lines
1.2 KiB
Plaintext
51 lines
1.2 KiB
Plaintext
#pragma warning(disable : 3568)
|
|
#pragma exclude_renderers gles gles3 d3d11_9x
|
|
|
|
#include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl"
|
|
|
|
#pragma kernel KTexture3DLerp
|
|
#pragma kernel KTexture3DLerpToColor
|
|
|
|
RWTexture3D<float4> _Output;
|
|
|
|
CBUFFER_START(Params)
|
|
float4 _DimensionsAndLerp; // xyz: surface dimensions, w: lerp factor
|
|
float4 _TargetColor; // Color to lerp into
|
|
CBUFFER_END
|
|
|
|
Texture3D _From;
|
|
Texture3D _To;
|
|
|
|
#define GROUP_SIZE 4
|
|
|
|
#ifdef DISABLE_COMPUTE_SHADERS
|
|
|
|
TRIVIAL_COMPUTE_KERNEL(KTexture3DLerp)
|
|
TRIVIAL_COMPUTE_KERNEL(KTexture3DLerpToColor)
|
|
|
|
#else
|
|
|
|
[numthreads(GROUP_SIZE, GROUP_SIZE, GROUP_SIZE)]
|
|
void KTexture3DLerp(uint3 id : SV_DispatchThreadID)
|
|
{
|
|
if(all(float3(id) < _DimensionsAndLerp.xyz))
|
|
{
|
|
float4 from = _From[id];
|
|
float4 to = _To[id];
|
|
_Output[id] = lerp(from, to, _DimensionsAndLerp.wwww);
|
|
}
|
|
}
|
|
|
|
[numthreads(GROUP_SIZE, GROUP_SIZE, GROUP_SIZE)]
|
|
void KTexture3DLerpToColor(uint3 id : SV_DispatchThreadID)
|
|
{
|
|
if(all(float3(id) < _DimensionsAndLerp.xyz))
|
|
{
|
|
float4 from = _From[id];
|
|
float4 to = _TargetColor;
|
|
_Output[id] = lerp(from, to, _DimensionsAndLerp.wwww);
|
|
}
|
|
}
|
|
|
|
#endif // DISABLE_COMPUTE_SHADERS
|