{"id":346,"date":"2018-08-30T18:00:43","date_gmt":"2018-08-30T23:00:43","guid":{"rendered":"http:\/\/www.chroniclesoftright.com\/blog\/?p=346"},"modified":"2018-08-30T21:46:52","modified_gmt":"2018-08-31T02:46:52","slug":"terrain-work","status":"publish","type":"post","link":"https:\/\/www.chroniclesoftright.com\/blog\/2018\/08\/30\/terrain-work\/","title":{"rendered":"Terrain work"},"content":{"rendered":"<p>I&#8217;ve been messing with the terrain in Lyridia recently because it needs work.\u00a0 After some general indecision I decided it would be best if I could set the color of each face individually, that way I can add some painting tools to the world editor and just paint in paths or grassy patches or snow or beaches or whatever.\u00a0 As a step toward that I needed to just figure out how to set the color of each face, and what better way than with a different random color assigned to each face!<\/p>\n<p><a href=\"http:\/\/www.chroniclesoftright.com\/blog\/wp-content\/uploads\/2018\/08\/crazyTerrain.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-347\" src=\"http:\/\/www.chroniclesoftright.com\/blog\/wp-content\/uploads\/2018\/08\/crazyTerrain-300x200.png\" alt=\"\" width=\"300\" height=\"200\" srcset=\"https:\/\/www.chroniclesoftright.com\/blog\/wp-content\/uploads\/2018\/08\/crazyTerrain-300x200.png 300w, https:\/\/www.chroniclesoftright.com\/blog\/wp-content\/uploads\/2018\/08\/crazyTerrain-768x511.png 768w, https:\/\/www.chroniclesoftright.com\/blog\/wp-content\/uploads\/2018\/08\/crazyTerrain.png 909w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>This obviously looks a little crazy but I kind of like it.\u00a0 I could see a part of the world where the terrain looks something like this all the time.\u00a0 Maybe in a truly chaotic place, or maybe this is how you see the world if your character eats a hallucinogenic berry.\u00a0 Lots of options.\u00a0 The main point, however, is that setting each face&#8217;s color programmatically is totally possible.\u00a0 That&#8217;s good because this way I can keep the low-poly style, but still add in some details to keep the terrain from just being a green blob.<\/p>\n<p>Update:<\/p>\n<p>I have also tried shading the terrain with vertex colors instead of face colors.\u00a0 The neat thing about this approach is that WebGL blends the colors between the vertices so that if I want to draw some snow on a mountain, I can take the length of a triangle to transition from gray to white.\u00a0 Or if I want to draw a path then the sides of the path can fade from brown to green.\u00a0 This might take away from the low-poly look, or it might enhance it.\u00a0 I won&#8217;t really know until I get some actual painting capabilities built, so my next task is to rebuild the world editor.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been messing with the terrain in Lyridia recently because it needs work.\u00a0 After some general indecision I decided it would be best if I could set the color of each face individually, that way I can add some painting tools to the world editor and just paint in paths or grassy patches or snow&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-346","post","type-post","status-publish","format-standard","hentry","category-planning-and-development"],"_links":{"self":[{"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/posts\/346","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/comments?post=346"}],"version-history":[{"count":3,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/posts\/346\/revisions"}],"predecessor-version":[{"id":350,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/posts\/346\/revisions\/350"}],"wp:attachment":[{"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/media?parent=346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/categories?post=346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.chroniclesoftright.com\/blog\/wp-json\/wp\/v2\/tags?post=346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}