Ocean has squiggly artifacts when tilting your head in VR
I was testing out the fix for the sky in VR - which seems fine - but noticed that the ocean has a strange artifact when I tilt my head. I'm not sure if this is new. I wouldn't be surprised if it's caused by the same kind of thing where some render targets are the wrong size.
That's a sampling artifact that happens without VR too. Increasing the mesh resolution usually fixes it.
Why does it only happen when the camera is tilted?
It's complicated to explain, it's because of the projected grid and how the derivatives are calculated in the vertex shader.
Is it kind of like diagonals on a height map? Would it be possible to rotate the mesh so that the vertices align better with the waves?
I'm not sure if that would fix it or not, but the mesh is screen-aligned as it is projected from the screen, so you cannot rotate it, look up "projected grid". Or really just use the wireframe mode in scatterer when you rotate the camera and you will get an idea of how it works.
Edited: The projected grid method is full of issues anyway (unpredictable sampling, displacement at the edge of the screen, breaks when camera is at the water level etc), I plan to replace it with a tesselated plane in the future to get around these issues (which will also fix the squiggly lines).
I’ll have to check that out. But I mean, rotate it along the plane normal. You can do this sometimes with shadow maps to reduce aliasing if you know most geometry is a particular orientation (e.g. vertical walls).
You could do that if you oversize the mesh to cover much more than the edges of the screen so that when it's rotated the screen is still covered.