Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Blur effect problems
Started by horacebury Sep 11 2013 03:31 PM

11 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,070 posts
  • Corona SDK

Should this work?

local c = display.newCircle( 300, 300, 250 )
c:setFillColor( 255,0,0 )
c.fill.effect = "filter.blur"

Seems like the blur effect only works on images. Is that right?

 



[TOPIC: post.html]
#2

jonjonsson

[GLOBAL: userInfoPane.html]
jonjonsson
  • Corona Geek

  • 1,051 posts
  • Corona SDK

When you blur a solid color, you see no blur except on the edges. Haven't tried filters much but I guess the effect can not go over the edge?



[TOPIC: post.html]
#3

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

Yes, the blur only extends as far as the bounds of the rect (or polygon, as the case may be).



[TOPIC: post.html]
#4

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,070 posts
  • Corona SDK

Ah. How would I go about blurring the edges of a circle?

[TOPIC: post.html]
#5

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

One way is to put it in a snapshot and apply the blur on the snapshot --- you just have to make the snapshot large enough, and center the circle inside the snapshot.



[TOPIC: post.html]
#6

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,070 posts
  • Corona SDK

What if I applied it to a display group which has two circles inside it, one large white circle and one smaller, lets say, red circle. Would that blur the edge of the red circle, effectively? Sorry, on a train and can't test it right now. I'm trying to get as much if the graphics in my game to be programmatically rendered with image files (being inspired by the Designed by Apple video.)

[TOPIC: post.html]
#7

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,070 posts
  • Corona SDK

Also, is blur the only filter with no opens? Either on or off, no degrees of effect, etc?

[TOPIC: post.html]
#8

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

There's a blurGaussian effect, but there's a bug in it in DP 2/Alpha 2.

 

In the next update, the syntax will look like:

 

object.fill.effect = "filter.blurGaussian"

object.fill.effect.horizontal.radius = 2

object.fill.effect.vertical.radius = 2

 

The gaussian blur operates in a multipass fashion (a horizontal and vertical pass) so you have to set the radius for each path, or you could set them to different values.



[TOPIC: post.html]
#9

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,070 posts
  • Corona SDK

I've tried this:

local group = display.newGroup()
local back = display.newCircle( 350, 350, 200 )
local image1 = display.newCircle( 350, 350, 150 )
image1:setFillColor(255,0,0)
group.fill.effect = "filter.blue"

Which produced this error:

attempt to index field 'fill' (a nil value) 

on the last line.

 

Also, am I the only one who finds it strange to set a string and then set table values against it?



[TOPIC: post.html]
#10

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,070 posts
  • Corona SDK

aaaaaand... one last request:

 

How would I replicate the iOS7 Control Center effect, also seen in Yahoo's latest Weather app?

 

I thought the filters could be applied to display groups.



[TOPIC: post.html]
#11

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

Filter effects cannot be applied to groups. You can, however, apply them to snapshots



[TOPIC: post.html]
#12

jonjonsson

[GLOBAL: userInfoPane.html]
jonjonsson
  • Corona Geek

  • 1,051 posts
  • Corona SDK

There's a blurGaussian effect, but there's a bug in it in DP 2/Alpha 2.

 

In the next update, the syntax will look like:

 

object.fill.effect = "filter.blurGaussian"

object.fill.effect.horizontal.radius = 2

object.fill.effect.vertical.radius = 2

 

The gaussian blur operates in a multipass fashion (a horizontal and vertical pass) so you have to set the radius for each path, or you could set them to different values.

 

I'm trying this syntax and no matter the value there is an extreme amount of blur and no change if I changen the radius.

 

local object = display.newImageRect("test.jpg", _W, _H)
object.fill.effect = "filter.blurGaussian"
local amount = 10
object.fill.effect.horizontal.radius = amount
object.fill.effect.vertical.radius = amount

 

Looks like this, no matter the amount specified: UrI7nk8.png

 

Photoshop same image with 10 radius: 70tK0yC.png

 

Same problem with 

object.fill.effect = "filter.blurHorizontal"
local amount = 1
object.fill.effect.radius = amount
 
Same horizontal blur no matter what amount.
 
Edit: Daily build 103



[topic_controls]
 
[/topic_controls]