Showing posts with label Allwinner. Show all posts
Showing posts with label Allwinner. Show all posts

Sunday, October 12, 2014

Having Fun with OpenGL, Android and Hardware Decoding

OpenGL is a good technology, and playing around with it on Android can be real fun! :-) By streaming a video to texture it is possible to create interesting effects, like it is possible to do with Qt. With a simple shader, for instance, lightning effects can be added:


#extension GL_OES_EGL_image_external : require

precision mediump float;
uniform samplerExternalOES u_Texture;
uniform vec3 u_LightPos;      // The position of the light in eye space.
varying vec2 v_TexCoordinate; // Interpolated texture coordinate per fragment.
varying vec3 v_Position;      // Interpolated position for this fragment.
varying vec4 v_Color; 
varying vec3 v_Normal;        // Interpolated normal.
void main()
{
   float distance = length(u_LightPos - v_Position);
   vec3 lightVector = normalize(u_LightPos - v_Position);
   float diffuse = max(dot(v_Normal, lightVector), 0.0);
   diffuse = diffuse*(1.0/(1.0 + (0.10*distance)));
   diffuse = diffuse + 0.3;
   gl_FragColor = v_Color*diffuse*texture2D(u_Texture, v_TexCoordinate);

}


This is the result on a couple of different devices (Nexus 7 with Qualcomm Snapdragon and an Allwinner A31s chip):

Saturday, June 7, 2014

Video with Animations on Raspberry Pi and A31s Compared

For many uses, playing video while animations are running is pretty useful and it is also considerably stressful for the GPU. I therefore tested a couple of cheap chips with the same Qt/QML sample app. I created a small demo video comparing Qt on A31s and Raspberry Pi (PiOmxTextures):

In the demo, all the media (video and images) are 720p, and the output is 720p for A31s and 1080p for Raspberry Pi (16bpp). It is pretty hard to tell from the video, but Raspberry seems to still be above A31s.
Bye! ;-)