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 pyro · Dec 06, 2010 at 12:00 AM · lightingiphonecolorvertex

iPhone 3G Vertex Color and Lighting

I'm using a shader that has vertex coloring and when I tried turning on vertex lighting, it looks bright on iPhone 4 and 3GS but on the iPhone 3G it appears very dark.

Is this something that can be done on the iPhone 3G?

Here is the shader i'm using:

Shader "Vertex Color/Lighting" {

Properties { _MainTex ("Texture", 2D) = "" }

SubShader { Pass { Lighting On ColorMaterial AmbientAndDiffuse SetTexture [_MainTex] { Combine texture * primary DOUBLE } } } }

in script i'm setting the mesh vertex colors to 50% grey

Comment
Add comment · Show 2
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 Jessy · Dec 06, 2010 at 01:51 AM 0
Share

Post the shader. Unless you have Cg code that doesn't match ShaderLab results, I suspect it's because you have two ConstantColors defined, which will be broken on the old iOS GPU.

avatar image pyro · Dec 06, 2010 at 03:47 AM 0
Share

updated my question

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Jessy · Dec 06, 2010 at 04:31 AM

When you use ColorMaterial AmbientAndDiffuse on the MBXlite GPU, the Ambient Component is ignored and set to zero. I don't know if this is a limitation of the hardware, or a Unity bug, but I'm reporting it right now.

This is irritating to me, because work was specifically put into this area for Unity 3. (The end of this statement is just offensive to me. As if anyone can decide what is useful for you... >:-O ):

Removed ColorMaterial Ambient, Diffuse, Specular support (ColorMaterial AmbientAndDiffuse & Emission left). Support for the removed ones varied a lot depending on the platform causing confusion; and they didn't seem to be very useful anyway.

You'd think that the original iOS devices would still be an important ones to test, with all this, but apparently not. You're out of luck for now, if you actually need vertex coloring*. However, you say that you're scripting all the colors to be the same, so if that's all you're doing, you don't actually need vertex coloring. Let me know if you don't really need vertex coloring, and I'll write you a shader here if you need it.

*I can also write you a multi-pass vertex-colored shader if the ambient lighting is important enough to warrant it.

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 pyro · Dec 06, 2010 at 04:46 AM 0
Share

I was hoping that wasn't it, I was just trying some ways out of making objects flash certain colors, and work snappy on all iphone versions... and changing the vertex colors seemed like a good idea. I switched to just flipping the material color in a coroutine and it's giving an ok effect so it's not necessary. Thanks though!

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

No one has followed this question yet.

Related Questions

Lighting disparity using spotlights between editor and iDevices 0 Answers

Simple vertex color + light shader 1 Answer

How can I change the color of an object's material, not generate another instance of the material, and still keep batching? 2 Answers

High definition RP And Lightweight Ruined my whole project textures 0 Answers

Light Looks Weird 2 Answers


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