Amatsu, попробовал написать что-то подобное.
Shader "Custom/BlastWaveShader" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Point ("Point", Vector) = (0,0,0,0)
_Radius ("Radius", Float) = 0.5
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert vertex:vert
sampler2D _MainTex;
float4 _Point;
float _Radius;
struct Input {
float2 uv_MainTex;
float4 color : COLOR;
};
void vert (inout appdata_full v) {
float3 pos = mul (_Object2World, v.vertex).xyz;
float3 center = mul (_Object2World, _Point).xyz;
float dis = length( pos - center );
if(dis > _Radius) dis = _Radius - (dis - _Radius);
dis /= _Radius;
dis = saturate(dis);
dis = pow(dis, 5);
v.color = float4(dis, 0, 0, 1);
v.vertex.y += dis*5;
}
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = c.rgb * IN.color.rgb;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
Только бы оптимизировать, избавится от if. И надо как-то сделать сглаживание волны. А то сейчас на вулкан похоже)
Если доделаешь, то покажешь.
Почему в Unity 4.2 не работает этот
https://www.assetstore.unity3d.com/#/content/8 пример?
Выдает ошибку You are trying to load data from a www stream which had the following error when downloading.
Couldn't open file /Projects/Unity Projects/Other Projects/Character Customization/Assets/Assets/assetbundles/CharacterElementDatabase.assetbundle.
И кстати, юнити, что не имеет своих инструментов для экспорта и импорта этих assetbundle?