Unless I misunderstood, couldn't you just use the Custom Node and put in "refraction" instead of making out the entire code manually? Same cost last I checked around.
Seems like there would be some long steps you need to do to get an inverse sine, tangent or cosine. Definitely not practical anyways... If you really need this, you could always use a custom code node like this...
Already my first try returned some strange results. (Transform : Tangent -> View) 1: With this shader I reached a scene-texture, which rotated itself with the object. This means if a object is rotated about 180 degrees it gives some effects similiar to a reflection: 2: Not surprisingly this setup produces huge artefacts:…
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:…
Drew++: Thank you, I did not know this was possible through the custom node. Ace-Angel: Everything I read until now told me to use custom nodes as less as possible, because of them being so hard to compute compared to the standard nodes. So i would rather translate it to the usual nodes. Or is there already an implemented…
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…
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…