{"id":2657,"date":"2014-02-03T00:10:04","date_gmt":"2014-02-02T21:10:04","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=2657"},"modified":"2014-02-03T00:26:34","modified_gmt":"2014-02-02T21:26:34","slug":"river-mesh-generator","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2014\/02\/03\/river-mesh-generator\/","title":{"rendered":"River Mesh Generator"},"content":{"rendered":"<p><a title=\"http:\/\/unitycoder.com\/upload\/demos\/RiverMeshMakerUnity\/\" href=\"http:\/\/unitycoder.com\/upload\/demos\/RiverMeshMakerUnity\/\" target=\"_blank\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2659\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/02\/03\/river-mesh-generator\/river_mesh_maker_unity_1\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/02\/river_mesh_maker_unity_1.jpg?fit=680%2C370&amp;ssl=1\" data-orig-size=\"680,370\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"river_mesh_maker_unity_1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/02\/river_mesh_maker_unity_1.jpg?fit=300%2C163&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/02\/river_mesh_maker_unity_1.jpg?fit=680%2C370&amp;ssl=1\" class=\"alignnone size-full wp-image-2659\" alt=\"river_mesh_maker_unity_1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/02\/river_mesh_maker_unity_1.jpg?resize=680%2C370\" width=\"680\" height=\"370\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/02\/river_mesh_maker_unity_1.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/02\/river_mesh_maker_unity_1.jpg?resize=300%2C163&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n<p>Testing river mesh generation,<br \/>\nidea is from forum topic: <a title=\"http:\/\/forum.unity3d.com\/threads\/225561-Is-there-any-way-to-have-a-river-flow-without-flow-maps?p=1502875\" href=\"http:\/\/forum.unity3d.com\/threads\/225561-Is-there-any-way-to-have-a-river-flow-without-flow-maps?p=1502875\" target=\"_blank\">http:\/\/forum.unity3d.com\/threads\/225561-Is-there-any-way-to-have-a-river-flow-without-flow-maps?p=1502875<\/a><\/p>\n<p><strong>Webplayer:<\/strong><br \/>\n<a title=\"http:\/\/unitycoder.com\/upload\/demos\/RiverMeshMakerUnity\/\" href=\"http:\/\/unitycoder.com\/upload\/demos\/RiverMeshMakerUnity\/\" target=\"_blank\"> http:\/\/unitycoder.com\/upload\/demos\/RiverMeshMakerUnity\/<\/a><\/p>\n<p><strong>Features:<\/strong><br \/>\n&#8211; Start point, length, width, segment length, adjustable x-position (middle of the river), in the screenshot using Mathf.Cos(#)<br \/>\n&#8211; Each piece\/segment has UV (0,0 to 1,1) so can scroll the texture to Y direction..<\/p>\n<p><strong>Todo:<\/strong><br \/>\n&#8211; Terrain editor plugin (to dig river in unity terrain object)<\/p>\n<p><strong>Problems:<\/strong><br \/>\n&#8211; Would need better water shader..<br \/>\n&#8211; Start of the river bit bugged<br \/>\n&#8211; Tried baking flow direction to vertex colors, but couldnt get the angles right..<br \/>\n&#8211; Visible tiling on slices (depends on shader used.. but should blend them somehow)<br \/>\n&#8211; vertical segment start and end have duplicate vertices, not needed..<\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#2:<\/strong> mesh geometry, made from 4 vertices per segment<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"2660\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/02\/03\/river-mesh-generator\/river_mesh_maker_unity_2\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/02\/river_mesh_maker_unity_2.jpg?fit=680%2C367&amp;ssl=1\" data-orig-size=\"680,367\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"river_mesh_maker_unity_2\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/02\/river_mesh_maker_unity_2.jpg?fit=300%2C161&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/02\/river_mesh_maker_unity_2.jpg?fit=680%2C367&amp;ssl=1\" class=\"alignnone size-full wp-image-2660\" alt=\"river_mesh_maker_unity_2\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/02\/river_mesh_maker_unity_2.jpg?resize=680%2C367\" width=\"680\" height=\"367\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/02\/river_mesh_maker_unity_2.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/02\/river_mesh_maker_unity_2.jpg?resize=300%2C161&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Testing river mesh generation, idea is from forum topic: http:\/\/forum.unity3d.com\/threads\/225561-Is-there-any-way-to-have-a-river-flow-without-flow-maps?p=1502875 Webplayer: http:\/\/unitycoder.com\/upload\/demos\/RiverMeshMakerUnity\/ Features: &#8211; Start point, length, width, segment length, adjustable x-position (middle of the river), in the screenshot using Mathf.Cos(#) &#8211; Each piece\/segment has UV (0,0 to 1,1) so can scroll the texture to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2659,"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,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[587,223,5,302,164,60],"class_list":["post-2657","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-flowing","tag-generator","tag-mesh","tag-procedural","tag-river","tag-water"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/02\/river_mesh_maker_unity_1.jpg?fit=680%2C370&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-GR","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/2657","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=2657"}],"version-history":[{"count":6,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/2657\/revisions"}],"predecessor-version":[{"id":2668,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/2657\/revisions\/2668"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/2659"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=2657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=2657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=2657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}