在ios上统一mvp矩阵

时间:2017-08-10 05:45:27

标签: ios unity3d cg

我正在进行水模拟,我需要对_CameraDepthTexture进行采样以获得不透明的深度,它在Windows上运行良好。但着色器在IOS上有不同的深度。

vert:
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);           
o.ref = ComputeScreenPos(o.pos);
COMPUTE_EYEDEPTH(o.ref.z);
frag:
uniform sampler2D_float _CameraDepthTexture;
float raw_depth = UNITY_SAMPLE_DEPTH(tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(uv2)));

在Windows上,raw_depth约为0.98,但在IOS上,raw_depth约为0.51。 我猜这个结果与差异平台中的MVP相互关联。

0 个答案:

没有答案