Blurry and Jagged Parallax Transitions (Corona SDK flaw?)

Hello everyone,

So I’ve been searching the forums/Google for days and I cannot seem to find a solution to this issue. Basically when there is an object parallaxing across the screen (on simulator or device) the object transitions do not appear to be smooth. They seem blurry around the edges and appear to have a ghosting effect. I have even implemented delta time and it does not solve the issue. The problem get’s worse as the speed is increased. I’ve read that it could be an issue with anti-aliasing, or the Corona SDK itself. If anyone knows of a fix for this or can provide input that would be awesome. Demo code is posted below. Just copy and paste it into a main.lua file. Thanks!

----------------------------------------------------------------------------------------- -- Initial setup ----------------------------------------------------------------------------------------- display.setStatusBar( display.HiddenStatusBar ) system.setIdleTimer( false ) local w,h = display.viewableContentWidth, display.viewableContentHeight; local column, wallpaper local tPrevious = system.getTimer() local runtime = 0 ----------------------------------------------------------------------------------------- --Functions ----------------------------------------------------------------------------------------- local function getDeltaTime() local temp = system.getTimer() --Get current game time in ms local dt = (temp-runtime) / (1000/30) --60fps or 30fps as base runtime = temp return dt end function moveColumn(event) local dt = getDeltaTime() column.x = column.x - (3\*dt) --Change this value if column.x \< -80 then column.x = w end end ----------------------------------------------------------------------------------------- --Display Objects ----------------------------------------------------------------------------------------- wallpaper = display.newRect(w/2, h/2, w, h ) wallpaper:setFillColor(0,0,0) wallpaper.x = w/2 wallpaper.y = h/2 column = display.newRect(w, h/2, 80, 1000 ) column.xScale = .8 column.yScale = .7 column.anchorX = 0 Runtime:addEventListener( "enterFrame", moveColumn)

Anyone??

Did you try 60fps too?

I have a scroller, that does something like your sample. The main difference between your code and mine is that i am not factoring in the delta, and am just scrolling each object at a set speed (that can increase or decrease)

My approach works fine on device. Another thing to be aware of (if you have this problem in your game vs with the sample code you provided) is that removing objects at runtime can cause slight drops in fps for a few milliseconds.

This can make things appear like they are ‘jerky’ also, so using a pool of objects for the most part, as opposed to a remove/recreate cycle is advised.

Hope this helps :slight_smile:

I tried 60fps as well and it’s the same effect. But I will try your advice! Also, is your game available for download?, i’d love to check it out. :slight_smile:

instead of manually translating, you could try

obj:translate (x,y)

I’ll try that right away, thanks 

86lemonade68!

Netiher the 60fps or translate works. The problem must be internal to the corona sdk. It’s pretty annoying.

What device are you testing on? All i can say is that we have smooth parallax working on iPhone 4 and above with Corona.

My testing devices are samsung galaxy s4 and iphone 4. The parallax movement isn’t so much a concern as is the blurry vibrating effect of the object in motion. Logically I think my programming design is correct, but the issue must lie in the way the corona runtime renders moving objects on screen. I can’t think of any other reason. It shows this way on the simulator and on the device.

Anyone??

Did you try 60fps too?

I have a scroller, that does something like your sample. The main difference between your code and mine is that i am not factoring in the delta, and am just scrolling each object at a set speed (that can increase or decrease)

My approach works fine on device. Another thing to be aware of (if you have this problem in your game vs with the sample code you provided) is that removing objects at runtime can cause slight drops in fps for a few milliseconds.

This can make things appear like they are ‘jerky’ also, so using a pool of objects for the most part, as opposed to a remove/recreate cycle is advised.

Hope this helps :slight_smile:

I tried 60fps as well and it’s the same effect. But I will try your advice! Also, is your game available for download?, i’d love to check it out. :slight_smile:

instead of manually translating, you could try

obj:translate (x,y)

I’ll try that right away, thanks 

86lemonade68!

Netiher the 60fps or translate works. The problem must be internal to the corona sdk. It’s pretty annoying.

What device are you testing on? All i can say is that we have smooth parallax working on iPhone 4 and above with Corona.

My testing devices are samsung galaxy s4 and iphone 4. The parallax movement isn’t so much a concern as is the blurry vibrating effect of the object in motion. Logically I think my programming design is correct, but the issue must lie in the way the corona runtime renders moving objects on screen. I can’t think of any other reason. It shows this way on the simulator and on the device.