Glass-Stained-BumpDistort.shader for OpenGL?

Unfortunally the Glass-Stained-BumpDistort.shader of the standard pro package wont work with OpenGL and my Mac. Does anybody knows an alternate shader? It looks so great and I discovered to late that I can not use it with the Mac. :frowning:

Thanks!

The shader works fine on our Macs. Perhaps explain the problem in more detail.

The problem is that the plane what uses the shader is not displaying the desired effect, just the main texture without lightning. Please see the attached files for a comparsion of the mac and win version.
I guess it is because the shader got the following lines in it:

// Upgrade NOTE: excluded shader from OpenGL ES 2.0 because it does not contain a surface program or both vertex and fragment programs.
#pragma exclude_renderers gles

It wont compile on my mac, I attached the error screen. I have no shader experience, simply removing these lines wont help.

My mac is the latest mac mini, so the graphic processor is no problem.



483602--16976--$mac2.PNG

Mmhh, I removed the ATI 9000 stuff in the shader and it compiles fine on my mac. However => still not working.

The OpenGL ES 2.0 thing only affects iOS. Can you post the shader in its current state?

Try this one, its same glass shader but using surface shaders, and also has normal mapping, specularity and alpha.
To use alpha, offcourse you have to change the line “#pragma surface surf BlinnPhong” as “#pragma surface surf BlinnPhong alpha”

Shader "Test" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1)
_Shininess ("Shininess", Range (0.03, 1)) = 0.3
_MainTex ("Base (RGB)", 2D) = "white" {}
_BumpMap ("Normalmap", 2D) = "bump" {}
_DistAmt ("Distortion", range (0,128)) = 10
}
SubShader {
GrabPass { }

Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Opaque" }
LOD 200

CGPROGRAM
#pragma exclude_renderers gles
#pragma vertex vert
#pragma surface surf BlinnPhong
#include "UnityCG.cginc"

float4 _Color;
float _Shininess;
sampler2D _MainTex;
sampler2D _BumpMap;
sampler2D _GrabTexture;
float _DistAmt;
float4 _GrabTexture_TexelSize;

struct Input {
float2 uv_MainTex;
float2 uv_BumpMap;
float4 proj : TEXCOORD;
};

void vert (inout appdata_full v, out Input o) {
float4 oPos = mul(UNITY_MATRIX_MVP, v.vertex);
#if UNITY_UV_STARTS_AT_TOP
float scale = -1.0;
#else
float scale = 1.0;
#endif
o.proj.xy = (float2(oPos.x, oPos.y*scale) + oPos.w) * 0.5;
o.proj.zw = oPos.zw;
}

void surf (Input IN, inout SurfaceOutput o) {
half4 nor = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));

float2 offset = nor * _DistAmt * _GrabTexture_TexelSize.xy;
IN.proj.xy = offset * IN.proj.z + IN.proj.xy;
half4 col = tex2Dproj( _GrabTexture, UNITY_PROJ_COORD(IN.proj));

half4 tex = tex2D(_MainTex, IN.uv_MainTex);
o.Albedo = tex.rgb * _Color.rgb * col.rgb;
o.Normal = nor.rgb;
o.Specular = _Shininess;
o.Gloss = tex.a;
o.Alpha = tex.a * _Color.a;
}
ENDCG
}
FallBack "Diffuse"
}