Hello. I cant figure out how the refraction works in HDRP 12 and shader graph.
Can’t seem to get any refraction to show. I only get some color effects on a surface, and the blur also works, but no actual refraction of the geometry. What do I need to do to make it work?
Most tutorials so far seem very old and outdated, so that didn’t help.
Thanks.
Edit: I should mention the model I’m applying this to is a big River or an ocean. The spherical refraction seems to be the only one that is doing something, even with standard lit material. I can only get the blur effect, but I need a water-like distortion.
If you are looking for a water refraction effect, what you are actually looking for is not refraction at all. You need to read from ScreenColor node with UVS adjusted by your normal texture. So your water will be actually opaque, and it will have the color of what is behind it, shifted so it looks refracted, multiplied by water color and plus some other water colors.
Fresnel based shift is also good, but keep in mind that too much shift gives away that it is actually a screen space effect, and there will be some slightly weird artifacts.
Hey thanks! Oh yes. But I guess refraction in HDRP transparent materisl is raytraced, isn’t it? Instead of just displacing UVs. That’s exactly what I’m working on. Doing it on my own because refraction using Box Model doesn’t do anything at all. For anyone interested, I opened another thread about box model not working in here .
And yes, it is using SceneColor node (not screen color) but the node version for HDRP: HDSceneColor (link to docs) and using the normals of the water to displace the UVs seen behind. There’s a good tutorial that you’ll have to adapt to HDRP here, and pass the normals of your water surface. In my case, in WaveMaker, I’ll have to use my own normals generated by hand.