glGetShaderInfoLog returns empty string (android) - opengl-es

I am modifying the version of the android version of the 2d texture example from OpenGl ES2.0 programming guide to change the fragment shader. this is written in pure Java and doesn't use the NDK.
The vanilla example works just fine on my phone, but when I change the shader code it no longer works. This is because my modified shader doesn't compile (obviously), but I can't find the cause of the problem as glGetShaderInfoLog returns an empty string.
I've done a search on this issue, and apparently, as of Jul 22nd, it was a known issue, but I was wondering what ways there are of getting around it. One post I found said they had written an NDK wrapper for the function, but being new to Android development I don't really know how to do this.

You're suffering from a bug. I worked around by using the old GL ES 2.0 bindings to get a functioning glGetShaderInfoLog. Like this:
import com.badlogic.gdx.backends.android.AndroidGL20;
...
AndroidGL20 gl2 = new AndroidGL20();
Log.e(TAG, gl2.glGetShaderInfoLog(shader));
I still use the standard GLES20 wrapper library for everything else, so this was simple to drop into my codebase. The two wrappers apparently can coexist without any problems.

Just incase anyone does find this question as they have encountered the same problem, the only way I have found to "get around it" is to compile the shader with another App (such as Rendermonkey). Not ideal, but it got me further in my project!

I had the same problem.
Make sure you have the following in ApplicationManufest.xml:
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
Call this after initializing a GLSurfaceView
glSurfaceView.SetEGLContextClientVersion(2);

Related

Unity URP Light2D, set target sorting layers programmatically

Im working on a personal 2D game and have been looking into the Universal Pipeline Renderer and the Light2D object.
I currently have Light2D objects being generated dynamically during level generation which works fine except I cant find a way to set the Target Sorting Layers option programmatically I can only set them at runtime using the editor. Am I missing something obvious or is this not possible?
Thanks
This used to work in at least some of the experimental versions of URP using
[lightSpriteComponent].m_ApplyToSortingLayers
however, when it stopped being experimental, this stopped working and broke one of my projects.
A way to set this from code and a way to set the light's sprite at runtime like the old form
[lightSpriteComponent].lightCookieSprite = Sprite
would be fantastic. They both existed and you could probably go into the URP code and find a way to access them again but, as of now, I don't think it's possible without going to an older version.

Three.js Typeface.js offline

the problem is obvious from the title, http://typeface.neocracy.org offline. It was used to convert fonts and used in conjunction with THREE.TextGeometry. But if it is offline, how is now possible to use custom fonts in three.js?
I made a new converter that outputs the same files as typeface.js.
http://gero3.github.io/facetype.js/
I loaded the source, but as far as I can see there is no chance to create the JS-font-files with this distribution. Maybe for someone with deep perl-knowledge...? In any case I installed perl, the ppm and dmake but trying to exec the Makefile only leads to errormessages about missing files. No - this is no alternative to the online-converter. Even worser: I didn't find any other converter or another side using the same one (cufon seems to create another format). So let's hope the site comes back to live - otherwise the great textfeature of three.js is worth nothing in the moment.

What is the best practice to resolve issues due to updated revisions in Three.JS?

I have some codes developed using Three.js R52. I need some features in some code developed using Three.js R56. While I tried to add those features to the original codes developed in R52 and replace the reference to R52 with that to R56, it tells me some some error.
For example, in the original code based on R52, THREE.Matrix4().multiplySelf function is used. After I change the reference to three.min.js from R52 to R56, I came across errors saying:
TypeError: multiplySelf is not a function.
Then I go through the changes listed in https://github.com/mrdoob/three.js/releases by searching "Matrix4", I did not see any note related to method 'multiplySelf'. I searched "multiplySelf" and it returns no entry found. I searched three.min.js R52 and found function "multiplySelf". But there is no 'multiplySelf' in R65.
Could anybody tell me what I should do now? And in general, what is the best practice to resolve issues due to updated revisions in Three.JS? Thanks...
I would create different sandboxes with the different versions of three.js. As such, I would be able to move from one sandbox to another and testing my functions without contaminating my code. I call sandbox a folder whose name is distinctive per three.js version where I only keep functionality relevant to that release and I never mix sandboxes. Usually you would have to keep a copy of your code in each sandbox until all the translations from one release to the other have been performed.
In addition you can use code like: if (THREE.REVISION < 58) to separate the different versions of three.js in your code.

GLESRender Debug Draw on Cocos2d v2.0

I recently upgraded to cocos2d v2.0 and box2d 2.1.2 and my debug draw stopped working. The game still works fine but the bodies are not being drawn anymore. Ive read it has something to do with the fact that cocos2d v2.0 uses GLES 2.0 but nobody has been able to give me a solution, the forums have not responded.
Chipmunk debugdraw also broke but I got a CPDebugLayer class file and i restored it. Box2d is the only one I've been unable to get working properly.
Anybody run into the same situation?
First, install the cocos2d 2.0 templates in the usual way:
./install-templates.sh -f
Then create a new cocos2d with Box2D project from the template. Replace your project's GLES-Render.h/.m files with the ones from the cocos2d+Box2D template project. That should be all.
It's worth mentioning that if you did any custom OpenGL drawing in your app, you will have to modify the rendering code to use OpenGL ES 2.0 functions exclusively, even if the old code still compiles. Some OpenGL ES 1.1 functions are still available and you can use them, but they usually don't work or worse cause OpenGL errors. That can have a variety of rendering side-effects.

Integrateing openfeint in xcode using unity3d

I want to make an openfeint leaderboard in xcode using Unity3d.
I am using Unity 3.2 and openfeint 2.9.1.
I have built correctly as well as what they told in openfeint Unity support readme.txt and open feint web link.
But I'm getting error like
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-4.2 failed with exit code 1
What am I doing wrong?
I'm working with ios 4.2.
I have tried and corrected well all unity player settings and set the target ios platform from 3.0 to 3.2 but I am getting the same error.
Can any one point out what am doing wrong.?
Thank you.
The solution is easy but took time as it happens :)
In Editor\OpenFeint\XCode\Appcontroller+OpenFeint.mm You must remove UnitySetAudioSessionActive() in the methods dashboardDidDisappear() and dashboardWillDisappear().
And everything becomes OK. Don't understand why it is there at all when UnityPause() is there?
UPDATED: You must remove UnitySetAudioSessionActive() ONLY in the methods dashboardWillAppear() and dashboardDidDisappear() (or sound will stop playing after disabling device there...
by that I thought you will get out from your OpenFeint Problem ..
Vivek Shah

Resources