Great! This update made some extensions working again, including ZGESensors! I'm looking forward to normalMatrix used in GLES 2.0... after fixing suggested by Kjell...
Rado1: That sensors work again must be because I (by mistake) kept the change that disallows gl-calls on startup. I'm guessing the callback does not work because it is initiated from another thread. You could add more logging to the init function, testing if looper or sensorEventQueue is null etc. to help debug this. Anyway for now it should work (my workaround is till there) but we should try to fix it later.
Small update:
- Shader has a new BeforeLinkExpression property. This is needed for OpenGL scripting because some call can only be made between compile and link.
- ShaderVariable has a new VariableRef property. Use this to link a Variable component to a shader variable. It supports float, vec2, vec3, vec4 and mat4 types so you no longer needs to split a vec2 into two separate shader variables.
VilleK wrote:- Shader has a new BeforeLinkExpression property. This is needed for OpenGL scripting because some call can only be made between compile and link.
Ville, could you please give us an example of usage BeforeLinkExpression property?
Rado1 wrote:Ville, could you please give us an example of usage BeforeLinkExpression property?
Sure, I'm working on a new effect for the Zge Visualizer. It uses OpenGL 4.0 features to update particle positions via transform feedback. The glTransformFeedbackVaryings call can only be made between compile and link.
int progHandle = this.Handle; //Get the handle of the shader
string[4] outputNames;
outputNames[0]="Position";
outputNames[1]="Velocity";
outputNames[2]="StartTime";
outputNames[3]="Color";
glTransformFeedbackVaryings(progHandle, 4, outputNames, GL_SEPARATE_ATTRIBS);
Rado1 wrote:I have another question: how is it possible to use orthographic camera in ES2/GL3 mode? When I tried to use it, nothing displayed.
It should work but it is quite possible there is a bug because I haven't tested it properly. Are you sure you are setting the camera properties to valid values for orthographic? Does the same camera show something in GL compatible mode?
I tested the orthographic camera mode again and the reason why all scene objects disappeared from my project was that the Ortographic mode behaves like Perspective and the distance from objects was too far.
I think it's a bug. Please check the attached project.
VilleK wrote:anything wrong with this Ortho-implmentation?
Even though it's a bit sloppy for its specific usage ( see attached for a leaner function ), there's nothing wrong with it. The problem must be caused by something else.
Ortho.zgeproj works fine for Compatible mode, but even after the latest ZGE beta update (from this noon), the ortho camera is still not working for GL3 (tested on the previously sent test.zgeproj). Ville, Kjell, others, do you have the same problem? Could it be fixed in ZGE or is there some workaround?
Didn't know there was a new build ( it hasn't been checked in on the repository ) .. anyway, doesn't look like the orthographic camera problem has been fixed yet.
If you don't want to wait you could always generate & upload the projection matrix yourself ( bit of a hassle though ).