Hi, I want to create a general refraction shader based on physical laws like Snell's one. I alredy tried to transform his term n1 * sin(a) = n2 * sin(b) while n1 equals the IOR of the surrounding substance and n2 the IOR of the actual Object, a being the input degrees of the light and b the output degrees. (Source of my…
Hmm, I doubt this shader not beeing able to be converted from hlsl to udk. I also cannot see any connection between snells formula and this hlsl-code. The effect simliar to the fresnel is caused by the dot-product of the camera vector and the 3-constant-vector. Example:…
This is where I got it from: http://thangnguyendemo.blogspot.ca/2009/04/new-beginning.html As you can see, it doesn't make a huge amount of difference from a Fresnel to this, it could be because I have a mistake in my setup maybe. Here what happens when I try instead to sample the scene using SceneTexture with this setup…
For one off functions like Drew mentioned it's totally fine, also, stuff like refractions or any other code that's already available to your engine or OS is also fine: http://msdn.microsoft.com/en-us/library/windows/desktop/ff471376%28v=vs.85%29.aspx However, now that I look at it, it seems like you don't need Environment…
Yep that's the way I've always done it too. Implementation note: if you're feeding this into distortion, do not include the boxed bit that moves it from -1 to 1 space into 0 to 1 space. The distortion input is a vector2 input that scrolls the framebuffer around and packing it into 0 to 1 space makes it only distort in one…
I'd argue physically accurate refractions aren't needed for today's use cases anyway. Things like glasses are too small for the inaccuracies to be easy to spot. Heat haze and water move making the inaccuracies hard to spot. Windows are largely flat and don't noticeably refract a great deal. They're nice in raytraced…
That's the problem, isn't it? No matter what you do, you simply cannot achieve the 'real' result as you would wish in any way. Example: http://www.animations.physics.unsw.edu.au/jw/light/Snells_law_and_refraction.htm There are way too many things to consider, and since UDK doesn't even allow the scene-normal buffer to be…