Minko - Android light issue

191 views Asked by At

I am working with minko and seem to be facing a light issue with Android. I managed to compile for linux64, Android and html a modified code (based on the tutorials provided by Minko). I simply load and rotate 4 .obj files (the pirate one provided and 3 found on turbosquid for demo purposes only).

The correct result is viewed in the linux64 and html version but the Android one has a "redish" light thrown into it, although the binaries are being generated from the same c++ code.

Here are some pics to demonstrate the problem:

linux64 :

http://tinypic.com/r/qzm2s5/8

Android version :

http://tinypic.com/r/23mn0p3/8

(Couldn’t link the html version but it is close to the linux64 one.)

Here is the part of the code related to the light :

        // 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);

As you can notice the color()->setTo has been turned off and works for all except Android (clean and rebuild). Any idea what might be the source of the problem here ?

Any pointer would be much appreciated.

Thx.

1

There are 1 answers

5
Jean-Marc Le Roux On

Can you test it on other Android devices or with a more recent ROM and give us the result? LG-D855 (LG G3) is powered by an Adreno 330: those GPUs are known to have GLSL compiling deffects, especially with loops and/or structs like we use in Phong.fragment.glsl on the master branch.

The Phong.fragment.glsl on the dev branch has been heavily refactored to fix this (for directional lights only for now).

You could try the dev branch and a directional light and see if it fixes the issue. Be careful though: the dev branch introduces the beta 3, with some API changes. The biggest API change being the math API now using GLM, and the *.effect file format. The best way to go is simply to update your math code to use the new API, everything else should be straight forward.