- Home /
Blit material run in editor but fail in build
Hello, i'm trying to use a Shader with Blit method to apply it on a plane and i have problems with that.
The shader to apply is the sample shader:
Shader "Tribungo/SolidColor" { SubShader { Pass { ZTest Always Cull Off ZWrite Off Blend Off //Cull Off ZWrite Off Lighting Off Fog { Mode off }
CGPROGRAM #pragma vertex vert #pragma fragment frag float4 vert(float4 v:POSITION) : SV_POSITION { return mul (UNITY_MATRIX_MVP, v); } fixed4 frag() : COLOR { return fixed4(1.0,0.0,0.0,1.0); } ENDCG } } }
My plane gameObject have material Diffuse (no more).
My plane have a C# code like this:
void Start () { _rt = new RenderTexture (_cacheTexture.width, _cacheTexture.height, 32, RenderTextureFormat.ARGB32); _material = new Material (_shader); Graphics.Blit (_cacheTexture, _rt, _material); renderer.material.mainTexture = _rt; }
_shader have Tribungo/SolidColor shader and _cacheTexture have some texture.
In editor all works fine, but in PC-Build all works bad.
Some idea please, is very urgent.
The build is for PC - Windows 8.
In Editor OK
PC - Build BAD