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:…
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…
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:…
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…
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…