I am porting over a project on a different framework, with the desired effect looking like this:
http://s14.directupload.net/file/d/3079/bk3wr54e_jpg.htm
It’s just a 32x32 px picture with transparencies travling along a column model, creating a warp travel effect for a Sci Fi game.
Using the same assets in Unity I get:
http://s7.directupload.net/file/d/3079/eajtydfj_jpg.htm
The clouds, i.e. less transparent pixels, are blended together it seems. You can see some movement or let’s say color chance over time using a UV coordinate setoff via:
void Update () {
float dt = Time.deltaTime;
float doffset = offspeed * Time.time;
renderer.material.mainTextureOffset = new Vector2(doffset,0); }
The shader I use is:
Shader "EVShaders/UnlitTranspDiff" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader {
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 200
Blend SrcAlpha OneMinusSrcAlpha // SrcAlpha OneMinusSrcAlpha
Cull Off Lighting On ZWrite Off Fog { Color (0,0,0,0) }
CGPROGRAM
#pragma surface surf Lambert alpha
sampler2D _MainTex;
fixed4 _Color;
struct Input {
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o) {
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color;
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
Fallback "Transparent/VertexLit"
}
I assume that the transparency blend mode in the shader is the problem. But absolutely not being a shader dude and not planning on becoming one I just tried various combinations for the Blend variables and didn’t get any visible change - besides a pink solid color every now and then.
I vaguely remember having a similar look on early iterations using the other framework, an then doing something like TransparencyMode.MDUAL, .MBINARY or whatever and then it worked.
So I guess my questions is how to achieve my desired target look in Unity?
Thanks