We’re busy working on an update for the Unity docs that will describe the issues with upgrading Image Effects to support Single-Pass Stereo.
Single-Pass Stereo is currently only supported for DX11 on Windows and PS4 not for GearVR.
The UnityStereoScreenSpaceUVAdjust() macro will compile out to just passing the UV through in non Single-Pass Stereo modes where as TRANSFORM_TEX will do a very similar thing but will always apply the transform (even if the transform itself doesn’t effect the result as it’s an identity one) thus possibly costing some shader cycles in the non Single-Pass Stereo case if for example you are sharing the same shader between GearVR and desktop VR then GearVR would be wasting extra cycles if you used TRANSFORM_TEX when it was just required for Single-Pass VR.
UnityStereoScreenSpaceUVAdjust() can be used in either the vetex or pixel shader to adjust the UV it just depends on what happens to the UV when used in the Pixel Shader, is it used to read different textures (only some of which might be packed render textures) or are further maths performed on the UV etc. Just make sure to match the appropriate scale and transform value to the texture the UV will be used with.
Finally UnityStereoScreenSpaceUVAdjust(uv, texture_ST) should only be used if you are rendering your image effect with Graphics.Blit() and not some other method like drawing a quad using the low level graphics API. For the non Graphics.Blit() case you will want to use UnityStereoTransformScreenSpaceTex(uv) instead which also compiles out to a pass through in non Single-Pass Stereo but assumes that the uv will be used with a packer render texture.
Most of the Standard Assets Image Effects have been updated to support Single-Pass Stereo. There are a couple that we are still working on that required us to expose more data from the engine to properly fix but the hope is to get these fixed up soon.
Global Fog should I believe work however I am aware that there appears to be a bug where everything renders upside down that renders after it (so things like the GUI) when using it in Single-Pass Stereo mode that we still have to track down.
Also would be very useful if Screen Space Reflections would work with single pass stereo. Anyways, Unity 5.4 has been an awesome upgrade, only with single pass stereo and gpu instancing my framerate has sky rocketed like having a new computer! Fantastic job guys.
Global Fog is not working for me in 5.5.0f3 with Single Pass Stereo Rendering, I planned to use it in combination with Beautify as that asset is all working great with Single Pass, however my one missing component for levels now is Fog:( any updates or possible issues with the version I am using? Thank you.
The post you just quoted has all the info you need to port to SPSR. If you need a proper example you can look at the code in the post-processing stack as most of the effects there do support SPSR
However I’m still unable to get the proper resolution for rendering image effect in SPSR. I’m using command buffers so it seems the only way I can use to get the resolution at which I should render my post fx is to read Camera.pixelWidth and Camera.pixelHeight.
The problem is that it never seems to return the proper resolution, at least not what’s really used internally for rendering…
Same goes for Unity 5.6 and 2017.1
The first inconsistency I’ve noticed is that the Camera.pixelWidth is not the same in Multi Pass than in Single Pass, when in Single Pass it is half the width of MultiPass. I found it is quite strange as the resolution per eye should be the same in both Multi and Single.
Second thing is that Camera.pixelWidth and Camera.pixelHeight is not consistent between Oculus SDK and Open VR, maybe this is expected tought I don’t see why since Oculus resolution stays the same.
The width returned always seems to be downscaled. The width and height are far lower than what’s used internally for rendering into textures, which makes sense with warping.
One way to get the proper resolution is to get it in OnRenderImage() with destination.width and destination.height (applying this resolution to my command buffer render textures fixes all problems), but this is a no go when using command buffers as it does add an un-necessary blit.