Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

About filters..
Started by PXL artificer Aug 08 2013 12:54 AM

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

PXL artificer

[GLOBAL: userInfoPane.html]
PXL artificer
  • Contributor

  • 312 posts
  • Corona SDK

I'm liking the new filters, but I'm not too crazy about how to apply them.
I would prefer a simpler syntax like
 

object:applyFilter(options) 

 
where options is something like
options={
  filter="saturation",
  saturation=.8
}

maybe with a :clearFilter() method to restore the original image.
 
Also, I was wondering, how can I apply more than a filter to an image?
I've tried applying a filter and then capturing a screenshot with display.capture, but it's crashing corona.
Using the new method display.newSnapshot, I've been able to apply two filters, but only sometimes (it's also crashing from time to time).
 
Generally, I'd really like to be able to apply more than a filter at the same time without using display.capture and similar. Maybe with a syntax like applyFilter(filter1, filter2, filter3, ....)
where filter1 is a table containing the filter name as well as its params.
 

Ah, and I'd like to have more params for the filters (especially the blur, a radius would be great)


But anyway, good job! Great to see the first steps of Graphics 2.0!



[TOPIC: post.html]
#2

PXL artificer

[GLOBAL: userInfoPane.html]
PXL artificer
  • Contributor

  • 312 posts
  • Corona SDK

Another thing, filter.contrast does not seems to work (I'm always getting a white rectangle when I apply it)



[TOPIC: post.html]
#3

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

This is known as multipass filtering, and it's something I really am pushing the team to get done for the first public release of graphics 2.0



[TOPIC: post.html]
#4

horacebury

[GLOBAL: userInfoPane.html]
horacebury
  • Corona Geek

  • 3,070 posts
  • Corona SDK

On the subject of multipass filtering: Is this something which will work the same (from the Lua POV) across iOS and Android?

 

iOS devices have a lot of support for this sort of thing, as we can see in iOS7, but AFAIK Android is woefully underpowered in this area. (Thus, I imagine there are a lot of problems to overcome for you guys.)



[TOPIC: post.html]
#5

jstrahan

[GLOBAL: userInfoPane.html]
jstrahan
  • Corona Geek

  • 1,926 posts
  • Corona SDK

just a thought would setting a filters then use snapshot then set another filter work? i know its now ideal but could be a work around until multipass is implemented



[TOPIC: post.html]
#6

cem6

[GLOBAL: userInfoPane.html]
cem6
  • Observer

  • 1 posts
  • Enterprise

Will there be a way to provide custom filters? I assume that filters are implemented as pixel-shaders, will be there a way to provide our own shader-code?



[TOPIC: post.html]
#7

PXL artificer

[GLOBAL: userInfoPane.html]
PXL artificer
  • Contributor

  • 312 posts
  • Corona SDK

Just tried the new beta...
The multitexturing with normal mapping (normalMapWith1PointLight) is impressive... it's really going to be awesome to add effects like those to games and app!

One question, besides for normal mapping, are there other uses/options for the table multitextures? Maybe multipass filtering? 


I mean, refeering to this code 

local multitexture =
{
    type="composite",
    paint1={ type="image", filename="moon.png" },
    paint2={ type="image", filename="moon_norm.png" }
}
 
local object = display.newRect( 0, 0, 640, 640 )
object.fill = multitextureobject.fill.effect = "filter.normalMapWith1PointLight"
 
any other options available besides type="composite" /paint1/paint2/filename?

Thank you


[TOPIC: post.html]
#8

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

Yes, you can use composites to use the various Photoshop blend modes --- I forgot to mention that in my e-mail!

 

See the "composite" section on: http://docs.coronalabs.com/tachyon/guide/graphics/effects.html



[TOPIC: post.html]
#9

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

BTW, multipass is something we're playing with internally --- it's what enables the bloom filter to operate.



[TOPIC: post.html]
#10

PXL artificer

[GLOBAL: userInfoPane.html]
PXL artificer
  • Contributor

  • 312 posts
  • Corona SDK

Oh I see Walter, yes it's working...

 

So testing the new engine... I was moving, using sin/cos, a light on a texture with normal maps when I also tried changing the object.path points in the runtime function.

Daaaamn we can also distort the objects while applying and modifying filters in real time :D.. Guys, the graphic 2.0 engine ROCKS! Really impressed :)



[TOPIC: post.html]
#11

walter

[GLOBAL: userInfoPane.html]
walter
  • Moderator

  • 726 posts
  • Alumni

Yup, I've been meaning to talk about 2.5D at the same time you run a filter --- do you have a cool sample to share? :)



[TOPIC: post.html]
#12

PXL artificer

[GLOBAL: userInfoPane.html]
PXL artificer
  • Contributor

  • 312 posts
  • Corona SDK

Right now it's just messy code :) But I'll see if I can do something cool in the weekend




[topic_controls]
 
[/topic_controls]