Fast glass shader that doesn't require any RayTracing or RayMarching.
It's not 100% accurate but it's probably the best possible thing we can do with what we have.
If you find it usefull and want to help me maintain it, please consider supporting :
- URP Only
- Unity 6+ (other versions support will be added later)
First, start by adding the "BackFaceNormalsTexture" feature then choosing the layermask for glass objects.

Next make a material from shader "Glass Double Face" or "Glass Single Face" (single face is better for spherical objects)

Some parameters there are kinda strange so I explained them in the "Performance/Tech Details" section.
The number of texture samples we do here is very low so it's probably fast enougth to be used in mobile or VR (didn't tested).
The only expensive part here is rendering the back face texture since we are re-rendering the objects again but it's not really that much (unless all the objects in your game are glass then that will double the cost of your geometry).
The back face ray split is done througth : first refracting the ray on the front face, projecting the point into screen space, then reading the corresponding back normal from the texture to refract again and project again.
You can't project the ray after the first refraction directly without knowing how much the ray will travel througth the object (which cant be done without ray tracing) so as an approximation we consider the thickness of the object at that point as the length that the ray will travel.
The thickness is computed from the substracting the depth of the back faces from the depth of front faces.
The error from this assumption can be quiet high some time but there is no other choice (I believe) also the maximum possible diviation of the refracted ray in glass is 42degree so it will no be a big problem in most cases.
One other parameter in the material is the "UseConstantThickness" which simply replaces the depth based thickness with a constant value, it can look better in some objects.
For the second refraction (which is assumed to be exiting the object) we simply take an arbitrary value "Refraction Distance" of how far the ray will go after exiting the object then we reproject the position to screen space.
The final assumption we can use here is that most people don't knows how glass is supposed to look like so why caring that much about accuracy :)
firstIntersection = positionWS + frontFaceRefractedRay * Thickness;
backNormal = sampleBackNormalsTexture(project(firstIntersection));
backFaceRefractedRay = refract(frontFaceRefractedRay, backNormal);
secondIntersection = firstIntersection + backFaceRefractedRay * Refraction Distance (arbitrary value)