顶点皮肤在使用Monodroid的真实Android设备上看起来很乱

时间:2014-09-13 15:53:10

标签: c# xamarin xamarin.android opengl-es-2.0 glsles

我做"顶点蒙皮"没问题。用于三维动画。使用模拟器(和genymotion)时,所有内容都正常。但是,在真实设备(例如三星和联想)上运行时,看起来凌乱

Screenshoot(模拟器)

http://1drv.ms/1BzZ9Ib

enter image description here

Screenshoot(真实设备)

1drv.ms/1BzZ2we

enter image description here

传递皮肤变换矩阵

int location = ...;
int arrayCount = ...;
float[] skinTransform = ...;
GL.UniformMatrix4(location, arrayCount, false, skinTransform);

GLSL顶点

uniform mat4 World;
uniform mat4 View;
uniform mat4 Projection;
uniform mat4 Bones[20];

attribute vec4 Position;
attribute vec4 BoneIndices;
attribute vec4 BoneWeights;
attribute vec2 UV;
varying vec4 v_Position;
varying vec2 v_UV;

void main()
{
    mat4 skinTransform;
    int boneIndex = int(BoneIndices.x);
    skinTransform += Bones[boneIndex] * BoneWeights.x;
    boneIndex = int(BoneIndices.y);
    skinTransform += Bones[boneIndex] * BoneWeights.y;
    boneIndex = int(BoneIndices.z);
    skinTransform += Bones[boneIndex] * BoneWeights.z;
    boneIndex = int(BoneIndices.w);
    skinTransform += Bones[boneIndex] * BoneWeights.w;
    vec4 skinPos = Position * skinTransform;
    vec4 worldPosition = skinPos * World;
    vec4 viewPosition = worldPosition * View;
    v_Position = viewPosition * Projection;
    v_UV = UV;
    gl_Position = v_Position;
}

APK

http://1drv.ms/1BzYV3Q 触摸屏幕至开/关动画。

信息

  1. Xamarin.Android = 4.10.x.x
  2. 仿真器目标= API 16或4.1
  3. Real device Target = API 16或4.1
  4. App Target = API 10或2.3(也在API 14和API 16中测试),结果保持不变
  5. 有没有解决这个问题的方案?

    致以最诚挚的问候,谢谢。

0 个答案:

没有答案