Open DevJamaly opened 2 months ago
Any updates on this ? Facing the same issue !
So this works fine with the non-OES shaders? Can I confirm you are using OpenGLES, not Vulkan?
So this works fine with the non-OES shaders?
Yes, it works fine with non-OES shaders provided by AVPro
Can I confirm you are using OpenGLES, not Vulkan?
Yes i am using OpenGLES3 as the graphics API
@DevJamaly @TJ-Sentient Hello. When I tried to use OES shaders I encounter similar issue. Somehow I unable to control position, rotation or scale of renered video. It seems always rendered with default transform at world origin. I never go deeper and swithed back to using BGRA texture (does not have time to properly investigate).
Can you, please, check if you are able to affect transform of Mesh with OES shader in any way? If not - it seems there is problem with OES shader and transformation matrices.
@Last8Exile this is exactly the issue i am facing. Thank you for describing it eloquently. As you mentioned due to it rendering at origin and ignoring transforms i have currently switched to non-OES shader. However, i hope we can fix this issue as soon as possible.
@Chris-RH any updates on this issue? Were you guys able to recreate the error on your end. Please let me know if there are any updates. I am using AVPro for a current project demo, which is due soon, and i would like to use OES.
I think this might be a Unity issue. We were seeing something similar a year or two ago and the issue was the object transform was always coming through to the shader as identity. I wonder if this is the same issue.
I'm also seeing issues with the OES shader - including the one described above. I found a basic fix for this in the main vertex method in the OES shader -
#if defined(STEREO_MULTIVIEW_ON)
int eyeIndex = SetupStereoEyeIndex();
mat4 vpMatrix = GetStereoMatrixVP(eyeIndex);
gl_Position = vpMatrix * _CustomObjectToWorld * gl_Vertex; // replace unity_ObjectToWorld with a custom matrix that is set with a shader property
#else
gl_Position = XFormObjectToClip(_CustomObjectToWorld * gl_Vertex); // add in the property here
#endif
However, certain videos play upside down (though remain correctly scaled and positioned) and I can't find any reason why some do and some don't. I've reverted to using the non-OES shader, which isn't ideal, but seems a lot more reliable.
Could you maybe try replacing unity_ObjectToWorld with UNITY_MATRIX_M ?
Also, just to check. Is anything here dynamically/statically batched (meshes)? As these are are generated in world space and so that martix will always be identity. I don't think that would be the case here, but just wanting to check.
Could you maybe try replacing unity_ObjectToWorld with UNITY_MATRIX_M ?
That didn't have any affect. Tried a few others just to see listed here - https://docs.unity3d.com/Manual/SL-UnityShaderVariables.html) but it's always the identity matrix.
Also, just to check. Is anything here dynamically/statically batched (meshes)? As these are are generated in world space and so that martix will always be identity. I don't think that would be the case here, but just wanting to check.
Nope
Describe the issue When I apply the OES shader to the sphere mesh. The sphere mesh scales down in scale and translates off to the side. This happens for both OES and OES transparent shader.
Your Setup (please complete the following information):
To Reproduce