[Effect] Refraction

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Tue Jul 14, 2009 10:51 pm

[size=200:3pvs1iil]What is it[/size:3pvs1iil]
Effect : Refraction effect
Author : Hctor Barreiro Cabrera
Minium Pixel Shader : 2.0

[size=200:3pvs1iil]Description[/size:3pvs1iil]
This effect refracts the objects underneath it through the use of a normalmap texture. This effect is useful for distortioning images to make effects like glass or water refraction. The key difference with the distort effect is that this one the distortion over each axis is controllable through the normal's color channels.

The channels assigned to each axis are the following:
[code:3pvs1iil]- Red : X
- Green : Y
- Blue : Z (unused)[/code:3pvs1iil]

From there, the color applied on the normal map will determine the amount to displace. 127 (0.5) means no distortion, 255 means the pixel will be displaced to the right, and 0 means the pixel will be displaced to the left.

The amount of displacement is also configurable through the parameter in the effect's properties. It will tell the shader how much the pixel will be displaced when doing a full displacement, and it will be interpolated accordingly.

For a more info on how the normal maps work, refer to the example and/or google for "Normal mapping".

[size=200:3pvs1iil]Download[/size:3pvs1iil]
Download the effect.
Download the example (Made with Construct 99.4 beta).

Disclaimer: The example images contained within the example file were not made by me, but downloaded through a Google search. I claim no rights about the images, they belong to their authors.

[size=200:3pvs1iil]Screenshots[/size:3pvs1iil]

B
1
G
5
Posts: 8
Reputation: 1,241

Post » Tue Jul 14, 2009 11:35 pm

That is a really sweet effect. Awesome job :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Jul 14, 2009 11:59 pm

Wow very nice effect. Good work!
B
2
S
1
G
3
Posts: 193
Reputation: 1,486

Post » Thu Jul 16, 2009 6:03 pm

really nice. :mrgreen:
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Thu Jul 16, 2009 6:57 pm

Great :)

Did you deliberately use point filtering for a more pixelly look?
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Sun Apr 04, 2010 12:26 am

Sorry to sound like a noob.
But how do you install this.
B
3
G
2
Posts: 16
Reputation: 707

Post » Sun Apr 04, 2010 12:44 am

B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Post » Sun Apr 04, 2010 1:00 am

[quote="smartcartridge":388bttec]Sorry to sound like a noob.
But how do you install this.[/quote:388bttec]
Download the .fx file and place it in the "Effects" folder inside of the Construct folder. You should find the Construct folder under the Scirra folder in Program Files, assuming you didn't change the installation path.

@Lost my Keys - Yes, it's an old topic, but he's asking a question relative to the topic at hand, so there's nothing wrong.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Sun Apr 04, 2010 2:29 am

I bet LMK has had that image for ages and just really wanted to use it ;)
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Sun Apr 04, 2010 5:41 am

[quote="Ashley":2gv9jcgg]I bet LMK has had that image for ages and just really wanted to use it ;)[/quote:2gv9jcgg]

Years :D
B
3
S
2
G
3
Posts: 628
Reputation: 2,531

Next

Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests