Scene colour UV and World Displacement artifacts

Hi people!

I’ve been working on an ocean shader recently and I’m happy with the results so far except I’m getting a couple of artifacts that I’m wondering if anyone can help resolve.

I’m using a lerp between scene colour and ocean colour to simulate opacity, and distorting the scene UV’s to simulate refraction. This works great except I’m getting a fringe around submerged objects between the depth test and the distorted scene UV’s (see 1st screenshot). I understand why this is occurring I’m just not sure how to work around it.


My second issue is that World Displacement is pushing off-screen non-tessellated faces into view, causing a seam close to the camera between the tessellated and non-tessellated faces (see 2nd screenshot). Playing with the tessellation multiplier and a camera distance solution doesn’t seem to fix this, I thought I could fix it by forcing faces close to the camera to always be tessellated, or just try forcing max tessellation all the time to see if that would work. However I think this goes a bit deeper than that, as I imagine the faces out of view will not be considered for tessellation at all.

Any help with this will be much appreciated!

This screenshot better illustrates the tessellation issue.

Regarding first issue, the solution is simple. Do not use refraction. Or at least do not try to drive it with depth fade.
As for the second, you can use adaptive tess with max displacement. Setting max displacement right will ensure sufficient margin and no faces would disappear from view.

Thank you Deathrey for pointing out the max displacement! this fixed the tessellation issue.

The fringing was actually a simple fix as well, I just needed to distort the SceneDepth UV’s as well as the SceneColor UV’s to make sure they match up. A silly oversight on my part!