0
Completed

refraction mobile

Braydon Budde 10 years ago updated by Freya Holmér (Developer) 10 years ago 10
Silly Question probably, but can the Refraction Shader work on mobile?
Just tried it with Forward Rendering, everything else rendered except for the Glass Refraction.
If it can be done, how so?

Also, I did search for this on the forum. (couldn't find the topic)

*Got Unity 4.5.4 Pro, but the refraction shader on there is quite Inferior to Shader Forges.

Answer

Answer
Completed
Glad it worked out!
Under review
Hm, it should work. Did you try making a minimal refraction shader? (Bare minimum to get it to work)
To be 100% honest, I'm just starting to learn about shaders etc...
I used the template Refraction example , and I wouldn't know where to start toning it down.
I can tell you that on mobile, it was just Black.
Maybe that gives some insight into what the problem is?
It could have been too expensive. Try plugging in a value of 0 into the alpha, and a normal map texture into refraction, then try it on mobile
Sorry to double post, but maybe the settings of the Gameobject need to be a specific way.
Are shadows supposed to be on or off etc...
Shouldn't matter, but, off, preferrably
I opened the Refraction shader, put Alpha to 0, and made the texture a normal map but still just getting a black block on mobile :( If you have any further advice, or maybe an example graph of how you would recommend for mobile, that would be really helpful.
Unfortunately I'm not sure what could be causing it. Try checking the SM2.0 option under the experimental category of the shader
Hey Joachim,

Tried what you suggested , still won't work unfortunately.
Would you mind posting a photo  graph of the simplest way a refraction can be implemented (Bare Minimum).
OK :) GOT IT WORKING!!!

I hadn't realized that my export settings for mobile had been set to fantastic, so the pixel light count was 4 amongst other performance killlers. Thanks again for the great support.
Will def refer this onto other developers.
Answer
Completed
Glad it worked out!