0

When I tried building my works from unity to phone, the shining effect only working on editor but not on the build?

How can I resolve this one? I've heard about compilation of shaders but it confuse me more.

Tengku Fathullah
  • 1,279
  • 1
  • 18
  • 43
ky-chan
  • 101
  • 1

1 Answers1

0

Preamble

What you've heard is irrelevant in Unity's world. Unity takes care of compiling shaders by itself.

Solving the problem

First thing to do is to switch Unity's platform to either iOS, Android, Blackberry, Windows Phone or whatever:

File → Build Settings... → Choose your mobile platform → Click "Switch Platform" button.

Then you need to turn on graphics emulation:

Edit → Graphics Emulation → OpenGL ES

While this is not a 100% accurate emulation, it will help you to catch some problems. For the rest read what Xcode output tells you.

Community
  • 1
  • 1
Sergey Krusch
  • 1,928
  • 16
  • 17
  • I already do this one but nothing happened. The one that I applied on shader will just gone to pink instead of the shine effect. Do I need to add Shader in AssetBundle? – ky-chan Jun 24 '14 at 20:04
  • You already do what? Does Xcode output tell you something about shaders? – Sergey Krusch Jun 24 '14 at 21:47
  • I tried the solution you gave about in unity and run through x-code. But it will give NullException for Google Ads instead and can't continue to the game. I need to fix maybe this one first before I can continue to build in Xcode. How about if I will try to build in Android? can it give me an error after I build in Android platform? – ky-chan Jun 25 '14 at 13:27
  • If your app is not working at all, how can you tell that your shader is not working? – Sergey Krusch Jun 25 '14 at 17:31
  • I build it on Android device and also in iPad(which is a failure). but in Android, I put the shader on my win prefab and I have ShineShader. In Unity its perfectly fine but when I build in Android device it the shader that I add on the sprite will become pink. I dont know why. Is there any additional script that I will add in order for it to work in Android devices? Sorry taking your time and thank you for your reply. – ky-chan Jun 25 '14 at 19:21
  • If it becomes pink it means that the problem is in the shader. Xcode should tell you something about it. But to tell you the truth, from what I see in your comments, I doubt that you are able to fix it. Thus, I would recommend you to include your shader code here so that me or someone else can help you with it. – Sergey Krusch Jun 26 '14 at 11:06
  • Sorry for the late reply. Yeah. Its just dumb of me. I forgot to instantiate it. I successfully run after instantiate it to my Shader class and apply it to the Sprite. Thank you very much for your concern. – ky-chan Jul 02 '14 at 15:47