- Home /
negative scale of texture doesnt work on mobiles
Hi,
After upgrading from unity 4.0 to 4.1 actually my current version is 4.1.2f1 pro version. Setting negative scale on texture with transparent ulit z ordered shader does not work anymore. After setting negative scale texture becomes like single color, each texture is different color probably inherited from some pixels in texture itself. setting -1, -1 to flip it in both directions. Setting only one of them to -1 does long stripes like if texture was set to 1, 0.1 or something. Setting negative -1,-1 on diffuse shader does work just fine however. So I assume the problem is somewhere in this particular shader on Unity 4.1+ and only on mobiles (iOs, Android) in editor it does what it should.
I'm not good in shaders ;o( can anyone please help me with correcting it so it works with negative scale as well. I need this shader because of video playing. It supports alpha and is Z Ordered because I have some other planes on top of video plane and non Z ordered shaders behave strange when camera moves.
thanks a lot
here the shader
// Unlit alpha-blended shader.
// - no lighting
// - no lightmap support
// - no per-material color
Shader "Unlit/TransparentZ" {
Properties {
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader {
cull off
Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
LOD 100
ZWrite On
Blend SrcAlpha OneMinusSrcAlpha
Pass {
Lighting Off
SetTexture [_MainTex] { combine texture }
}
}
}
Your answer
Follow this Question
Related Questions
why the colors are broken on my mobile phone? 1 Answer
Multiple materials or texture 1 Answer
Using shaders for text effects (TextMesh) 0 Answers
Mobile Shader with Albedo Color and Normal Map 0 Answers
Non scale texture? 1 Answer