{"id":3019,"date":"2014-06-23T14:50:39","date_gmt":"2014-06-23T11:50:39","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=3019"},"modified":"2014-06-30T02:26:33","modified_gmt":"2014-06-29T23:26:33","slug":"grass-maker-for-mesh-terrain-wip","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2014\/06\/23\/grass-maker-for-mesh-terrain-wip\/","title":{"rendered":"Grass Maker for Mesh Terrain (wip)"},"content":{"rendered":"<p><a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/grass_mesh_generator_1.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3021\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/06\/23\/grass-maker-for-mesh-terrain-wip\/grass_mesh_generator_1\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/grass_mesh_generator_1.jpg?fit=680%2C455&amp;ssl=1\" data-orig-size=\"680,455\" 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=\"grass_mesh_generator_1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/grass_mesh_generator_1.jpg?fit=680%2C455&amp;ssl=1\" class=\"alignnone size-full wp-image-3021\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/grass_mesh_generator_1.jpg?resize=680%2C455\" alt=\"grass_mesh_generator_1\" width=\"680\" height=\"455\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/grass_mesh_generator_1.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/grass_mesh_generator_1.jpg?resize=300%2C200&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n<p>Trying to make some basic grass\/plants generator for mesh terrain.. (not terrain object).<br \/>\n(This is part of <a title=\"http:\/\/unitycoder.com\/blog\/2013\/08\/26\/mesh-terrain-texturingsplatmap-tool-wip\/\" href=\"http:\/\/unitycoder.com\/blog\/2013\/08\/26\/mesh-terrain-texturingsplatmap-tool-wip\/\" target=\"_blank\">Mesh Terrain\/Splatmap Too<\/a>l)<\/p>\n<p><strong><br \/>\nFEATURES<\/strong><br \/>\n&#8211; Editor plugin: Generates grass billboard planes(quads) over mesh surface (using raycast..)<br \/>\n&#8211; Checks splatmap color, if its over certain threshold, then add grass here..<br \/>\n&#8211; Atlas texture support for grass<\/p>\n<p>&#8212;<\/p>\n<p><strong>TODO<\/strong><br \/>\n&#8211; Find: Better \/ realistic looking way to distribute grass\/plants around terrain.. (Ideas: using splatmask? terrain surface angles? or just fill the whole scene randomly? or floodfill?)<br \/>\n<del> &#8211; Fix: floating meshes (maybe can take raycast hit normal, then adjust border vertices using that..?)<\/del><br \/>\n<del>&#8211; Add: position randomness<\/del><br \/>\n<del> &#8211; Add: multiple grass\/plant types (using atlas now)<\/del><br \/>\n&#8211; Add: grass options (scale, <del>main color<\/del>, variation, &#8230;)<br \/>\n&#8211; Add: billboard options (<del>how many quad planes<\/del>, what group shape: single, cross, &#8230;)<br \/>\n&#8211; <del>Add: take vertex color from terrain, use in shader<\/del> : done<br \/>\n&#8211; Grass islands\/patches should also have less\/shorter grass on patch borders..if that looks nicer.<br \/>\n&#8211; Could add trees, rocks into this later also..<br \/>\n&#8211; Optimized Quad plane &gt; Use single triangle instead?<br \/>\n&#8211; Lawnmover script, why not! (just move vertices down or change atlas image to cut grass)<br \/>\n&#8211; Bending grass near player (shader: move vertices by player distance)<br \/>\n&#8211; Add probability percentage option for each grass type (now there are too many white flowers..) *Random weighted selection..<br \/>\n&#8211; Optimize far away grass (hide it if too far, fade in or show when closer)<br \/>\n&#8211; <del>Distribution: less grass if lower mask threshold<\/del> : Before: &#8220;if (maskC.g&gt;0.75f)&#8221;, After: &#8220;if (Random.value&gt;1-maskColor.g)&#8221;<br \/>\n<del>&#8211; Fix shader: some problems with lights? (too dark in some areas\/angles)<\/del> : added custom surface <a title=\"http:\/\/answers.unity3d.com\/questions\/179487\/diffuse-2-sided-shader-only-accepts-light-on-one-s.html\" href=\"http:\/\/answers.unity3d.com\/questions\/179487\/diffuse-2-sided-shader-only-accepts-light-on-one-s.html\" target=\"_blank\">shader lighting using this<\/a><\/p>\n<p><strong>PROBLEMS<br \/>\n<del>&#8211; <\/del><\/strong><del>Cannot use GetPixel() to get pixel color from that position, with raycast &amp; hit.textureCoord, if the mesh texture material is set tiled?<\/del> : Just had to multiply hit.textureCoord with tiling value.<br \/>\n&#8211; Webplayer demo build would be 44 megabytes! Have to check whats happening there..<\/p>\n<p>&#8212;<\/p>\n<p><strong>IDEAS<\/strong><br \/>\n&#8211; Raycast floodfill : Shoot raycast on terrain, if suitable mask color for grass, shoot more rays nearby and place grass (with scale based on original startpoint), until hit different mask color..<\/p>\n<p>&#8212;<\/p>\n<p><strong>INSPIRATION<\/strong><br \/>\n&#8211; <a title=\"http:\/\/www.fhwa.dot.gov\/byways\/Uploads\/asset_files\/000\/019\/216\/charon%27s_garden.jpg\" href=\"http:\/\/www.fhwa.dot.gov\/byways\/Uploads\/asset_files\/000\/019\/216\/charon%27s_garden.jpg\" target=\"_blank\">Grassy terrain\/hill photo<\/a><br \/>\n&#8211; <a title=\"http:\/\/community.thefoundry.co.uk\/discussion\/post.aspx?f=8&amp;t=57507&amp;p=515956\" href=\"http:\/\/community.thefoundry.co.uk\/discussion\/post.aspx?f=8&amp;t=57507&amp;p=515956\" target=\"_blank\">Grass\/sand terrain render<\/a><br \/>\n&#8211; <a title=\"http:\/\/outerra.blogspot.fi\/2012\/05\/procedural-grass-rendering.html\" href=\"http:\/\/outerra.blogspot.fi\/2012\/05\/procedural-grass-rendering.html\" target=\"_blank\">Outerra grass<\/a><\/p>\n<p><strong>RESOURCES<\/strong><br \/>\n&#8211; <a title=\"http:\/\/http.developer.nvidia.com\/GPUGems\/gpugems_ch07.html\" href=\"http:\/\/http.developer.nvidia.com\/GPUGems\/gpugems_ch07.html\" target=\"_blank\">Nvidia grass<\/a> (some quad shapes here)<br \/>\n&#8211; <a title=\"http:\/\/reije081.home.xs4all.nl\/skyboxes\/\" href=\"http:\/\/reije081.home.xs4all.nl\/skyboxes\/\" target=\"_blank\">Free skyboxes<\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#2:<\/strong> Problems &gt; Floating meshes (since the quad centerpoint is taken from single raycast hit..)<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3020\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/06\/23\/grass-maker-for-mesh-terrain-wip\/grass_mesh_generator_2\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/grass_mesh_generator_2.jpg?fit=680%2C455&amp;ssl=1\" data-orig-size=\"680,455\" 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=\"grass_mesh_generator_2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/grass_mesh_generator_2.jpg?fit=680%2C455&amp;ssl=1\" class=\"alignnone size-full wp-image-3020\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/grass_mesh_generator_2.jpg?resize=680%2C455\" alt=\"grass_mesh_generator_2\" width=\"680\" height=\"455\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/grass_mesh_generator_2.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/grass_mesh_generator_2.jpg?resize=300%2C200&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p>AFTER (26.6.2014).. floating shadow still quite annoying here..<br \/>\n<img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3047\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/06\/23\/grass-maker-for-mesh-terrain-wip\/mesh_grass_generator_unity3d_b-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_b1.jpg?fit=680%2C470&amp;ssl=1\" data-orig-size=\"680,470\" 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=\"mesh_grass_generator_unity3d_b\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_b1.jpg?fit=680%2C470&amp;ssl=1\" class=\"alignnone size-full wp-image-3047\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_b1.jpg?resize=680%2C470\" alt=\"mesh_grass_generator_unity3d_b\" width=\"680\" height=\"470\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_b1.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_b1.jpg?resize=300%2C207&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#3-4-5:<\/strong> Trying to get quad aligned with surface, without distorting texture.. argh, why I didnt do my maths homework at school &gt;&lt;<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_align_surface_problem.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3030\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/06\/23\/grass-maker-for-mesh-terrain-wip\/mesh_align_surface_problem\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_align_surface_problem.jpg?fit=680%2C570&amp;ssl=1\" data-orig-size=\"680,570\" 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=\"mesh_align_surface_problem\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_align_surface_problem.jpg?fit=680%2C570&amp;ssl=1\" class=\"alignnone wp-image-3030 size-medium\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_align_surface_problem-300x251.jpg?resize=300%2C251\" alt=\"mesh_align_surface_problem\" width=\"300\" height=\"251\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_align_surface_problem.jpg?resize=300%2C251&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_align_surface_problem.jpg?w=680&amp;ssl=1 680w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Almost solved (by a friend with some mathemagic), now there are those color lines to indicate end vertex positions on surface.. not yet sure what happens to texture when quad is stretched over there..<br \/>\n<a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/align_to_surface_vectors.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3037\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/06\/23\/grass-maker-for-mesh-terrain-wip\/align_to_surface_vectors\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/align_to_surface_vectors.png?fit=582%2C572&amp;ssl=1\" data-orig-size=\"582,572\" 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=\"align_to_surface_vectors\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/align_to_surface_vectors.png?fit=582%2C572&amp;ssl=1\" class=\"alignnone wp-image-3037 size-medium\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/align_to_surface_vectors-300x294.png?resize=300%2C294\" alt=\"align_to_surface_vectors\" width=\"300\" height=\"294\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/align_to_surface_vectors.png?resize=300%2C294&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/align_to_surface_vectors.png?w=582&amp;ssl=1 582w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a> <a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_align_surface_problem_unity_fix.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3041\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/06\/23\/grass-maker-for-mesh-terrain-wip\/mesh_align_surface_problem_unity_fix\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_align_surface_problem_unity_fix.jpg?fit=680%2C461&amp;ssl=1\" data-orig-size=\"680,461\" 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=\"mesh_align_surface_problem_unity_fix\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_align_surface_problem_unity_fix.jpg?fit=680%2C461&amp;ssl=1\" class=\"alignnone size-medium wp-image-3041\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_align_surface_problem_unity_fix-300x203.jpg?resize=300%2C203\" alt=\"mesh_align_surface_problem_unity_fix\" width=\"300\" height=\"203\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_align_surface_problem_unity_fix.jpg?resize=300%2C203&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_align_surface_problem_unity_fix.jpg?w=680&amp;ssl=1 680w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#6:<\/strong> Added perlin noise to grass positions, looks ok from nearby:<br \/>\n<a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_a.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3045\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/06\/23\/grass-maker-for-mesh-terrain-wip\/mesh_grass_generator_unity3d_a\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_a.jpg?fit=1051%2C726&amp;ssl=1\" data-orig-size=\"1051,726\" 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=\"mesh_grass_generator_unity3d_a\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_a.jpg?fit=1024%2C707&amp;ssl=1\" class=\"alignnone size-medium wp-image-3045\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_a-300x207.jpg?resize=300%2C207\" alt=\"mesh_grass_generator_unity3d_a\" width=\"300\" height=\"207\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_a.jpg?resize=300%2C207&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_a.jpg?resize=1024%2C707&amp;ssl=1 1024w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_a.jpg?w=1051&amp;ssl=1 1051w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#7:<\/strong> Taking grass color\/tint from current texture under it<br \/>\n<a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_color_variation.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3051\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/06\/23\/grass-maker-for-mesh-terrain-wip\/mesh_grass_generator_unity3d_color_variation\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_color_variation.jpg?fit=1031%2C587&amp;ssl=1\" data-orig-size=\"1031,587\" 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=\"mesh_grass_generator_unity3d_color_variation\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_color_variation.jpg?fit=1024%2C583&amp;ssl=1\" class=\"alignnone size-medium wp-image-3051\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_color_variation-300x170.jpg?resize=300%2C170\" alt=\"mesh_grass_generator_unity3d_color_variation\" width=\"300\" height=\"170\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_color_variation.jpg?resize=300%2C170&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_color_variation.jpg?resize=1024%2C583&amp;ssl=1 1024w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_color_variation.jpg?w=1031&amp;ssl=1 1031w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#8:<\/strong> Using sprite shader, looks nice also (no shadows or waving though..and\u00a0 forgot to set bottom vertex alpha to 1) *click images for full size<br \/>\n<a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_sprite_shader.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3053\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/06\/23\/grass-maker-for-mesh-terrain-wip\/mesh_grass_generator_unity3d_sprite_shader\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_sprite_shader.jpg?fit=1014%2C746&amp;ssl=1\" data-orig-size=\"1014,746\" 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=\"mesh_grass_generator_unity3d_sprite_shader\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_sprite_shader.jpg?fit=1014%2C746&amp;ssl=1\" class=\"alignnone size-medium wp-image-3053\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_sprite_shader-300x220.jpg?resize=300%2C220\" alt=\"mesh_grass_generator_unity3d_sprite_shader\" width=\"300\" height=\"220\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_sprite_shader.jpg?resize=300%2C220&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_unity3d_sprite_shader.jpg?w=1014&amp;ssl=1 1014w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#9:<\/strong> Using texture atlas for grass (*btw. these plant textures are from : <a title=\"https:\/\/www.assetstore.unity3d.com\/en\/#!\/content\/6\" href=\"https:\/\/www.assetstore.unity3d.com\/en\/#!\/content\/6\" target=\"_blank\">https:\/\/www.assetstore.unity3d.com\/en\/#!\/content\/6 <\/a><\/p>\n<p><a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_atlas_texture_unity3d_view2.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3064\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/06\/23\/grass-maker-for-mesh-terrain-wip\/mesh_grass_generator_atlas_texture_unity3d_view2\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_atlas_texture_unity3d_view2.jpg?fit=1568%2C880&amp;ssl=1\" data-orig-size=\"1568,880\" 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=\"mesh_grass_generator_atlas_texture_unity3d_view2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_atlas_texture_unity3d_view2.jpg?fit=1024%2C574&amp;ssl=1\" class=\"alignnone size-medium wp-image-3064\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_atlas_texture_unity3d_view2-300x168.jpg?resize=300%2C168\" alt=\"mesh_grass_generator_atlas_texture_unity3d_view2\" width=\"300\" height=\"168\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_atlas_texture_unity3d_view2.jpg?resize=300%2C168&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_atlas_texture_unity3d_view2.jpg?resize=1024%2C574&amp;ssl=1 1024w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_atlas_texture_unity3d_view2.jpg?w=1568&amp;ssl=1 1568w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#10:<\/strong> 2 Sided lighting shader, added skybox and fog. (around 560 drawcalls, almost 2.5million tri&#8217;s)<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_maker_unity3d_wip_terrain_1.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3075\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/06\/23\/grass-maker-for-mesh-terrain-wip\/mesh_grass_maker_unity3d_wip_terrain_1\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_maker_unity3d_wip_terrain_1.jpg?fit=1892%2C907&amp;ssl=1\" data-orig-size=\"1892,907\" 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=\"mesh_grass_maker_unity3d_wip_terrain_1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_maker_unity3d_wip_terrain_1.jpg?fit=1024%2C490&amp;ssl=1\" class=\"alignnone size-medium wp-image-3075\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_maker_unity3d_wip_terrain_1-300x143.jpg?resize=300%2C143\" alt=\"mesh_grass_maker_unity3d_wip_terrain_1\" width=\"300\" height=\"143\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_maker_unity3d_wip_terrain_1.jpg?resize=300%2C143&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_maker_unity3d_wip_terrain_1.jpg?resize=1024%2C490&amp;ssl=1 1024w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_maker_unity3d_wip_terrain_1.jpg?w=1892&amp;ssl=1 1892w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#11:<\/strong> New random distribution probability threshold &amp; height scale from mask color. It gives those random smaller grasses nearby the normal grass area<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_maker_unity3d_wip_terrain_distribution_2.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"3078\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2014\/06\/23\/grass-maker-for-mesh-terrain-wip\/mesh_grass_maker_unity3d_wip_terrain_distribution_2\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_maker_unity3d_wip_terrain_distribution_2.jpg?fit=1765%2C869&amp;ssl=1\" data-orig-size=\"1765,869\" 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=\"mesh_grass_maker_unity3d_wip_terrain_distribution_2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_maker_unity3d_wip_terrain_distribution_2.jpg?fit=1024%2C504&amp;ssl=1\" class=\"alignnone size-medium wp-image-3078\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_maker_unity3d_wip_terrain_distribution_2-300x147.jpg?resize=300%2C147\" alt=\"mesh_grass_maker_unity3d_wip_terrain_distribution_2\" width=\"300\" height=\"147\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_maker_unity3d_wip_terrain_distribution_2.jpg?resize=300%2C147&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_maker_unity3d_wip_terrain_distribution_2.jpg?resize=1024%2C504&amp;ssl=1 1024w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_maker_unity3d_wip_terrain_distribution_2.jpg?w=1765&amp;ssl=1 1765w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Trying to make some basic grass\/plants generator for mesh terrain.. (not terrain object). (This is part of Mesh Terrain\/Splatmap Tool) FEATURES &#8211; Editor plugin: Generates grass billboard planes(quads) over mesh surface (using raycast..) &#8211; Checks splatmap color, if its over certain threshold, then add grass [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3062,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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},"jetpack_post_was_ever_published":false},"categories":[26],"tags":[528,642,223,640,641,5,643,302,168],"class_list":["post-3019","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wip","tag-creator","tag-foliage","tag-generator","tag-grass","tag-maker","tag-mesh","tag-plants","tag-procedural","tag-terrain"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2014\/06\/mesh_grass_generator_atlas_texture_unity3d.jpg?fit=1040%2C656&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-MH","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/3019","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=3019"}],"version-history":[{"count":35,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/3019\/revisions"}],"predecessor-version":[{"id":3080,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/3019\/revisions\/3080"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/3062"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=3019"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=3019"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=3019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}