Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by spiceboy9994 · Oct 01, 2013 at 02:53 PM · shaderipadvertexshader

Vertex Shader is Opaque on iPad and iPadMini

Hi:

I have an issue with my Shader, I created this shader to make it work with the Decal System Pro Vertex color and animate this vertex color so I can do a decal to be animated as burnmark, so this shader allows to animate the glow image (which is a red one) to the main one, which is the burnmark. This works perfectly on the editor or even iPhone 4s and 5. But within my build on iPad Mini and iPad 2, the shader looks different. It looses the glow (or the light) on the iPad Devices... it looks opaque. Do you know what the problem could be?. I created this shader based on the Decal / Colored / Transparent Diffuse Colored one that is packed within the decal system pro Package. I would appreciate any advice on this one.

 Shader "Custom/VertexColorGlow" {
     Properties 
     {
         _DiffuseTransp("_DiffuseTransp", 2D) = "gray" {}
         _Glow("_Glow", 2D) = "black" {}
         _MainColor("_MainColor", Color) = (1,1,1,1)
         _VColor("_VColor", Color) = (1,1,1,1)
 
     }
     
     SubShader 
     {
         Tags
         {
             "Queue"="Transparent+2"
             "IgnoreProjector"="True"
             "RenderType"="Transparent"
         }
         Offset -1, -1
 
         CGPROGRAM
         #pragma surface surf Lambert alpha
         
         sampler2D _DiffuseTransp;
         sampler2D _Glow;
         float4 _VColor;
         float4 _MainColor;
         
         struct Input {
             float2 uv_DiffuseTransp;
             float2 uv_Glow;
             float4 color : COLOR;
         };
         
         void surf (Input IN, inout SurfaceOutput o) {
             o.Normal = float3(0.0,0.0,1.0);
             o.Alpha = 1.0;
             o.Albedo = 0.0;
             o.Emission = 0.0;
             o.Gloss = 0.0;
             o.Specular = 0.0;
                 
             float4 Tex2D0=tex2D(_DiffuseTransp,(IN.uv_DiffuseTransp.xyxy).xy) * _MainColor;
             float4 Tex2D1=tex2D(_Glow,(IN.uv_Glow.xyxy).xy);
             float4 Multiply0=Tex2D1 * _VColor * IN.color;
             float4 Master0_1_NoInput = float4(0,0,1,1);
             float4 Master0_3_NoInput = float4(0,0,0,0);
             float4 Master0_4_NoInput = float4(0,0,0,0);
             float4 Master0_7_NoInput = float4(0,0,0,0);
             float4 Master0_6_NoInput = float4(1,1,1,1);
             o.Albedo = Tex2D0;
             o.Emission = Multiply0;
             o.Alpha = Tex2D0.aaaa;
 
             o.Normal = normalize(o.Normal);
         }
 
 
         ENDCG
         Pass {
             ColorMaterial AmbientAndDiffuse
             Fog { Mode Off }
             Lighting On
             SeparateSpecular On
             SetTexture [_Glow] {
                 Combine texture * primary, texture * primary
             }
             SetTexture [_Glow] {
                 constantColor [_VColor]
                 Combine previous * constant DOUBLE, previous * constant
             }
         }
     }
 
 }
 
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Setting and storing vertex locations in a shader 0 Answers

Vertex shader does not receive vertex coordinates as I expected. Why? 2 Answers

Shader limits on iPad 1 Answer

Using Shaders in AssetBundles that weren't in the original app store build 1 Answer

Two pass shader works in editor but not in iPad? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges