0

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.

Jeux
  • 5
  • 5
  • In case it matters, tested on an LG LG-D855 official Kitkat 4.4.2 rom Kernel verion : 3.4.0 LG software version : V10g-AME-XX – Jeux Apr 06 '15 at 07:07
  • issue remained after upgrading to official LG version : V10i-AME-XX (not latest for this phone). PS: binary compiled using master branch. – Jeux Apr 18 '15 at 18:38
  • same for : V10I-AME-XX – Jeux Apr 18 '15 at 19:55
  • same for : V10o-AME-XX (Next update is OS upgrade) which means master issue is present for Kitkat version of LG g3 – Jeux Apr 18 '15 at 20:47

1 Answers1

0

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.

  • Indeed, the problem seems specific to this phone so far as older phones are rendering correctly. Also yes, there is a pending system update but i rather not do it now. Since you suggest another route i will try that first. PS: I am no expert with shaders / fragment files, but i assume i can't just copy paste some files and recompile my code but i will have to 'git clone' the dev Branch entirely and rebuild the framework, right ? – Jeux Apr 06 '15 at 19:16
  • Unfortunately, I can't compile the dev branch for android using **make -j 4 config=android_release**. I get errors similar to : `error: invalid initialization of reference of type 'const mat4& {aka const glm::detail::tmat4x4&}' from expression of type 'const float'` Also I am unable to compile the examples and tutorials for linux and html (but i guess that's on purpose since premake5.sh was moved to bin ?) – Jeux Apr 06 '15 at 21:29
  • Some examples/tutorials don't work yet in dev because of the new math API. You can look at the "lights" example for a working example. I've edited my answer. – Jean-Marc Le Roux Apr 07 '15 at 21:45
  • The very few examples that compile for linux64 don't run (example assimp opens a window and closes immediately). Nevertheless, i managed to modify my code to use the new API and it compiles fine, however on launch it also crashes with a segmentation fault at : `sceneMan->assets()->loader()->load();` Any idea what might be wrong ? (Same asset folder works perfectly with non dev branch). Thx. – Jeux Apr 11 '15 at 09:44
  • create another question for that – Jean-Marc Le Roux Apr 13 '15 at 11:20