Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Image shader
Started by farjadfarabi_czs Feb 09 2016 07:51 PM

2 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

farjadfarabi_czs

[GLOBAL: userInfoPane.html]
farjadfarabi_czs
  • Enthusiast

  • 97 posts
  • Corona SDK

Hi guys, 

I was looking through the shader codes and found this one really interesting 

http://goo.gl/8LJOfA posted  by Icy Spark 

 

Was wondering if there is a way to apply this to an image?

 

i.e how could i incorporate texturesampler0 into this?  

Thank you. 



[TOPIC: post.html]
#2

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 846 posts
  • Corona SDK

One way is to change the last line to

	return CoronaColorScale(vec4(texture2D(CoronaSampler0, texCoord).rgb * col*texcol,1.0));

This is kind of fun too:

	return CoronaColorScale(vec4(texture2D(CoronaSampler0, texCoord + (col*texcol).xy).rgb * col,1.0));

or

	return CoronaColorScale(vec4(texture2D(CoronaSampler0, texCoord + (col.zyx*texcol).xy).rgb * col,1.0));

(Other swizzlings of col give interesting results too.)



[TOPIC: post.html]
#3

farjadfarabi_czs

[GLOBAL: userInfoPane.html]
farjadfarabi_czs
  • Enthusiast

  • 97 posts
  • Corona SDK

Wow they all look amazing. 

 

Thanks a lot :D




[topic_controls]
[/topic_controls]