- 丘陵.unity: 地形材质优化(增大tileSize), 添加枯草2种, 替换树木为杨树+阔叶树, 平滑平坦区域过渡, Splatmap用Perlin噪声平滑混合减少突兀边界, 调整减少黄色层次 - 丘陵注册到程序: AB打包, SAMap.txt, SQLite数据库(替换平原), 本地化XML, 8192x8192地图图片(含绿色起点区域) - 海岛/沙漠/山地: PermissibleArea MeshRenderer统一禁用, 移除临时砾石道路层 - 山地/海岛/沙漠: 地形材质参数调整
59 lines
1.5 KiB
GLSL
59 lines
1.5 KiB
GLSL
Shader "Hidden/PostProcessing/Debug/Waveform"
|
|
{
|
|
HLSLINCLUDE
|
|
|
|
#pragma exclude_renderers gles gles3 d3d11_9x
|
|
#pragma target 4.5
|
|
#include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl"
|
|
|
|
StructuredBuffer<uint4> _WaveformBuffer;
|
|
float3 _Params; // x: buffer width, y: buffer height, z: exposure, w: unused
|
|
|
|
float3 Tonemap(float3 x, float exposure)
|
|
{
|
|
const float a = 6.2;
|
|
const float b = 0.5;
|
|
const float c = 1.7;
|
|
const float d = 0.06;
|
|
x *= exposure;
|
|
x = max((0.0).xxx, x - (0.004).xxx);
|
|
x = (x * (a * x + b)) / (x * (a * x + c) + d);
|
|
return x * x;
|
|
}
|
|
|
|
float4 Frag(VaryingsDefault i) : SV_Target
|
|
{
|
|
const float3 red = float3(1.4, 0.03, 0.02);
|
|
const float3 green = float3(0.02, 1.1, 0.05);
|
|
const float3 blue = float3(0.0, 0.25, 1.5);
|
|
float3 color = float3(0.0, 0.0, 0.0);
|
|
|
|
uint2 uvI = i.vertex.xy;
|
|
float3 w = _WaveformBuffer[uvI.x * _Params.y + uvI.y].xyz;
|
|
|
|
color += red * w.r;
|
|
color += green * w.g;
|
|
color += blue * w.b;
|
|
color = Tonemap(color, _Params.z);
|
|
|
|
return float4(saturate(color), 1.0);
|
|
}
|
|
|
|
ENDHLSL
|
|
|
|
SubShader
|
|
{
|
|
Cull Off ZWrite Off ZTest Always
|
|
|
|
Pass
|
|
{
|
|
HLSLPROGRAM
|
|
|
|
#pragma vertex VertDefault
|
|
#pragma fragment Frag
|
|
|
|
ENDHLSL
|
|
}
|
|
}
|
|
}
|