generator.sunbeams effect - slow down in device but NOT in simulator ?!

Greetings, I’m experimenting around with the ‘generator.sunbeams’ effect.

I noticed that beyond a certain size, it’ll slowdown the framerate by a lot (from 60fps to 5-10fps).

However, via simulator on same simulated device, there is no slowdown to framerate- it only occurs when I’m testing on the iOS device ( my iPhone 5).

    

Code:  (5 FPS on device, 60 fps on simulator)

local sunShine = display.newRect( display.contentWidth/2, display.contentHeight - 700, display.contentWidth, display.contentHeight )    sunShine.fill.effect = "generator.sunbeams" sunShine.fill.effect.aspectRatio = ( sunShine.width / sunShine.height )

Now if I change the bold parts to this code:

display.contentWidth / 4, display.contentHeight / 4 

Then there is no slow down at all, on actual iOS device or in Simulator device.

Is this effect really that Graphics intensive?  Why does it only affect the device but not the Simulator when I’m testing?  I’m using a CoronaSDK Pro release from a couple months back.  I figured, if anything, the Simulator would be slowing down and not when it’s on iOS device but strangely it’s just the opposite.

Am I doing something wrong?  Thanks

<<Edit - forgot to mention, I just updated my iPhone5 to the latest iOS 8.2>>

Hi @henson802,

What are you doing with the filled rectangle? Is it merely sitting on the screen in a static position, or are you moving it around and effectively re-rendering it a lot?

Brent

Hey @Brent Sorrentino,

It is happening while it’s static.  However, I am using the Camera Perspective library and it is in it’s own Camera ‘group/layer’ but it does NOT move.  I just use the camera group because it’s easier when it comes to layering and ordering my backgrounds/foregrounds/etc.

< Edit > I just took it out of the camera perspective group just to make sure that wasn’t affecting it and it still chugs in framerate.  5 fps.  And it’s definitely static, not moving.

Thanks for any help/input

Hi @henson802,

So, things are moving in relation to the rectangle (behind or in front of it)? Honestly, I haven’t used the sunbeams effect much, but it may be fairly processor-intensive. Would it be possible for you to save that to a snapshot so you’re dealing with a basic object that isn’t being constantly re-rendered with that filter effect?

Brent

@Brent Sorrentino

Yes things are moving in front of it.  I have a scene, and there’s a blue/orange gradient sky background at very back (not moving).  Then in front of that is this Sunbeam Rectangle Object that fills the screen and is filled with the Sunbeam effect.  Then in front of that, I have Camera Perspective elements such as mountains/hills/clouds - and other game elements that are in front of those - which do move.  The Sunbeams shine behind the mountains/hills/clouds to mimic sun during Dawn/Dusk 

The docs do say it’s a relatively intensive effect on some devices.  The simulator has no issues running it, I’m using the simulator for iphone5 and it runs fine.  Then I test it on an actual iphone5 device and it chugs as soon as I load the scene.

I’m not familiar with the snapshot technique , I’ll look it up in the documents and see if that will help.  Thanks appreciate the help!

Using Snapshot made it work, thanks @Brent Sorrentino  !!!

Hi @henson802,

What are you doing with the filled rectangle? Is it merely sitting on the screen in a static position, or are you moving it around and effectively re-rendering it a lot?

Brent

Hey @Brent Sorrentino,

It is happening while it’s static.  However, I am using the Camera Perspective library and it is in it’s own Camera ‘group/layer’ but it does NOT move.  I just use the camera group because it’s easier when it comes to layering and ordering my backgrounds/foregrounds/etc.

< Edit > I just took it out of the camera perspective group just to make sure that wasn’t affecting it and it still chugs in framerate.  5 fps.  And it’s definitely static, not moving.

Thanks for any help/input

Hi @henson802,

So, things are moving in relation to the rectangle (behind or in front of it)? Honestly, I haven’t used the sunbeams effect much, but it may be fairly processor-intensive. Would it be possible for you to save that to a snapshot so you’re dealing with a basic object that isn’t being constantly re-rendered with that filter effect?

Brent

@Brent Sorrentino

Yes things are moving in front of it.  I have a scene, and there’s a blue/orange gradient sky background at very back (not moving).  Then in front of that is this Sunbeam Rectangle Object that fills the screen and is filled with the Sunbeam effect.  Then in front of that, I have Camera Perspective elements such as mountains/hills/clouds - and other game elements that are in front of those - which do move.  The Sunbeams shine behind the mountains/hills/clouds to mimic sun during Dawn/Dusk 

The docs do say it’s a relatively intensive effect on some devices.  The simulator has no issues running it, I’m using the simulator for iphone5 and it runs fine.  Then I test it on an actual iphone5 device and it chugs as soon as I load the scene.

I’m not familiar with the snapshot technique , I’ll look it up in the documents and see if that will help.  Thanks appreciate the help!

Using Snapshot made it work, thanks @Brent Sorrentino  !!!