The spot sprite disappears at the edge of the screen on my Galaxy S4 (not on Nexus 7)

I am experimenting with a particle emitter based on this code: https://code.google.com/p/sravan-work/source/browse/trunk/OpenGL+ES2/es2particles/src/es2/learning/ParticleRenderer.java

Currently, the particle emitter works fine on my Nexus 7; point sprites are generated in the center of the screen and either 1) disappear, or 2) fly past the edge of the screen.

Unfortunately, on my Galaxy S4, point sprites disappear from the display as soon as their midpoint reaches the edge of the screen. This causes a really unpleasant visual effect.

Both devices are running Android 4.3

Question: Why will sprites slide across the screen on the (Asus) Nexus 7, but on the Galaxy S4 they suddenly disappear? Is there anything that can be done to prevent a sudden disappearance?

Additional notes:

For Galaxy S4, the following is printed in logcat:

12-03 00:29:15.288: I/Adreno-EGL(31137): <qeglDrvAPI_eglInitialize:316>: EGL 1.4 QUALCOMM build:  (CL4169980) 
12-03 00:29:15.288: I/Adreno-EGL(31137): OpenGL ES Shader Compiler Version: 17.01.10.SPL 
12-03 00:29:15.288: I/Adreno-EGL(31137): Build Date: 09/26/13 Thu

For Nexus 7, the following is printed in logcat:

12-03 00:14:38.144: D/libEGL(25303): loaded /system/lib/egl/libEGL_tegra.so
12-03 00:14:38.154: D/libEGL(25303): loaded /system/lib/egl/libGLESv1_CM_tegra.so
12-03 00:14:38.174: D/libEGL(25303): loaded /system/lib/egl/libGLESv2_tegra.so
12-03 00:14:38.194: D/OpenGLRenderer(25303): Enabling debug mode 0
+4
source share
1 answer

Springs are based on one point in the center around which the texture is drawn. If this point extends beyond the rendering area, they are cropped, since all their geometry is technically beyond the bounds of the representation.

Several workarounds may occur to avoid a sudden disappearance:

  • Manually fading sprites as you approach the edge of the screen.
  • /, " " ( , ).
  • ( , )

3:
:

float verts[] = {-1, 1, 0,  1, 1, 0,  1,-1, 0,  -1,-1, 0};

, , , .

-, GLES20.GL_POINTS , , , GLES20.GL_TRIANGLE_FAN .

. - a_Position*size*0.5 + translate . , , verts[]. translate .

1: , glPointSize , . 10, , , .

2: , perspective matrix, , , .

0

All Articles