Wednesday, March 24, 2010

Shader By Accident ...

Its really sad on my part that I hardly get time to work on my most favorite area in Graphics Programming, Shaders. But whenever I find some, I keep on mingling around them to produce something good looking ( but worthless ) shader like in this post.

I was reading about Fresnel Shader to be specific, & was working on a math part of Refraction. Obviously, HLSL's standard refraction function is not a good choice being costly. So, i decided to play around with standard snell's law. I decided to play around various combinations of Fresnel term, multiplied or Added with Refraction & reflection term which I evaluated using standard math. Added cubemap for reflectivity, few multiplier constants here & there ... Tada! .. i got my strange shader which actually is not that bad look wise , to me it looks more like fine shiny metal thingy.










Feel free to give your opinions on the same. As always, my shader code is available on request.


1 comment:

Altaf said...

Cool