
任务:替换和实装美术素材 1.在教程场景布置图标和文字提示内容 DONE 2.制作GamePlay中背景元素的动画并实装 DONE 3.替换拆迁障碍物美术素材 DONE 任务:实装音乐和音效 1.为两个场景添加音乐,并且在GamePlay场景不重开音乐。 DONE 2.实装人摔地音效 DONE 3.实装人跑动音效 DONE 4.实装人马分离音效 DONE 5.实装创烂障碍物音效 DOING 6.实装圣火点燃音效 7.实装马磕磕碰碰音效 8.实装马似音效 9.实装马着地音效 10.实装马起跳音效 任务:实装特效 …… 任务:完善没写的零散逻辑 1.在教程场景,若人马分离障碍处没接到人,过一个转场然后复位人和马 **:仍然存在问题,当如此,人的动画失效。这个问题现在不好修,等待人的死亡动画实装后再修 WAIT 2.在教程场景,点燃圣火仅有进入触发器后加载转场然后转移场景的功能,没有点燃圣火的过程,现补充其逻辑 DONE 3.开发GamePlay距离记录和重开系统 …… 修复Bug 1.在教程场景,可破坏障碍物的碎片的层级不对,创烂瞬间会有层级突变的问题。在GamePlay层级,也出现了这个问题。 2.现在的高障碍实在太高了,基本有80%以上的概率导致马翻,应该调低障碍物、或者调大马的跳跃力度。
85 lines
2.2 KiB
HLSL
85 lines
2.2 KiB
HLSL
float2 UnpackUV(float uv)
|
|
{
|
|
float2 output;
|
|
output.x = floor(uv / 4096);
|
|
output.y = uv - 4096 * output.x;
|
|
|
|
return output * 0.001953125;
|
|
}
|
|
|
|
fixed4 GetColor(half d, fixed4 faceColor, fixed4 outlineColor, half outline, half softness)
|
|
{
|
|
half faceAlpha = 1-saturate((d - outline * 0.5 + softness * 0.5) / (1.0 + softness));
|
|
half outlineAlpha = saturate((d + outline * 0.5)) * sqrt(min(1.0, outline));
|
|
|
|
faceColor.rgb *= faceColor.a;
|
|
outlineColor.rgb *= outlineColor.a;
|
|
|
|
faceColor = lerp(faceColor, outlineColor, outlineAlpha);
|
|
|
|
faceColor *= faceAlpha;
|
|
|
|
return faceColor;
|
|
}
|
|
|
|
float3 GetSurfaceNormal(float4 h, float bias)
|
|
{
|
|
bool raisedBevel = step(1, fmod(_ShaderFlags, 2));
|
|
|
|
h += bias+_BevelOffset;
|
|
|
|
float bevelWidth = max(.01, _OutlineWidth+_BevelWidth);
|
|
|
|
// Track outline
|
|
h -= .5;
|
|
h /= bevelWidth;
|
|
h = saturate(h+.5);
|
|
|
|
if(raisedBevel) h = 1 - abs(h*2.0 - 1.0);
|
|
h = lerp(h, sin(h*3.141592/2.0), _BevelRoundness);
|
|
h = min(h, 1.0-_BevelClamp);
|
|
h *= _Bevel * bevelWidth * _GradientScale * -2.0;
|
|
|
|
float3 va = normalize(float3(1.0, 0.0, h.y - h.x));
|
|
float3 vb = normalize(float3(0.0, -1.0, h.w - h.z));
|
|
|
|
return cross(va, vb);
|
|
}
|
|
|
|
float3 GetSurfaceNormal(float2 uv, float bias, float3 delta)
|
|
{
|
|
// Read "height field"
|
|
float4 h = {tex2D(_MainTex, uv - delta.xz).a,
|
|
tex2D(_MainTex, uv + delta.xz).a,
|
|
tex2D(_MainTex, uv - delta.zy).a,
|
|
tex2D(_MainTex, uv + delta.zy).a};
|
|
|
|
return GetSurfaceNormal(h, bias);
|
|
}
|
|
|
|
float3 GetSpecular(float3 n, float3 l)
|
|
{
|
|
float spec = pow(max(0.0, dot(n, l)), _Reflectivity);
|
|
return _SpecularColor.rgb * spec * _SpecularPower;
|
|
}
|
|
|
|
float4 GetGlowColor(float d, float scale)
|
|
{
|
|
float glow = d - (_GlowOffset*_ScaleRatioB) * 0.5 * scale;
|
|
float t = lerp(_GlowInner, (_GlowOuter * _ScaleRatioB), step(0.0, glow)) * 0.5 * scale;
|
|
glow = saturate(abs(glow/(1.0 + t)));
|
|
glow = 1.0-pow(glow, _GlowPower);
|
|
glow *= sqrt(min(1.0, t)); // Fade off glow thinner than 1 screen pixel
|
|
return float4(_GlowColor.rgb, saturate(_GlowColor.a * glow * 2));
|
|
}
|
|
|
|
float4 BlendARGB(float4 overlying, float4 underlying)
|
|
{
|
|
overlying.rgb *= overlying.a;
|
|
underlying.rgb *= underlying.a;
|
|
float3 blended = overlying.rgb + ((1-overlying.a)*underlying.rgb);
|
|
float alpha = underlying.a + (1-underlying.a)*overlying.a;
|
|
return float4(blended, alpha);
|
|
}
|
|
|