Vertex shader/ fragement shader - UnityObjectToClipPos () pb with HTC VIVE
Hi,
I have a problem with shader and with a HTC VIVE.
When I use a shader with UnityObjectToClipPos()
there is like a difference between right eye and the left one. I think it's due to the presence of two cameras.
How can I solve the problem ?
I doubt it would be because of two cameras, although as a failsafe have you tried just multiplying the vertices into clip space manually? i.e.
o.pos = mul (UNITY_$$anonymous$$ATRIX_$$anonymous$$VP, v.vertex);
Hi, The problem isn't solved. According to Unity :
UnityObjectToClipPos()
Transforms a point from object space to the camera’s clip space in homogeneous coordinates. This is the equivalent of mul(UNITY_$$anonymous$$ATRIX_$$anonymous$$VP, float4(pos, 1.0)), and should be used in its place.
I am aware of what the function does, my suggestion was based on the fact that there may have been a bug with the dual matrix multiplication they use in that function. Could you post an image of what exactly the problem is?
Your answer
![](https://koobas.hobune.stream/wayback/20220612122046im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
RenderWithShader result is all black 0 Answers
Glowing outline with occlusion 0 Answers
How to Change the Shader Color? 0 Answers
Setting cbuffer floats in scripts 0 Answers
How to set a render-to-texture camera to be a VR camera 0 Answers