unity3d - How to make Unity glass shader only refract objects behind it? -
i looking glass shader unity refracts objects behind it, or ideas how modify existing glass shader that. this screenshot shows happens when use fx/glass/stained bumpdistort on curved plane mesh. as can see, glass shader refracts both sphere in front of mesh , ground behind it. looking shader refract objects behind it. here code shader, reference: // per pixel bumped refraction. // uses normal map distort image behind, , // additional texture tint color. shader "fx/glass/stained bumpdistort" { properties { _bumpamt ("distortion", range (0,128)) = 10 _maintex ("tint color (rgb)", 2d) = "white" {} _bumpmap ("normalmap", 2d) = "bump" {} } category { // must transparent, other objects drawn before one. tags { "queue"="transparent" "rendertype"="opaque" } subshader { // pass grabs screen behind object texture. // can access result ...