filter.blurGaussian problem!

hi all,

i’ve a code that creates a shadow of objects using “filter.blurGaussian”.

i use display.save to create a temp file of the blurred image. if i use the blurred image it will slow down the device…so using the temp file will not slow down the device.

the problem is in some old device (tested on a “old” 3-year samsung with android 4.2.2) it will not create the shadow effect. it will create a white image. in rest of the devices i tested from android 5 to 7 it will show a perfect shadow. ios all ok also.

i tried using “filter.blur” in the old device and it worked fine so i guess is “filter.blurGaussian” that is messing up.

filter.blur is very limited so i want to use it only if can’t use the more capable “filter.blurGaussian”.

my question is. is there a way to detect if a device is capable of using the “filter.blurGaussian”?

i can use system.getInfo( “gpuSupportsHighPrecisionFragmentShaders” ) for some filters, but in the documents they don’t say about  “filter.blurGaussian”.

regards,

carlos.

I was going to say system.getInfo( “gpuSupportsHighPrecisionFragmentShaders” ) but you would need to test on some old devices?

i tried detecting with  system.getInfo( “gpuSupportsHighPrecisionFragmentShaders” ) , but it failed.

if it’s an android version problem, i could easily code that, but if it’s not, i’m lost.

for now, I made the shadows with a different approach. using gradients I was able to mimic almost to the same level of detail that I had with blur effect. it’s much faster to build with an almost same level of detail. I’m happy with that.

still, I don’t know if it’s a corona bug or not, because filter.blurGaussian will produce a white rectangle if I apply it to a snapshot area. i could only reproduce that in the old android 4.2.2 device.

you can test yourself if your device have that limitation or not. just run this code (your background should be white):

local shadow=display.newCircle( 0,0, 28) shadow:setFillColor(0,0,0,1) local snapshot = display.newSnapshot( 100, 100) snapshot.group:insert( shadow ) snapshot.fill.effect = "filter.blurGaussian" snapshot.fill.effect.horizontal.blurSize = 40 snapshot.fill.effect.horizontal.sigma = 8 snapshot.fill.effect.vertical.blurSize = 40 snapshot.fill.effect.vertical.sigma = 8 snapshot:translate(display.contentWidth\*.5, display.contentHeight\*.5) snapshot:invalidate()

I was going to say system.getInfo( “gpuSupportsHighPrecisionFragmentShaders” ) but you would need to test on some old devices?

i tried detecting with  system.getInfo( “gpuSupportsHighPrecisionFragmentShaders” ) , but it failed.

if it’s an android version problem, i could easily code that, but if it’s not, i’m lost.

for now, I made the shadows with a different approach. using gradients I was able to mimic almost to the same level of detail that I had with blur effect. it’s much faster to build with an almost same level of detail. I’m happy with that.

still, I don’t know if it’s a corona bug or not, because filter.blurGaussian will produce a white rectangle if I apply it to a snapshot area. i could only reproduce that in the old android 4.2.2 device.

you can test yourself if your device have that limitation or not. just run this code (your background should be white):

local shadow=display.newCircle( 0,0, 28) shadow:setFillColor(0,0,0,1) local snapshot = display.newSnapshot( 100, 100) snapshot.group:insert( shadow ) snapshot.fill.effect = "filter.blurGaussian" snapshot.fill.effect.horizontal.blurSize = 40 snapshot.fill.effect.horizontal.sigma = 8 snapshot.fill.effect.vertical.blurSize = 40 snapshot.fill.effect.vertical.sigma = 8 snapshot:translate(display.contentWidth\*.5, display.contentHeight\*.5) snapshot:invalidate()