我正在与minko合作,似乎在Android上遇到了一个小问题。我设法为linux64,Android和html编译了一个修改过的代码(基于Minko提供的教程)。我只是简单地加载和旋转4个.obj文件(盗版提供的一个和turbosquid上的3个仅用于演示目的)。
正确的结果在linux64和html版本中都可以看到,但是Android版本的结果有一种“低俗”的感觉,尽管这两个二进制文件是从相同的c++代码中生成的。
下面是一些演示问题的图片:
linux64:
http://tinypic.com/r/qzm2s5/8
Android版本:
http://tinypic.com/r/23mn0p3/8
(无法链接html版本,但它与linux64版本很接近。)
以下是代码中与灯光相关的部分:
// create the spot light node
auto spotLightNode = scene::Node::create("spotLight");
// change the spot light position
//spotLightNode->addComponent(Transform::create(Matrix4x4::create()->lookAt(Vector3::zero(), Vector3::create(0.1f, 2.f, 0.f)))); //ok linux - html
spotLightNode->addComponent(Transform::create(Matrix4x4::create()->lookAt(Vector3::zero(), Vector3::create(0.1f, 8.f, 0.f))));
// create the point light component
auto spotLight = SpotLight::create(.15f, .4f); //ok linux and html
// update the spot light component attributes
spotLight->diffuse(4.5f); //ori - ok linux - html
// add the component to the spot light node
spotLightNode->addComponent(spotLight);
//sets a red color to our spot light
//spotLightNode->component<SpotLight>()->color()->setTo(2.0f, 1.0f, 1.0f);
// add the node to the root of the scene graph
rootNode->addChild(spotLightNode);正如你所注意到的,color()->setTo已经被关闭,除了安卓系统(清理和重建)之外,它对所有系统都有效。你知道问题的根源是什么吗?
任何指针都会非常感谢。
谢谢。
发布于 2015-04-06 16:45:41
你能在其他Android设备上测试它,或者使用更新的ROM,并给我们结果吗?LG-D855 (LG G3)由Adreno330驱动:众所周知,这些GPU具有Phong.fragment.glsl on the master branch编译缺陷,特别是像我们在GPU中使用的循环和/或结构。
Phong.fragment.glsl on the dev branch已经进行了大量重构以修复此问题(目前仅适用于平行光)。
你可以尝试dev分支和一个平行光,看看它是否解决了这个问题。注意: dev分支引入了Beta3,有一些API的变化。最大的API变化是现在使用GLM的数学API,以及*.effect文件格式。最好的方法是简单地更新你的数学代码以使用新的API,其他的一切都应该是直接的。
https://stackoverflow.com/questions/29461739
复制相似问题