[Android, Material] Creating a world vector in material gets clamped/broken in OpenGL ES 3.0
Engine Version: 4.7.5 (Launcher Version, C++ project)
Device: Android Galaxy Tab S
We wanted to add an additional dynamic light source for the characters in our mobile game, to make them "pop" more on the screen. We decided to do this by injecting a world vector and making a basic phong-styled layer in the material to add the extra light (only diffuse light). We noticed after deploying to mobile that some devices would get a sharp edge where the light would no longer reach the mesh, no soft transitions. Some characters were even turning dark. After debugging we noticed it was all related to the light source distance, so the light gets cut off.
To reproduce the issue I created a blank C++ project, which you can download here. I'm using this custom project to demonstrate the issue below.
The custom unlit material in the project looks like this:
This is how the shader should look like. It works on a OpenGL ES2.0 device and on PC.
This is how it looks like when it breaks.
We solved it in our project for now by moving the world position of the light source close enough to the mesh to be within a good distance.
asked May 17 '15 at 10:57 AM in Bug Reports
Hi Denny -
We have been running some tests here on your test project and some we have made based on your test project. So far, we have successfully run the code with no issues, but we currently do not have a Galaxy Tab S to test on. I don't that the issue is device specific like that, we have tested numerous other ES3.0/1 capable Samsung Devices with the same or similar processors without seeing the results you are showing above. We are still testing but this may take some time to nail down what is exactly happening.
Thank You for your patience and if this becomes a complete blocker for you, please let us know immediately here -
answered Jun 02 '15 at 07:07 PM
Lovecraft_K ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here