{"id":168,"date":"2011-11-28T02:02:02","date_gmt":"2011-11-28T02:02:02","guid":{"rendered":"http:\/\/www.west-racing.com\/mf\/?page_id=168"},"modified":"2011-12-12T21:46:05","modified_gmt":"2011-12-12T21:46:05","slug":"displace","status":"publish","type":"page","link":"http:\/\/www.west-racing.com\/mf\/?page_id=168","title":{"rendered":"Displace"},"content":{"rendered":"<p>Displace vertices based on their normal and a texture lookup for the amount.<\/p>\n<p><a href=\"http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2011\/11\/megadisplace.jpg\"><img loading=\"lazy\" src=\"http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2011\/11\/megadisplace.jpg\" alt=\"\" title=\"megadisplace\" width=\"244\" height=\"267\" class=\"alignright size-full wp-image-701 fancy\" \/><\/a><\/p>\n<h3>Displace Param Description<\/h3>\n<h4><strong>Map<\/strong><\/h4>\n<p>Texture to control the displacement, uv coords for a vertex govern the lookup pos. Texture must be readable.<\/p>\n<h4><strong>Amount<\/strong><\/h4>\n<p>Amount to displace vertex which is modulated by the texture lookup.<\/p>\n<h4><strong>Offset<\/strong><\/h4>\n<p>UV offset, use for scrolling.<\/p>\n<h4><strong>Scale<\/strong><\/h4>\n<p>Scale uv coords.<\/p>\n<h4><strong>Channel<\/strong><\/h4>\n<p>Channel of the texture to use for the displacement.<\/p>\n<h4><strong>Cent Lum<\/strong><\/h4>\n<p>Usually the displacement is in the range of 0 to 1 so everything is moved in one direction, sometimes you may want to move things up and down for example if so check this, then values less than the Cent Val will move vertices one way and values above will move it in the opposite direction.<\/p>\n<h4><strong>Cent Val<\/strong><\/h4>\n<p>Change this to bias the displacement.<\/p>\n<h4><strong>Decay<\/strong><\/h4>\n<p>Falloff value for the effect from the origin of the mesh (remember you can move this using the Offset value in common params) this will diminish the effect based on distance.<\/p>\n<h3>Displace Class<\/h3>\n<p>[cc lang=&#8221;c#&#8221;]public class MegaDisplace : MegaModifier<br \/>\n{<br \/>\n    public Texture2D   map;<br \/>\n    public float       amount;<br \/>\n    public MegaChannel channel;<br \/>\n    public Vector2     offset;<br \/>\n    public Vector2     scale;<br \/>\n}[\/cc]<\/p>\n<h3>Video showing how to use the Displace modifier<\/h3>\n<p><a href=\"http:\/\/www.youtube.com\/watch?v=l-6-kwWYHkU&#038;hd=1&#038;fs=1&#038;autoplay=1\" class=\"fancybox-youtube\"><img loading=\"lazy\" src=\"http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2011\/11\/ytdisplace.jpg\" alt=\"\" title=\"Displace Video Click to Play\" width=\"680\" height=\"384\" class=\"aligncenter size-full wp-image-1513 fancy\" srcset=\"http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2011\/11\/ytdisplace.jpg 680w, http:\/\/www.west-racing.com\/mf\/wp-content\/uploads\/2011\/11\/ytdisplace-300x169.jpg 300w\" sizes=\"(max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Displace vertices based on their normal and a texture lookup for the amount. Displace Param Description Map Texture to control the displacement, uv coords for a vertex govern the lookup [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":38,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=\/wp\/v2\/pages\/168"}],"collection":[{"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=168"}],"version-history":[{"count":17,"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=\/wp\/v2\/pages\/168\/revisions"}],"predecessor-version":[{"id":1514,"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=\/wp\/v2\/pages\/168\/revisions\/1514"}],"up":[{"embeddable":true,"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=\/wp\/v2\/pages\/38"}],"wp:attachment":[{"href":"http:\/\/www.west-racing.com\/mf\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}