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
1
Question by Immortalis94 · Jun 08, 2018 at 01:37 PM · androidshadersmobile

Is this surface shader too heavy for mobile?

I am having problems with thermal throttling on my Samsung S8+ (It is tt for sure cause when i cool the device i don't have fps drop). I am using Beautify PP and default anti-aliasing. Rendering of the scene takes between 70-80 draw-calls where :
- 1 Clear
- ~50 Scene objects
- 12 UI
- 15 Post-Processing
- 1 AA
I am using bellow shader on every object except on shadow plane where i use unlit-transparent and glass transparent surface shader(I have 1 shadowplane with texture and 2 planes for glass). No shadows in the scene and only 1 directional light. I baked shadows and put it on a plane as a texture.
Scene has 27k triangles in total (38k verts), using 3 instances of the mentioned shader 1 for the floor, 1 for the bottom part of the box and 1 for the top part. Scene is rendered in 1080p resolution. Instancing is enabled and all materials use 2048 textures. I hope someone can help :)

 Shader "Custom/Mobile/DoubleSurface Bump" {
     Properties {
         _CombTex ("SurfaceMask(R) Occlusion(G) Map", 2D) = "white" {}
         _BumpMap ("Normal Map", 2D) = "bump" {}
 
         _AlbedoColor1 ("Color 1", Color) = (1, 1, 1, 1)
         _Metallic1 ("Metallic", Range(0,1)) = 0.0
         _Glossiness1 ("Smoothness", Range(0,1)) = 0.5
         _AlbedoColor2 ("Color 2", Color) = (1, 1, 1, 1)
         _Metallic2 ("Metallic", Range(0,1)) = 0.0
         _Glossiness2 ("Smoothness", Range(0,1)) = 0.5
         _OcclusionStrength ("Occlusion Strength", Range(0, 1)) = 1
         _OcclusionMultiplier ("Occlusion Multiplier", Range(0, 1)) = 1
     }
     SubShader {
         Tags { "RenderType"="Opaque" }
         LOD 200
 
         CGPROGRAM
         #pragma surface surf Standard noshadow noforwardadd noambient interpolateview
         #pragma target 3.0
 
         sampler2D _CombTex;
         sampler2D _BumpMap;
 
         struct Input {
             float2 uv_CombTex;
             float2 uv_BumpMap;
         };
 
         fixed4 _AlbedoColor1;
         half _Metallic1;
         half _Glossiness1;
         fixed4 _AlbedoColor2;
         half _Metallic2;
         half _Glossiness2;
         half _OcclusionStrength;
         half _OcclusionMultiplier;
 
         void surf (Input IN, inout SurfaceOutputStandard o) {
             // Evaluating maps
             fixed4 comb = tex2D (_CombTex, IN.uv_CombTex);
             fixed3 normals = UnpackNormal(tex2D (_BumpMap, IN.uv_BumpMap));
 
             // Occlusion calculation
             half occlusion = pow (comb.g, _OcclusionStrength) * _OcclusionMultiplier;
             half difference = 1 - comb.r;
             
             o.Albedo = _AlbedoColor1 * comb.r + _AlbedoColor2 * difference;
             o.Metallic = _Metallic1 * comb.r + _Metallic2 * difference;
             o.Smoothness = _Glossiness1 * comb.r + _Glossiness2 * difference;
             o.Normal = normals;
             o.Occlusion = occlusion;
             o.Alpha = comb.a;
         }
         ENDCG
     }
     FallBack "Diffuse"
 }

I made it this way cause all my objects r made from like 2 types of material, lets say matte black and gold so i use 1 texture for that, better than using 1 for albedo and other for metallness, occlusion etc.

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

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

Android Crash on UpdateComputeBuffers in libunity.so 0 Answers

My shader works on desktop, but black screen on Android. 0 Answers

Foliage shader makes objects invisible on Android Build 0 Answers

Mobile shader vs standard shader 0 Answers

RWTexture2D in Compute Shader on Android? 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