{"id":186,"date":"2016-09-17T17:59:46","date_gmt":"2016-09-18T00:59:46","guid":{"rendered":"http:\/\/www.artifisizzler.com\/?p=186"},"modified":"2019-03-11T01:39:54","modified_gmt":"2019-03-11T01:39:54","slug":"more-about-texture-coordinates","status":"publish","type":"post","link":"http:\/\/www.decscroll.com\/blog\/2016\/09\/17\/more-about-texture-coordinates\/","title":{"rendered":"More About Texture Coordinates"},"content":{"rendered":"<p>While creating the Red Oak shader, we used the &#8220;Object&#8221; coordinates:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-001.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-001.png?resize=357%2C448\" alt=\"texcoord-001\" width=\"357\" height=\"448\" class=\"aligncenter size-full wp-image-187\" srcset=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-001.png?w=357 357w, https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-001.png?resize=239%2C300 239w\" sizes=\"auto, (max-width: 357px) 100vw, 357px\" \/><\/a><\/p>\n<p>I mentioned that this will make the wood shader three-dimensional, as if our objects are carved out of a solid block of wood.  The reason is that the Object used for the coordinates is by default the object that the shader is applied to.  For example, if we duplicate our board that we used to create the shader, you can see that the texture coordinates are the same on both objects:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-002.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-002.png?resize=640%2C415\" alt=\"texcoord-002\" width=\"640\" height=\"415\" class=\"aligncenter size-full wp-image-188\" srcset=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-002.png?w=707 707w, https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-002.png?resize=300%2C194 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>However, you can actually set the object to anything you want, and your texture coordinates are based on the object selected.  Create an Empty and place it at the center of the first object (in this case it&#8217;s the origin):<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-003.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-003.png?resize=640%2C363\" alt=\"texcoord-003\" width=\"640\" height=\"363\" class=\"aligncenter size-full wp-image-189\" srcset=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-003.png?w=847 847w, https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-003.png?resize=300%2C170 300w, https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-003.png?resize=768%2C435 768w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Now, in the Texture Coordinates, select the Object field and choose the Empty object:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-004.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-004.png?resize=359%2C243\" alt=\"texcoord-004\" width=\"359\" height=\"243\" class=\"aligncenter size-full wp-image-190\" srcset=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-004.png?w=359 359w, https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-004.png?resize=300%2C203 300w\" sizes=\"auto, (max-width: 359px) 100vw, 359px\" \/><\/a><\/p>\n<p>You can now see that both objects seem to be cut from the same piece of wood because they share the same texture coordinates:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-005.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-005.png?resize=559%2C415\" alt=\"texcoord-005\" width=\"559\" height=\"415\" class=\"aligncenter size-full wp-image-191\" srcset=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-005.png?w=559 559w, https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-005.png?resize=300%2C223 300w\" sizes=\"auto, (max-width: 559px) 100vw, 559px\" \/><\/a><\/p>\n<p>Moving the empty to the space inbetween the objects, you can see the coordinates track the empty:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-006.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-006.png?resize=614%2C458\" alt=\"texcoord-006\" width=\"614\" height=\"458\" class=\"aligncenter size-full wp-image-192\" srcset=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-006.png?w=614 614w, https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-006.png?resize=300%2C224 300w\" sizes=\"auto, (max-width: 614px) 100vw, 614px\" \/><\/a><\/p>\n<p>If you wanted to make objects that appear to be cut from the same block of material, you now have a very simple way to do so.  For example, you could make a diagram showing how a log is cut into boards:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-007.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-007.png?resize=490%2C460\" alt=\"texcoord-007\" width=\"490\" height=\"460\" class=\"aligncenter size-full wp-image-193\" srcset=\"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-007.png?w=490 490w, https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-007.png?resize=300%2C282 300w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/a><\/p>\n<p>Even if you only have one object with the shader applied to it, using an Empty in this way gives you a convenient &#8220;handle&#8221; to adjust an object&#8217;s texture coordinates visually, rather than typing numbers.  <\/p>\n<p>Next post I&#8217;ll talk a bit about using a different coordinate system for the wood shader!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While creating the Red Oak shader, we used the &#8220;Object&#8221; coordinates: I mentioned that this will make the wood shader three-dimensional, as if our objects are carved out of a solid block of wood. The reason is that the Object used for the coordinates is by default the object that the shader is applied to&#8230;.<\/p>\n","protected":false},"author":2,"featured_media":192,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[1],"tags":[4,7,8,13,15],"class_list":["post-186","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-blender","tag-coordinates","tag-cycles","tag-shader","tag-tutorial"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.decscroll.com\/blog\/wp-content\/uploads\/2016\/09\/texcoord-006.png?fit=614%2C458","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paMavh-30","_links":{"self":[{"href":"http:\/\/www.decscroll.com\/blog\/wp-json\/wp\/v2\/posts\/186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.decscroll.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.decscroll.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.decscroll.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.decscroll.com\/blog\/wp-json\/wp\/v2\/comments?post=186"}],"version-history":[{"count":1,"href":"http:\/\/www.decscroll.com\/blog\/wp-json\/wp\/v2\/posts\/186\/revisions"}],"predecessor-version":[{"id":633,"href":"http:\/\/www.decscroll.com\/blog\/wp-json\/wp\/v2\/posts\/186\/revisions\/633"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.decscroll.com\/blog\/wp-json\/wp\/v2\/media\/192"}],"wp:attachment":[{"href":"http:\/\/www.decscroll.com\/blog\/wp-json\/wp\/v2\/media?parent=186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.decscroll.com\/blog\/wp-json\/wp\/v2\/categories?post=186"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.decscroll.com\/blog\/wp-json\/wp\/v2\/tags?post=186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}