Note that there are some explanatory texts on larger screens.

plurals
  1. POUnexpected results implementing simple motion blur in Libgdx
    text
    copied!<p>In the two attached pictures, the desktop screenshot of libgdx functions as expected. The screenshot from my Galaxy Nexus is unfortunately not as expected. I am attempting to create a simple motion blur or trail effect.</p> <p>Rendering as I expected on my desktop. <img src="https://i.stack.imgur.com/n2zLU.png" alt="Libgdx running on my desktop, working as expected"></p> <p>Not rendering as I expected on my Galaxy nexus. <img src="https://i.stack.imgur.com/aG4ny.png" alt="Libgdx running on my Galaxy Nexus not working as expected"></p> <p>The circle textures are drawn in a for loop during rendering and the effect is achieved with a pixmap using the RGBA of 0, 0, 0, 0.1f that is drawn before the circles.</p> <p><strong>screenClearSprite creation</strong></p> <pre><code>Pixmap screenClearPixmap = new Pixmap(256, 256, Format.RGBA8888); screenClearPixmap.setColor(Color.rgba8888(0, 0, 0, 0.1f)); screenClearPixmap.fillRectangle(0, 0, 256, 256); screenClearTexture = new Texture(screenClearPixmap); screenClearSprite = new Sprite(screenClearTexture); screenClearSprite.setSize(screenWidth, screenHeight); screenClearPixmap.dispose(); </code></pre> <p><strong>Render</strong></p> <pre><code>batch.begin(); font.draw(batch, "fps:" + Gdx.graphics.getFramesPerSecond(), 0, 20); screenClearSprite.draw(batch); for (int i = 0; i &lt; circleBodies.size(); i++) { tempPos = circleBodies.get(i).getPosition(); batch.draw(circleTexture, (tempPos.x * SCALE) + screenWidthHalf - circleSizeHalf, (tempPos.y * SCALE) + screenHeightHalf - circleSizeHalf); } batch.end(); </code></pre> <p>So, what did I do wrong? Perhaps there is a better way to get the 'motion blur' effect of movement?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload