Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 achimmihca · Jan 14, 2017 at 02:41 PM · androidmobilenot workingpoint lightvertexlit

No vertex lighting on Android tablet (Unity bug?)

alt text

How can this be? I think every Android 4 device will support Vertex Lighting, right?

In a new project with a new scene I added some objects and a point light. The shader is set to Mobile/VertexLit. Only exception is the cylinder. It uses the standard shader.

Thing is: on my Android tablet (Android 4), the lighting does not work. But on my Android phone, it works well.

Used shader is Mobile/VertexLit that ships with Unity.

I found this thread: https://forum.unity3d.com/threads/black-textures-on-some-devices-android-versions.195328/ But none of the solutions worked for me.

Is there some user made shader I could use? I need vertex colors and lighting from a point light. For mobile devices.

screenshot.png (71.8 kB)
Comment
Add comment · Show 1
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 achimmihca · Jan 15, 2017 at 11:17 AM 0
Share

FYI: the tablet is a Galaxy Tab 3 Lite.

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by AurimasBlazulionis · Jan 15, 2017 at 12:31 PM

Better use regular standard shader and use Shader.globalMaximumLOD = 150 inside some script to get vertex-lit shading. Otherwise I do not know any other solution.

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 achimmihca · Jan 15, 2017 at 01:56 PM 0
Share

Setting this variable did not show vertex colors for me when using the standard shader

avatar image
0

Answer by achimmihca · Jan 15, 2017 at 02:03 PM

I now wrote a simple surface shader that considers vertex colors. This works for me, because the point light is calculated on pixel level and the color is added using vertex colors.

BUT: Using this shader Dynamic Batching does not work anymore. It also does not work when I use the Standard shader. Only with Mobile/VertexLit. And because Batching is the only reason I started with vertex color stuff, this is not really a solution for me.

So in addition to my first question: Why does Dynamic Batching not work with this shader?

 Shader "Custom/LambertVertexColors" {
     Properties {
         _MainTex ("Albedo (RGB)", 2D) = "white" {}
     }
     SubShader {
         Tags { "RenderType" = "Opaque" }
         CGPROGRAM
         #pragma surface surf Lambert vertex:vert
         struct Input {
             float2 uv_MainTex;
             float3 customColor;
         };
         void vert (inout appdata_full v, out Input o) {
             UNITY_INITIALIZE_OUTPUT(Input,o);
             o.customColor = v.color;
         }
         sampler2D _MainTex;
         void surf (Input IN, inout SurfaceOutput o) {
             o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;
             o.Albedo *= IN.customColor;
         }
         ENDCG
     }
 }
Comment
Add comment · Show 2 · 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 achimmihca · Jan 15, 2017 at 05:25 PM 0
Share

I think the problem is that one needs a shader with a single pass to have Dynamic Batching. It seems the above shader and the standard shader do not meet this requirement. Does anyone know a shader, which calculates a point light in a single pass and also considers vertex colors?

avatar image achimmihca · Mar 19, 2017 at 08:07 PM 0
Share

Dynamic Batching does work with the option noforwardadd in #pragma. I just had a look at the default $$anonymous$$obile/Diffuse shader and found this option. When adding this, dynamic batching works again, so I now have (a) one per-pixel point light, (b) vertex colors, (c) dynamic batching. $$anonymous$$y batches dropped from 130 to 40. Everything's peachy!

avatar image
0

Answer by dputros · Oct 02, 2017 at 08:02 AM

Actually, @achimmihca, this IS a unity bug with Vertex-lit combination with Spot light on some Android GPUs.

https://issuetracker.unity3d.com/issues/android-objects-with-mobile-vertex-lit-shader-ignore-point-light-and-spot-light-when-built-on-a-device-with-adreno-418-gpu

This issue seems to have started with version 5.3 so it's been there for a while. Maybe it's worth upvoting this issue in the link above so unity can get it fixed.

Comment
Add comment · 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

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

111 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 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 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 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 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 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 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 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

Objects disappear after nuilding to android 1 Answer

Android GUI.DrawTexture not working 0 Answers

[Solved]Android build black screen 0 Answers

Manually configure light bounds? / Optimising lighting for dynamic batching 0 Answers

Touch Controls for mobile 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