We have been trying to get water and reflection working with Foveated Rendering and see some really large distortions (both in a camera based reflection approach and a screen space reflection approach). Right now I am shooting in the dark a bit with modifying settings to attempt to get this working - I was curious if there might be more information as to what is happening here? When I disable singlePassStereo in xcode via getSinglePass in UnityVisionOS, my left eye looks normal and the right eye looks closely like what the messed up reflection ends up looking like when this is enabled (mostly posting this as perhaps a clue…). Curious if there is more information on what exactly enabling foveated rendering does as far as the Unity graphics pipeline and when the foveation occurs, or what might be causing this.
Hey there! Sorry to hear you’re having trouble.
If changing the value of singlePass
has an effect, you might be missing the SPI macros on some of your shaders. If these are shaders provided by Unity, it’s still possible that we overlooked some of them and they’re missing these macros. What are you using to render the water? Is it a Unity-provided example/package or something from the Asset Store?
As always, it will be difficult to narrow down the issue without being able to reproduce it on my end. If you can share a project that demonstrates the issue, that would be ideal. Otherwise, if you point me at the tech you’re using, I might be able to track it down on my end.
All that we do is set isFoveationEnabled
to true in the compositor layer configuration, as you can see in UnityMain.swift
and pass along the MTLRasterizationRateMap we get from the CompositorServices API along to our RenderPassDescriptor. In some cases, shaders may need to be updated to support foveated rendering, but I’m not sure about the specifics there. I’m pretty sure SPI is the issue here, not foveation.
We were trying with two different assets as starting points -
and Stylized Water 2 | VFX Shaders | Unity Asset Store
Both work great without foveated rendering enabled and each are using slightly different approaches. I’d be happy to put together a minimal repro project if thats helpful as well.
For what its worth, the reflections appear to be distorted similarly how things were sometimes distorted prior to setting DepthTextureMode to AfterTransparents on the UniversalRendererData
It seems like basically the reflection render pass is getting this same sort of foveation / distortion and it shouldn’t. Something along these lines…
Hey there! I just wanted to let you know I was able to grab one of those asset store packages (Mirrors and reflections for VR) and replicate the issue. It does indeed look like this is rendering the reflections with foveation enabled, which results in the warping you are seeing. I wasn’t able to track down a solve, but it may need to be fixed in that package’s custom renderer code. I haven’t given up yet, though! I’ll let you know if I find a solution.
Thank you so much ! We haven’t either. I’ll keep you posted if we figure out anything on our side.
Were you able to figure this out?
Happens in Volumetric Fog & Mist 2 | Fullscreen & Camera Effects | Unity Asset Store
&
Volumetric Lights 2 | VFX Shaders | Unity Asset Store
I’m working with Kronnect to help them (& us ) figure it out as they are EU based and don’t have a device.
Hi there! Unfortunately I had to give up on this one for the time being.
It’s not clear to me whether or not we can fix this on the Unity side, or if those packages need to make some modifications to support foveated rendering. I’ll circle back on this when I have a chance to look again.
If anyone can lend a hand that would be awesome.
We have tried adding #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
and adjusted how we get our UVs but this did not seem to make a difference.
float2 GetFoveatedUV(float2 uv) {
#if defined(SUPPORTS_FOVEATED_RENDERING_NON_UNIFORM_RASTER)
UNITY_BRANCH if (_FOVEATED_RENDERING_NON_UNIFORM_RASTER)
{
uv = RemapFoveatedRenderingNonUniformToLinear(uv);
}
#endif
return uv;
}
This happens for a lot of depth based systems including Unity’s built in URP particles with soft blending enabled.
Note, that if foviated rendering is disabled, this no longer happens.
@Zach_AtTRIPP were you able to find a work around for this?
Unfortunately not, we ended up just doing a different approach for the time being for our water solution involving reflection probes.
I am having the exact same issues as well.