Hi, I have a refractive material and since the refraction only happens on opaque objects, I would like to hide any transparent materials behind the refractive one. Otherwise, it would look odd. I’ve seen that the SingleLayerWater material does this effect, is there a way to do it on a regular material with e.g. a checkbox? Thanks for the help!
you can’t. tested it real quick in 5.7 in my low end setup. apparently only additive shading supports refraction in that version. the translucent pass is still rendered and comped later i guess. and it’s very glitchy with occluding objects. a thing you could try is to render your refractive object as a custom depth and stencil pass with no visual output and do the screen space refraction in the post process. that should refract even translucent objects. you can’t have occlusion in front of it tho.
the only other way i know to control this is using raytracing. it supports refraction and bouncing thru glass.
You can actually do this. The way SLW works is that it renders the SLW surfaces in as opaque in a separate pass and samples Scene Color to look “translucent”. Scene Color does not contain translucency so anything behind the water plane will not be shown. You can do this with a translucent surface because they are also rendered in a separate pass, by setting the opacity to 1 and plugging scene color into the Emissive Output of the material, using lerp to blend in whatever else you want. The disadvantage this has over SLW is that translucency is rendered in a separate pass, but not as opaque, so it will be vulnerable to sorting artifacts.
You shouldn’t do that though because your problem has a much simpler solution which is to change the Translucency Pass in the material to Before DOF. If you do that then translucency will be affected by refraction.
Thanks a lot! I wouldn’t have thought the solution would be that simple ![]()