State of OpenGL ES2.0 support

Started by EgonOlsen, May 13, 2011, 11:17:08 PM

Previous topic - Next topic

EgonOlsen

#75
color isn't set by jPCT-AE unless you specify some vertex color, which is why it's always black. Try to set it fixed to white or something. I tried that with your code, but the result still looks kind of strange. So i've modified the shader slightly and set the light source to -20 instead of -1 (because otherwise, it's inside the cubes).

I created this:


uniform mat4 modelViewProjectionMatrix;
uniform mat4 modelViewMatrix;

attribute vec4 position;
attribute vec4 color;
attribute vec3 normal;

varying vec3 v_Position;
varying vec4 v_Color;
varying vec3 v_Normal;

void main()
{
    v_Position = vec3(modelViewMatrix * position);
    v_Color = vec4(1,1,1,1);
    v_Normal = vec3(modelViewMatrix * vec4(normal, 0.0));
    gl_Position = modelViewProjectionMatrix * position;
}


precision mediump float;
uniform vec3 lightPositions[8];
varying vec3 v_Position;
varying vec4 v_Color;
varying vec3 v_Normal;

void main()
{
    float distance = length(lightPositions[0] - v_Position);
    vec3 lightVector = normalize(lightPositions[0] - v_Position);
    float diffuse = dot(v_Normal, lightVector);
    diffuse = diffuse * (10.0 / distance);
    gl_FragColor = v_Color * diffuse;
}


...still not very convincing IMHO, but it might be a starting point. You might as well look out for a simple phong shader instead. I had one lying around here, but i can't find it ATM... :(

Thomas.

thanks, getting color from vertex is bad solution, but I never wrote any shader, so I need some parts of code to understand how it works :)

dherby

Any release date for the new version of jPCT-AE supporting OpenGLES 2.0 ?

++
dherby

Thomas.

here you can download new alpha more than month...

dherby

#79
Thks for the info. I've already had this version who's working fine but I'm still undecided about the right engine for me.

In fact, I'm looking for a game engine with bone and pose animation support. I've tested jme3.0, libgdx and jPCT. All are good engine but jPCT+bone seems to be the more simple and suitable for my needs.

I've tested all of them with a modified simbad ogre3D model (I've added simple keyframe for lipsync animation).
Here are the result in FPS with a Galaxy S/android 2.3.4 (Bone:"Dance" Anim + Keyframe Blending).

- libgdx 15FPS (GLES 2.0)
- jme3.0 10FPS (GLES 2.0)
- jpct-ae 20 FPS (GLES 1.1)

In addition, I've implemented my own library in C + NDK android for managing pose frame and keyframe animations natively in opengl ES 2.0 (Only one vertex shader computing Bone Position and Keyframe position at the same time).

It's working pretty well and it's fast (approx 30-35FPS) but some optimization are chipset dependent (Power VR) and It's a nightmare to deal with OpenGL graphic context (LiveWallPaper), moreover, I've got some nasty compatible issue with a few smart-phone.

So, I need to come back the right path using only android SDK. Do you think I can expect some FPS improvement with the new GLES 2.0 implementation of jPCT-AE ?

Thks !
++
dherby

EgonOlsen

#80
FPS most likely won't increase with ES 2.0. It might happen, if you write yourself some dedicated shaders that do only what you need. jPCT-AE's OpenGL ES 2.0 support relies on some default shaders, which might not be optimal in all cases.

Edit: You might get an increase if you would do the skinning in the shader, what Bones doesn't do. Somebody (not me... ;) ) would have to modify Bones for that. I'm not sure, if it's worth it though. You can also try to use the libgdx-support of jPCT-AE (see the wiki)...it might help to increase vertex upload time, but i wouldn't expect too much (if anything) on a current device.

Thomas.

OGLES 2.0 mode in and3Dbench xl running on HTC sensation :)

EgonOlsen


Thomas.

yes, I will try also on Samsung Galaxy S2 with Mali-400, but I do not when...

EgonOlsen

I've already ran it myself on an S2. It worked except for some texture problems with non-square textures, but that's a common issue with ES 2.0, which is why jPCT-AE already prints out a warning in this case.

K24A3

#85
I have a Tegra 2 tablet running homeycomb 3.1, let me know if you need to test GL20 routines. I also own a DesireHD running 2.3.5 if that's any help. I also have access to a new OMAP tablet.

edit: An3DBenchXL is working fine on that hardware.