• 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
Question by chearner · Nov 15, 2010 at 04:22 AM · shaderiphone

iPhone shader help to simulate TV static, works but not on iPhone.

Can someone with shader knowledge take a look at this and tell me why it doesnt work on the iPhone. It was taken from the Wiki, and works in the editor using ES 2.0 graphics emulation, but no other emulation. When I build it to the iPhone device it doesn't run either.

I'm not sure what to look for or tweak in order to begin making it work on lower emulation settings or if it can be done at all. Thanks. You can also find the original code here, it doesnt seem to format correctly below...

Shader "FX/Hyperbolic Static" {

Properties { _Color ("Color Tint", Color) = (1,1,1,1) _Rate ("Oscillation Rate", Range (1, 500)) = 300 }

SubShader {

ZWrite Off Tags { "Queue" = "Transparent" } Blend One One

Pass {

CGPROGRAM

pragma vertex vert

pragma fragment frag

pragma fragmentoption ARB_fog_exp2

include "UnityCG.cginc"

float4 _Color; float _Rate;

struct v2f { float4 pos : SV_POSITION; float4 texcoord : TEXCOORD0; };

v2f vert (appdata_base v) { v2f o; o.pos = mul (UNITY_MATRIX_MVP, v.vertex); o.texcoord = v.texcoord; return o; }

half4 frag (v2f i) : COLOR { float3 color; float m; m = _Time[0] _Rate + ((i.texcoord[0]+i.texcoord1) 5000000 _Color.a _Color.a); m = sin(m) 0.5; color = float3(m _Color.r, m _Color.g, m _Color.b); return half4( color, 1 ); } ENDCG

}

} Fallback "Transparent/Diffuse" }

Comment

People who like this

0 Show 0
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

Answer by Jessy · Nov 15, 2010 at 05:05 AM

That shader only works with a programmable GPU. Old iOS devices don't have that, and newer ones require that you're using OpenGLES 2.0. You had the right idea with what you need in your other question, but this site is pitifully unequipped for us to help you with that; it's very text-based around here, and you need annotated screenshots and a .unitypackage. Ask on the forum and provide us with a .unitypackage to build off of, and I'll answer the question, with a link back to the forum.

Comment
cregox

People who like this

1 Show 4 · 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 chearner · Nov 18, 2010 at 01:43 AM 0
Share

Regarding OpenGLES 2.0...is that only available on the iPhone 4? I see it's an option to Target Platform Arm6+7 (1.2+2.0) but not a 2.0 only. Is the current iPad OpenGLES2.0 or 1.2?

avatar image Jessy · Dec 20, 2010 at 08:45 AM 0
Share

The 3GS was the first 2.0 device. Everything iOS device since then has used the same GPU, other than the cheapest iPod touch model from 2009, which is not compatible with programmable shaders.

avatar image noradninja · Dec 20, 2010 at 03:28 PM 0
Share

Regarding this...how can I force a build to use OpenGLES 2.0? I need to test a shader made with Strumpy's Shader Editor.

avatar image cregox · Apr 10, 2012 at 08:16 PM 0
Share

Ah, I see now a good usage for the forums... Attaching .unitypackages. Jessy, would you happen to know why can't we have something like the way images currently work and host it on answers itself?

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

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Glow and Bloom Effects on iPhone 3 Answers

Weird iPad render bug 0 Answers

Glow & other post processing - iPhone / OpenGL ES1.1 and ES2.0 performance / work arounds? 1 Answer

Problems with depth buffer only pass on iPhone 8/8+ 0 Answers

Vertex colour shader with emissive multiplier 0 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