XNA RGB Refraction Shader

I implemented a HLSL shader in XNA during the past few days and i’m pretty satisfied with the outcome.
 
The shader takes a few parameters like the usual light position, normal map, cube map and so on, but the most important here is the two refraction indices describing how the light bends, using Snell’s law. There is also one parameter that can be set to true, that will make the light refract differently on each rgb channel.
 
I will share it with you on my XNA Shader Presentation at NITH sometime after the Easter, together with many small post-process shaders I have made recently( Radial Blur, Depth of Field, G.Blur, Sharpen, Emboss, B/W, Invert colors).
 
 
The mesh here is just a simple sphere I generated on the fly, but any loaded 3d model file can be used.
 
Advertisements
This entry was posted in Graphics. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s