• 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 Saranit · Jan 11, 2012 at 10:37 AM · androidiosmobilevertex color

vertex panit shader support for android/ios ?

hi everyone,

i work with vertex paint(RGB) and blend by alpha channel so this is shader code that i use

 Shader "RGB Vertexcolor Blend by Vertex Alpha"
 {
     Properties 
     {
         _MainTex ("Texture 1  (vertex A  = red)", 2D) = ""
         _Texture2 ("Texture 2  (vertex A = green)", 2D) = ""
         _Texture3 ("Texture 2  (vertex A = blue)", 2D) = ""
     }
     
     SubShader 
     {
         BindChannels
         {
             Bind "vertex", vertex
             Bind "color", color
             Bind "texcoord", texcoord
         }
         Pass 
         {
             SetTexture [_MainTex]
             SetTexture [_Texture2] {combine previous lerp(primary) texture}
             SetTexture [_Texture3] {combine previous lerp(primary) texture}
         }
     }
 }

it's work well in unity but when i try to plublic on android, some object that use this shader is missing they didn't show correctly texture as i see in unity. i wonder how it's happen? or android/ios not support for vertex paint? any idea? pls help.

thk for share :)

ps. i test on android 2.3.4 with sony ericsson xperia neo-v (cpu 1g hz, ram512 single core)

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

1 Reply

· Add your reply
  • Sort: 
avatar image
2

Answer by SummerLynx · May 25, 2012 at 07:34 PM

Maybe it's a bit too late, but i'll try to answer for anyone there having trouble)

Try to bind texcoord for each SetTexture. Like this:

BindChannels

{

 Bind "vertex", vertex
 Bind "color", color
 Bind "texcoord", texcoord0
 Bind "texcoord", texcoord1
 Bind "texcoord", texcoord2

}

Worked for me with ICS. But with Gingerbread i'm getting trouble with that. If that does'nt work, try to split your shader in different passes.

Also, check this nice tutorial about ShaderLab: http://www.youtube.com/playlist?list=PL31F6A116DCCC9F61&feature=plcp

Comment
Add comment · Show 1 · Share
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
avatar image Bunny83 · May 25, 2012 at 07:49 PM 0
Share

It's never too late to answer a question and this one is even from this year :D We have much older questions. This should be a knowledge database so even when the OP never comes back, it should help others with the same problem.

Unfortunately we have way much more people asking question than people answering them. So everyone with knowledge is always welcome ;)

I'm not that familiar with Android, but i guess the problem is that the hardware don't have 3 texture units so i think using 3 passes would fix it. Of course 3 passes means performance loss, but hey, it's a smartphone, not a gaming PC ;)

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Is it possible to send SMS from an action in Unity? (Mobile iOS or Android) 1 Answer

Native list views on Mobile? 0 Answers

Mobile Game Different Screen Size Issue 2 Answers

Unity 5 mobile single stick control 6 Answers

Is GameObject.FindWithTag Bad for Mobile Platforming? 1 Answer

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges