Ray direction error in Unity Image Effect Shader


we are developing a volume renderer using NReal Light Devkit, but there is a ray direction offset problem in stereo image rendering. We are doing post processing after each stereo camera rendering using Image Effect Shaders of Unity inside OnRenderImage(RenderTexture src, RenderTexture dest) method.

Object position we rendered in Left and right eye images has a vertical offset which shall not be possible since eyes are apart from each other in horizontal axis. The formula we compute ray tracing direction is below, and it is perfectly working in PC, but does not accurately work on NReal glasses. We tried many things but did not work, there may be a problem in Camera Inverse Projection Matrix of NReal, but cannot understand how a vertical error occurs instead of horizontal. What shall be the problem?

float3 viewVector = mul(unity_CameraInvProjection, float4(input.uv * 2 - 1, 0, -1));
viewVector = mul(unity_CameraToWorld, float4(viewVector, 0));
viewVector = normalize(viewVector);

Best regards


Hi Cagatay,

from your description, we speculate that there’s something wrong with the initialization of the camera, please print the complete log, and check whether the following info is in the log.