{"id":3633,"date":"2014-04-30T21:58:39","date_gmt":"2014-04-30T19:58:39","guid":{"rendered":"http:\/\/www.book.artbeeweb.nl\/?p=3633"},"modified":"2014-05-08T17:08:39","modified_gmt":"2014-05-08T15:08:39","slug":"whats-the-raytrace-refract-node-used-for","status":"publish","type":"post","link":"http:\/\/www.book.artbeeweb.nl\/?p=3633","title":{"rendered":"What\u2019s the Raytrace > Refract node used for?"},"content":{"rendered":"<p>Nodes are the essential building blocks in the Advanced interface to the Poser Material Room. They are the graphical representation of mathematical function calls, that is: calculation procedures which turn parameters (inputs) to a result (output).<\/p>\n<p><strong>Intermediate<\/strong><\/p>\n<p>Abstractly spoken, any object surface is the separation of two volumes: the \u2018inside\u2019 part and the \u2018outside\u2019 part relative to the object. When both parts are transparent to some extent, a light ray can pass through the surface. And when both parts consist of different stuff, with a different \u2018optical density\u2019 (like air and water, water and glass, \u2026) then the light ray gets bend at the surface because the speed of light is different at both sides.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.book.artbeeweb.nl\/wp-content\/gallery\/postpmra\/PMRA.60.01.jpg\" alt=\"\" width=\"800\"\/><\/p>\n<p>This is \u2018refraction\u2019, and by inventing an <strong>Index of Refraction<\/strong> (IOR), being 1.0 for vacuum, each material can have its own value defining its optical properties. In other words, the IOR defines the amount of refraction, the extent of light ray-bending, at the surface.<\/p>\n<p>The image below illustrates transparency without refraction (left pawn) and refraction without transparency (right pawn). Without refraction the background image passes through undeformed, with refraction the pawn shows a glass-like behavior. As I can see, Poser refraction takes care of transparency all by itself (*).<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.book.artbeeweb.nl\/wp-content\/gallery\/postpmra\/PMRA.60.02.jpg\" alt=\"\" width=\"800\"\/><\/p>\n<p>This Refract node adds accurate (*), raytraced refraction to the PoserSurface material definition. It requires Raytracing in Render Settings to be switched ON. The quality of the result depends on the \u2018Number of Bounces\u2019 set in Render Settings as well. Passing through a surfaces counts as a bounce, so entering and leaving a transparent object requires two bounces. The number set is a maximum value, when Poser does not need them it won\u2019t use them, but if the number of bounces for a light ray exceeds this limit, the light ray is killed. This might speed up the rendering while it also might introduce artifacts (black spots) in the result. The tradeoff is mine, but as nature has an infinite number of bounces, the max value is the best when I can afford it.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.book.artbeeweb.nl\/wp-content\/gallery\/postpmra\/PMRA.60.03.jpg\" alt=\"\" width=\"400\"\/>  <img decoding=\"async\" src=\"http:\/\/www.book.artbeeweb.nl\/wp-content\/gallery\/postpmra\/PMRA.60.04.jpg\" alt=\"\" width=\"400\"\/><br \/>\nLeft: Raytrace bounces set to 4, while 4 objects require 8 bounces. Right: When the value is increased to 8 or more, all objects and surfaces can be passed.<\/p>\n<p>(*) Notes:<\/p>\n<ul>\n<li>Refraction only handles the light from objects in the surrounding scene. It does not cater for the rays from direct light sources (spot, point, etc. lights), these will not get bend at all. Refraction does not work for light passing through an object shining onto another object: refractive objects behave opaque to direct light and make deep shadows accordingly. But Transparency behaves as expected, as discussed in other\u00a0<a title=\"click for details\" href=\"\/?p=3548\">basic<\/a> and\u00a0<a title=\"click for details\" href=\"\/?p=3641\">advanced<\/a>\u00a0articles. In other words: basically Poser transparency and refraction are supposed NOT to be mixed, but in various cases you\u2019ll need to. Mixing them will introduce<a title=\"click for details\" href=\"\/?p=3641\"> a lot of issues<\/a>, including a serious slowdown of rendering.<\/li>\n<li>At the moment (Poser versions up till Poser 10 \/ Pro 2014 SR3) raytraced refraction is in error, as the ray leaving the object towards the camera is bend the wrong way. In real life, a light ray should bent \u2018forward\u2019 when entering the object, \u2018backward\u2019 again when leaving he object, and as a result it should continue its journey parallel to its original path but just shifted in space. Currently in Poser the ray bends in the same direction twice. It\u2019s said to be repaired in Service Release SR4.<\/li>\n<\/ul>\n<p><strong><em>Practical use<\/em><\/strong><\/p>\n<p>I want to use refraction when a material represents liquid or glass, but in real life such transparent materials are reflective as well. And actually, those two phenomena are in a complex balance: the more refractive a material, the more reflective it will be too. On top of that, real life transparency and reflectivity both depend on the angle the camera looks at the surface. The skewer the angle, the more reflective the surface becomes, and the less light is left to pass through. That makes the surface less transparent (and not: less refractive, the bends will be the same). These combined issues are knows as the \u201cFresnel effect\u201d, and supported in Poser by the <a title=\"click for details\" href=\"\/?p=3639\">Fresnel node<\/a> and the <a title=\"click for details\" href=\"\/?p=3677\">Fresnel_Blend node<\/a>.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.book.artbeeweb.nl\/wp-content\/gallery\/postpmra\/PMRA.60.05.jpg\" alt=\"\" width=\"800\"\/><br \/>\nThe right pawn still shows refraction as before, the left pawn shows Fresnel. Especially the upper edge of the left pawn clearly shows that Fresnel is not only transmitting the wall at its back, but also is reflecting it. Those reflections are missing on the right pawn.<\/p>\n<p>About the Refract node parameters:<br \/>\n<img decoding=\"async\" src=\"http:\/\/www.book.artbeeweb.nl\/wp-content\/gallery\/postpmra\/PMRA.60.06.jpg\" alt=\"\" \/><br \/>\nThe <strong>Index Of Refraction<\/strong> is discussed above. Values for various materials can be found <a title=\"click for details\" href=\"\/?p=3575\">here<\/a>.<\/p>\n<p><strong>Quality<\/strong> offers a tradeoff between speed and result; high values require longer render times but present crispier results. <strong>Softness<\/strong> increases the blur of the refracted image, representing irregularities, impurities and even minor movements and vibrations in the refracting surface.<\/p>\n<p><strong>RayBias<\/strong> is a special feature to address a special issue, regarding the refraction on image-based displaced surfaces. RayBias is a distance, in the Poser units as set in my User Interface preferences. The default is 0.3 inch or 0.007620 meters as in the screen grab above. Poser takes the refracting surface, moves it for this distance outwards from the object, then it calculates the refractions, and then it projects those refractions onto the surface of the object itself. This way, all irregularities of the refracting surface which are smaller than this distance are disregarded, usually these are caused by the details of displacement maps. It speeds up refraction calculations considerably, but it does introduce artifacts and less accurate refractions as a downside. For that reason, one should not have this value larger than the amount of displacement in the same PoserSurface material definition. The 0.3\u201d (0.76cm) default value is quite a lot, actually.<\/p>\n<p><strong>Refraction Color<\/strong> (in the PoserSurface column) gives color to the material, like red to wine or sapphire. But do note that this is a surface effect only, like a colored plastic cover around the object. Poser cannot do volumetrics, the wine will be equally red whatever way I look at it, and the glass will be equally red whatever the thickness.<\/p>\n<p>The contribution of refraction to the total surface definition will be made up from the combination of Refraction_Color * <strong>Refraction_Value<\/strong>. This does not hold for the refractive effect itself, which is determined by the IoR. To represent a dark colored material, I can either use a dark color in the swatch, or a low value. Note that Color will be affected by Gamma Correction, the Value will not so 80% White and 100% Value will behave different from 100% White and 80% Value under GC render conditions. For that reason, it\u2019s recommended to leave Value at 1.0 and put all adjustments into the color swatch.<\/p>\n<p><strong><em>Rendering<\/em><\/strong><\/p>\n<p>Raytraced refractions and reflections are realistic, detailed, and although Poser performs them quite efficient they are time and resource consuming at render time. As a consequence, one should be careful not to put too many raytracing intensive challenges into one scene. InDirect Lighting (IDL) is such a challenge, having a lot of reflective and\/or refractive surfaces in one scene is a challenge, having reflections and refraction (and especially Fresnel) on a complex surface is a challenge, and having Max Bounces (and the IDL Quality options) set high in Render Settings make a challenge as well. Take the Refraction vs Fresnel image shown above. It\u2019s IDL, and reflective wall and floor, and quite high values in Render Settings. Rendering on a fast machine took 3.5 hours. Poser does have its limitations. There are no meaningful fast alternatives for refraction, like we have image-maps or environmental maps for reflections. Sorry for that.<\/p>\n<p>On top of all those things, Poser raytracing is designed to work with a completely non-transparent surface; refraction caters for (full) transparency on its own. While doing so, raytracing works for objects in the scene only, it cannot handle direct light, nor the shadows or specularity thereof. <a title=\"click for details\" href=\"\/?p=3641\">Mixing raytracing with transparency <\/a>however might produce unexpected or even erroneous results, while also taking render time to infinity.<\/p>\n<p style=\"text-align: right;\"><a href=\"\/?p=3635\">Next &gt;<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nodes are the essential building blocks in the Advanced interface to the Poser Material Room. They are the graphical representation of mathematical function calls, that is: calculation procedures which turn parameters (inputs) to a result (output). Intermediate Abstractly spoken, any object surface is the separation of two volumes: the \u2018inside\u2019 part and the \u2018outside\u2019 part &hellip; <a href=\"http:\/\/www.book.artbeeweb.nl\/?p=3633\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;What\u2019s the Raytrace > Refract node used for?&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[5],"tags":[145,133],"series":[127],"class_list":["post-3633","post","type-post","status-publish","format-standard","hentry","category-poser","tag-material-room","tag-poser","series-matroom-intermediate"],"_links":{"self":[{"href":"http:\/\/www.book.artbeeweb.nl\/index.php?rest_route=\/wp\/v2\/posts\/3633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.book.artbeeweb.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.book.artbeeweb.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.book.artbeeweb.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.book.artbeeweb.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3633"}],"version-history":[{"count":4,"href":"http:\/\/www.book.artbeeweb.nl\/index.php?rest_route=\/wp\/v2\/posts\/3633\/revisions"}],"predecessor-version":[{"id":4299,"href":"http:\/\/www.book.artbeeweb.nl\/index.php?rest_route=\/wp\/v2\/posts\/3633\/revisions\/4299"}],"wp:attachment":[{"href":"http:\/\/www.book.artbeeweb.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.book.artbeeweb.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3633"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.book.artbeeweb.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3633"},{"taxonomy":"series","embeddable":true,"href":"http:\/\/www.book.artbeeweb.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fseries&post=3633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}