Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 19 May 2002
Offline Last Active Apr 25 2015 07:22 AM

Topics I've Started

Finally finished my Android Starfield Live Wallpaper (3D)

08 March 2013 - 11:55 AM



the last couple of months I've been spending my weekends developing a retro-style starfield-themed wallpaper. I've been pestering people here with questions (like this one and this one), but I finally published the application to the market. It is entirely free, does not contain ads of any kind and it does not require any permissions. I'd be happy to hear your opinion!








Download it @ Google Play:



NVIDIA PerfHUD ES on Android Galaxy Tab 10.1 Honeycomb (3.1)

22 December 2012 - 05:49 AM



has anyone managed to run Nvidia's PerfHUD ES on Galaxy Tab 10.1?


I have come to the conclusion that the instrumented drivers need to be copied to /system/lib/egl on the device, then egl.cfg (in the same directory) must be modified accordingly. There is a site that offers these library files for Froyo and Gingerbread, but not for Honeycomb. I tried downloading the Tegra Android Honeycomb (3.2) OS Image from Nvidia's Website and take the driver files from there but I failed extracting the system.img file. Anyway, I'm not sure these 3.2 files would be compatible with my 3.1 system.


Any ideas?


OpenGL ES 2.0 on Android: how to render 500 cubes effectively

24 November 2012 - 05:51 AM


I am trying to simulate a starfield of rotating cubes moving towards the user:

Posted Image

I am struggling to maintain a smooth animation on Android. I can't see why a Dual-core 1 GHz Cortex-A9 with a ULP GeForce GPU should not be able to do that. Here's what I do:


- Create a VBO containing 36 cube position vertices and 36 cube normal vertices, interleaved
- Set up a simple shader that takes positions, normals, color, MV matrix, MVP matrix, light position
- Connect the VBO to the shader's position and normal attribute respectively


a] Movement (for each cube)

- calculate scaling matrix, rotation matrix A, translation matrix, rotation matrix B
- multiply all of the above matrices to obtain model matrix
- multiply model matrix and view matrix to obtain MV matrix
- multiply MV matrix and projection matrix to obtain MVP matrix

b] Draw (for each cube)

- hook up cube's MV matrix with shader (glUniformMatrix4fv)
- hook up cube's MVP matrix with shader (glUniformMatrix4fv)
- hook up cube's color constant with shader (glVertexAttrib4f)
- draw cube (glDrawArrays)

I have done a lot of profiling and timing analyzation, so I don't think I have any unintended performance leaks in my code. Rather, I believe there is a more general design flaw, and I hope someone can help me improve it.

Effective way to detect whether my 3D cubes are outside the 2D screen boundaries?

07 September 2012 - 04:31 AM

I am implementing a screensaver - a starfield made out of cubes that move towards the viewer in 3D space:

Attached File  screenshot.png   188.51KB   70 downloads

I place the camera away from the origin along the z-axis, generate the cube objects at the origin with random x and y values, and move the cubes towards the viewer along the z-axis.

Naturally, the more cubes I have, the more calculations I have to perform. Therefore I would like to reset any cube as soon as it is outside the screen boundaries, so I can reuse it and restart it at the origin.

I have read lighthouse3d's excellent tutorial about view frustrum culling, but I believe there must be a more efficient way for my special case. The best I came up with was taking the center point of each cube [0,0,0], multiply it with the model-view-projection matrix (which is cheap, because I have that matrix already), transform its x and y values into device coordinates (dividing them by w) and see if either one is smaller than -1.0 or greater than 1.0.

This is quite effective, but of course the cubes disappear as soon as their center is outside the screen boundaries, while I would like them to be completely outside before disappearing.

Fade to Black in D3D without enabling lighting?

24 May 2005 - 10:00 PM

Hi, I would like to fade my whole screeen to black at the end of a game level. Is there a way to do color fade-ins/fade-outs in a D3D application without enabling lighting, e.g. by changing the way textures are rendered? Regards, Sebastian