Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

transition aperture glitches on older devices.
Started by OCG Studios Oct 05 2018 01:09 AM

4 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

OCG Studios

[GLOBAL: userInfoPane.html]
OCG Studios
  • Enthusiast

  • 80 posts
  • Corona SDK

Hello,

 

I am trying to transition a rects aperture to 1. While it works on newer devices, on the iPad air 1st and 2nd generation it inverts rapidly.

 

here is the code for the rect and transition

	local irisRect = display.newRect(display.screenOriginX + _x,display.screenOriginY + display.screenOriginY +  _y + 2, display.viewableContentWidth , display.viewableContentHeight )
	irisRect:setFillColor(0, 0, 0, 1)
	irisRect.anchorX, irisRect.anchorY = 1, 1
	irisRect.fill.effect = "filter.iris"
	 
	irisRect.fill.effect.center = { 0.5, 0.5 }
	-- local info = system.getInfo("architectureInfo")
 --                    if  string.find(info, "iPhone11,6" ) or string.find(info, "iPhone10,6" ) or string.find(info, "iPhone10,3" ) or string.find(info, "iPhone11,8" ) or string.find(info, "iPhone11,2" ) or string.find(info, "iPhone11,4" )  then
                    	irisRect.fill.effect.center = { 0.5, 0.6 }
                    	irisRect.height = irisRect.height + 5
                    --end

	irisRect.fill.effect.aperture = 0.3 * scale
	irisRect.fill.effect.aspectRatio = ( irisRect.width / irisRect.height )
	irisRect.fill.effect.smoothness = 0

transition.to(irisRect.fill.effect, {time = duration, aperture = 1})

If someone has any idea why it runs smoothly on newer devices but glitches/inverting on some older devices I would like to hear it.

 

Thanks in advance!



[TOPIC: post.html]
#2

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 189 posts
  • Corona SDK

What do you mean by glitching or inverting? Is the transition going the wrong way, not working at all or is it simply lagging?

If this is about the effect's transition lagging, then it could simply be the case of the old device not being able to handle the effect's transition smoothly due to insufficient memory, for instance.



[TOPIC: post.html]
#3

OCG Studios

[GLOBAL: userInfoPane.html]
OCG Studios
  • Enthusiast

  • 80 posts
  • Corona SDK

https://imgur.com/a/xl0YEg5

 

In this image the middle is see through and the borders are black de see through dot is supposed to transition bigger to eventually reveal the scene.

 

What happens on the iPad air 1s and 2nd gen is that the border and dot rapidly switch from being see through to black over and over again. while on other devices(some even older that those iPads) the transitions is successful.

 

So my question is does anyone know why this may occur.

 

thanks!



[TOPIC: post.html]
#4

XeduR @Spyric

[GLOBAL: userInfoPane.html]
XeduR @Spyric
  • Contributor

  • 189 posts
  • Corona SDK

Hmm... this is purely a guess, but it probably has something to do with texture memory usage and rendering execution.

The docs on the filter effects mention that: "Certain parameters have a direct influence on the execution time of an effect. This applies to both the initial rendering and any re-execution events. For example, if an object is moved/transitioned, the effects applied to it are re-executed. Thus, you should be careful when setting the parameters of an effect, especially those like "filter.blurGaussian". If possible, we recommend that you test applicable projects on actual devices."

It could be that due to the high resolution of iPad air devices, the required texture memory for the iris effect is much higher than on lower resolution devices, which explains why other older devices don't have the same issue.



[TOPIC: post.html]
#5

OCG Studios

[GLOBAL: userInfoPane.html]
OCG Studios
  • Enthusiast

  • 80 posts
  • Corona SDK

I will look into the texture memory.

 

thanks for the info! have a great day!




[topic_controls]
[/topic_controls]