I'm not sure if many of you might remember the old "The Invaders" TV series but I'm wondering if a similar disintergration effect can be given to my Alien Zombies a short period after they have been killed. Just an idea I had, don't know if I'll actually use it. It would depend on how cool the effect was plus I was thinking it would be a cool way to rid my landscape of many dead Alien Zombie bodies lying about ;)
I applied this script from the Wiki to my Zombie Alien Dead replacement:
// simple "dissolving" shader by genericuser (radware.wordpress.com)
// clips materials, using an image as guidance.
// use clouds or random noise as the slice guide for best results.
Shader "Custom Shaders/Dissolving" {
Properties {
_MainTex ("Texture (RGB)", 2D) = "white" {}
_SliceGuide ("Slice Guide (RGB)", 2D) = "white" {}
_SliceAmount ("Slice Amount", Range(0.0, 1.0)) = 0.5
}
SubShader {
Tags { "RenderType" = "Opaque" }
Cull Off
CGPROGRAM
//if you're not planning on using shadows, remove "addshadow" for better performance
#pragma surface surf Lambert addshadow
struct Input {
float2 uv_MainTex;
float2 uv_SliceGuide;
float _SliceAmount;
};
sampler2D _MainTex;
sampler2D _SliceGuide;
float _SliceAmount;
void surf (Input IN, inout SurfaceOutput o) {
clip(tex2D (_SliceGuide, IN.uv_SliceGuide).rgb - _SliceAmount);
o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;
}
ENDCG
}
Fallback "Diffuse"
}
But I get this error: Assets/Misc Scripts/ZombieAlienDisolve.js(6,9): UCE0001: ';' expected. Insert a semicolon at the end.
Why? is it because this is not java script or something...?? Has anyone tried this out and if so how do I use this on one of my Alien Zombies?
^ This is the simplest yet most effective way to do it in my opinion. And if the cloudiness isn't "disintegraty" enough, you can always up the noise level a lot, and you'll get a very sharp fuzzy disappearance. All sorts of effects can be done using fading alpha. For instance, an image that starts white on top and fades to black on bottom would make the textured object slowly disappear from top to bottom when faded.
– anon25104582I have no use for this right now, but I'm definitely filing it away as an awesome idea for later.
– anon23814272Hey flaviusxvii - would it be possible to share the shader you described in your answer please? What you describe is exactly what I need to do, but my knowledge of shaders is too limited at present!
– anon10904246