Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

VOLUME GRASS - Unlimited Density

Discussion in 'Assets and Asset Store' started by tomaszek, Jul 11, 2014.

  1. govi627

    govi627

    Joined:
    Jan 30, 2013
    Posts:
    19
    Hey Tom,

    Great plugin!

    What would be the easiest way to make the global color map more saturated without affecting the color of the grass that is not affected by the color map? I have a logo on the field that appears to be quite desaturated compared to the source image. Any ideas?

    Joe
     
  2. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    The technique is known for a while, DX11 only though. (Actually we can emit polys from point array in DX10 as well).

    As far as I remember global colormap is blended grass color x global color x 2 (multiplicative). To not touch grass color use 0.5 grey color (0.5 value depends whether you're in gamma or linear).

    Tom
     
  3. Tovrin

    Tovrin

    Joined:
    Jul 15, 2015
    Posts:
    70
    I've been looking for a really good looking grass solution. This is certainly one on my list.

    A couple of questions regarding version 2:
    1) Do you have plans to collaborate with Nathaniel Doldersum to provide Terrain Composer integration? I'd love to see the same kinds of control over grass textures as you do with TC (slope, and texture height masking, etc)
    2) Will it be possible to do color or texture masking?
    3) Will you allow for a variation/mix of grass textures. The screenshots only appear to show single textures.
    4) Could this shader be applied using RTP's geometry blending?

    Thanks in advance.
     
  4. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    1. I believe that Nat would integrate it together as soon as he get back focused more on AssetStore. Anyway it wasn't problem for him to make such things, but the question about how new grass system will be done is opened.
    2. I guess you'd like to control coverage by some color masks. Not sure about details, but coverage in general should be controlled by textures rather than mesh bounds like it's now (with vertex colors to gradually remove grass at lawn border)
    3. If I brought back z-write functionality (removed in U5) it would be possible to use 2 types of grass that can intersect each other. No statements on this though.
    4. How would you envision blending grass with objects ? Grass has its virtual geometry, it's not like flat terrain surface that we might blend with objects. You can simply put "a big rock" in the center of the meadow and you'll see the rock is surrounded by grass with single strands close to the rock border visible.

    Tom
     
  5. Tovrin

    Tovrin

    Joined:
    Jul 15, 2015
    Posts:
    70
    I watch one of your video tutorials where you use RTP3 to "paint" a mesh onto terrain and then textured it with a cobblestone road. That's what I'm referring to. I thought that was geometry blending, but clearly I haven't got the terminology right.
     
  6. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    397
    Any idea why when I build the grass on a unity terrain the grass nodes show up in the right place but when I build it they're very far below my terrain? Looks like the grass is built at y=0 and the game object is at y=70 so if i move the entire game object to y=140 it's in the proper place.
     
    Last edited: Sep 28, 2015
  7. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I don't understand the difference between "building grass on terrain" and "building". Could you check placement of terrain object ?

    Tom
     
  8. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    397
    I sent a couple of pictures, I just mean I used Build on grass gameobject.
     
  9. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I've just double checked newest VG in U5.2 (in U5.2 terrain shader should be replaced with Unity standard, because something changed, but that's not problem of grass anyway). Regardless of where I put the terrain (in Y axis) and VG game object (in Y axis) after rebuilding grass appears on the terrain surface, so I don't know what can be wrong. You can catch me on skype as I answered you with PM.

    Tom
     
  10. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I purchased Volume Grass today. I learned about it from RTP - which I learned about from World/Terrain Composer.

    What I would like to do is add grass as a base layer to my terrains built using WC. How should I do this with VG? Should I make multiple "patches", or one large one per terrain, or one large one over all terrains? How best to do this?

    Thanks.
     
  11. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Hi, currently it's not possible to drive VG grass coverage from texture (like base layer from terrain). I still plan to introduce such possibility in next releases though. Currently I'm very involved with next, new release not related to grass or terain directly.

    To cover terrain with VG grass ou need to built it in the places it really appear. Could be actually done via some scripting, but you'd need to take care about it yourself. There is an example scene that shows how VG object can be constructed from top surface that defines "meadow shape" (in example it's just Unity plane). For terrain you'd need to export terrain mesh (RTP has terrain mesh exporter), place it a bit above ground, leave places where grass occurs, split it into more objects (for more effective culling). Then use the same routine as is used on mentioned example scene with volume grass on arbitrary mesh. If you'd like to drive coverage gradualy at edges (to not have logic like full grass/no grass) you can influence vertex color of grass mesh - that's the way I made a hole on meadow example scene.

    Tom
     
  12. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I am looking at the meadow example now. The terrain is pink. I don't know if that is what you intended. Maybe it was so the meadow stands out.
    2015-10-11_13-49-03.jpg
     
  13. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    It's the issue in Unity5.2 which I haven't uploaded VG package for yet on AssetStore. this is, however just a Unity terrain. You can download built-in Unity terrain shader and tweak Tags{} section inside like in mine:

    Code (csharp):
    1.  
    2.     Tags {
    3.        "SplatCount" = "4"
    4.        "Queue" = "Geometry-99"
    5.        // VolumeGrass NOTE:
    6.        // change from Opaque to anything else (RenderType could be also undefined)
    7.        // if you need to blend VolumeGrass with terrain details
    8.        //"RenderType" = "Opaque"
    9.        "RenderType" = "Terrain"
    10.      }
    11.  
    Example scene will should work without errors then.

    Tom
     
  14. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I have a terrain that is 600m x 700m. It is covered with buildings using BuildR and roads using EasyRoads3D. I have also placed plenty of Speedtrees. I basically want to carpet the entire terrain with Volume Grass, so wherever this isn't something else, there is grass.

    Is this feasible? Is it practicable? If so, how do you suggest I go about doing it? I have tried covering it with three or four large rectangles, but at some point it gets stuck in some compute loop and never relinquishes control. I've let it run for over a half hour in some cases.
     
  15. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Hi, for such complex cases it's better to feed VG with your own model of grass surface. Look at example scene with custom mesh. Export your terrain into obj (free scripts available on unity wiki). Then optimize it in modelling software - reduce triangle count, remove places where you don't have grass. Import it back to Unity and use my script to extrude custom mesh into VG object. You might split it into more objects for sake of better culling.

    Tom
     
  16. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    Thanks. I have done as you suggested. But I guess now I have conflict between the grass mesh and my terrain. There is lots of clipping going on. I want the grass, but if I turn off the terrain, I lose my trees, etc. Plus I was planning to use RTP.

    Is there some way I can use the two together, so I can use the terrain asset and still have the grass carpet?
     
  17. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    I wrote an editor extension that could drop grass patches in arbitrary ranges on a terrain, with arbitrary grid sizes (that in my case I had fit into my chunking sizes in my internal chunking engine). And then I hit a button to drop the grass, and another that fit the grass to the terrain and set all of the VG LODs. I still have some rare z-fighting with certain LODs at a distance, but that likely just requires some tweaking. I covered an area about the size you are referring to, but in my case only the patches that are in a certain range are activated due to my chunking. It works great - but keep in mind that while the grass looks pretty damn cool from most angles, looking at the crests of hills it looks fake (especially after you have stared at the same scene for months). This is a limitation of the VG approach. I find it acceptable given how good it looks otherwise and how performant it tends to be. It also looks really bad if you don't use the grass cutting layer stuff for objects that are in the grass (it basically looks like green water around the cut points otherwise).
     
    tomaszek likes this.
  18. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Where exactly clipping occurs ? You need to remember to put grass model a bit up (by the distance of extrusion height). For example your grass is 0,1m for extrusion in my custom mesh script parameter - raise the resultant mesh 0.1 unit up. Of course - we've got some problem with terrain that in distance can be decimated (made lower poly on the fly by Unity due to pixel error we demand from terrain engine - some fighting can occur there. You'd need to raise grass more probably to not make it happen then.

    Tom
     
  19. Klestin

    Klestin

    Joined:
    Mar 19, 2014
    Posts:
    1
    Has there been progress on the mobile front?
     
  20. DirtyHippy

    DirtyHippy

    Joined:
    Jul 17, 2012
    Posts:
    224
    Any idea if there is an easy fix (beyond filtering out the error myself) the error being logged, when VG releases the render texture and recreates it when the screen resolution changes? Unity logs a (benign but annoying) error about releasing a render texture assigned to a camera. I am not sure what the fix is, because you have to release the render texture and recreate it in this situation.

    This started happening when I upgraded to U5.2.3 from U5.1.2.
     
  21. Klaus-Eiperle

    Klaus-Eiperle

    Joined:
    Mar 10, 2012
    Posts:
    41
    I like to purchase your grass shader. I'm on Unity 4.7 and questions.
    - Is the problem in the post number 16 solved? The picture when looking on foot.
    - is the problem in the post number 252? The specular problem.
    -> I'm not on DX3D11
    -> I use forward and deferred lightning, depending to the scene.
     
  22. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    VG1.5c works on VG 4.6.8 (tested again this moment). On DX9 it works for Unity free/pro. On DX11 it works on Pro license. Post 16 problem is caused by overused bending feature, although looking at grass from "very top" direction might reveal its cell" grid nature.

    Tom
     
  23. Klaus-Eiperle

    Klaus-Eiperle

    Joined:
    Mar 10, 2012
    Posts:
    41
    Hi Tom,
    now I have purchased your VG. It looks very good and the performance is outstanding.

    I'm right, the camera cannot be inside the grass mesh? When the multicopter is flying very close over the grass, everything is fine. But when the multicopter is standing on the ground, the fpv camera shows the terrain mesh under the grass. The grass is then invisible.

    grass1.png
    grass2.png
     
    Last edited: Jan 28, 2016
  24. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Unfortunately you can't do it because under the grass there is no object that could render grass blades - it's realised on the top surface of the grass. But I'm working on workaround for this (drawing back culled box that would follow the camera). Currently - just live with it. I hope I can make an VG update soon.

    Tom

    P.S. Most probably update won't be available for U4, but only for newer U5. I dropped U4 support some time ago - sorry.
     
  25. Klaus-Eiperle

    Klaus-Eiperle

    Joined:
    Mar 10, 2012
    Posts:
    41
    Hi Tom,

    thank you very much for your quick reply. So, I have lost two days of work and cannot use your Grass.

    I own Unity5. But I cannot convert my flight simulator to this. I would have to rewrite all the physic calculations and would loose a lot of customers due to performance problems. The hardware recommendations for Unity 5 is much higher than Unity 4.

    All the best,
    Klaus
     
    Last edited: Jan 29, 2016
  26. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I'm sorry - I don't know the specific of your project, but I believe Unity5 doesn't force anybody to use PBR rendering - you can still render everything using legacy shaders. PhysX is updated to newer version. I thought it's rather better than worse for you.

    Tom
     
  27. Shoulder Devil

    Shoulder Devil

    Joined:
    Nov 2, 2015
    Posts:
    3
    Tom,

    Any update on the availability of VG 2.0 or when VG1.5 will be updated to use textures for grass placement?

    Thanks

    James
     
  28. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    If I would only have this 1-2 weeks available I might go with vg2 beta. The problem is that I don't have it... Anyway - be sure the VG project is not abandoned one.

    Tom
     
    hopeful, PeterB and Tinjaw like this.
  29. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    did we ever get this on mobile? it would be so nice...
     
  30. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    It is supposed to work on GLES3 hardware. GLES2 would be not suitable for such technique anyway - theoretically possible to compile, but would be too slow.

    Tom
     
  31. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    any chance we can get an APK to check in on a gles3 device? If it runs fast I would love to purchase it
     
  32. S_P_S

    S_P_S

    Joined:
    Feb 25, 2015
    Posts:
    91
    Has anyone used this asset with the HTC Vive and Unity 5.3 or 5.4 beta?
     
  33. Hexaedre

    Hexaedre

    Joined:
    Jan 23, 2015
    Posts:
    110
    Hi,

    I like this asset and I plan to use it for architectural visualisation.
    But I have an issue.
    The geometry added below the grass generate graphic artefacts.
    Those artefacts are amplified with the use of bloom.

    The result in play mode with bloom :
    There is only one bright spot in the picture, but it flickers all around the mesh.



    This is caused by the geometry below the mesh, white when unlit, and full buggy black with dynamic light.
    There is 0.5 as additional mesh height offset, so it is more visible.




    I tried to enter a negative additional mesh height offset, so the grass is slightly below the ground. But it only reduce the issue.
     
    Last edited: May 31, 2016
  34. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    Hi @tomaszek , I have a question about this asset. I am looking for a very optimized way of adding a "fur" like surface to some models. I have tried many of the fur shader assets however because they use one pass for each shell it ends up giving me 10-20 drawcalls per object. This is no good for mobile.

    So my question is can this be used on skinned mesh models and how many draw calls does this generate?
     
  35. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    It's some kind of instability in shader. Sure, it's a bug, but the quickest workaround (rather than waiting for me to find the reason and fixing it) will be simply moving your grass mesh model (game object) a bit below after making it.

    VolumeGrass is very low drawcall intensive, but at cost of complexity in pixel shader. Still it needs to do a lot of work in shader. We release a lot CPU, but pushes GPU. For modern mobile (gles3) VG works reasonably good, but it's still not that cheap to render. Fur needs to be mapped in object space while VG maps it in global space (top planar world xz coords). It will be difficult to hide case when we look at fur completely straight (view dir perpendicular to fur surface). My honest advice is - at current state of VG developement it's not suitable for fur.

    Anyway - I encourage you to follow this (currently a bit dusty I know) thread. I really hope I can go back to developement of this technology in the future and improve it to the level it will be suitable for fur.

    Tom
     
    hopeful likes this.
  36. Hamesh81

    Hamesh81

    Joined:
    Mar 9, 2012
    Posts:
    405
    No problems, thanks for being honest ;)
     
  37. Meta-tron

    Meta-tron

    Joined:
    Oct 22, 2015
    Posts:
    19
    So I have a very large golf course to work on. And this looks like it might be what I am looking for. However it looks like you have to define the grass boundarys using points and splines. This wont work for me because in a golf course there are two to three different colored grass types and they shape these into some pretty tough patterns. And there are sand traps, so now I have a large number of holes.
    I could live with this if it would pick up the underlying ground color and use it for the base grass color. And if I could make a hole by painting it out or submerging yours without artifacts? OnTheGreen.png
     
  38. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Your golf course is indeed large one. If you tessellate mesh enough (adding manually control points before building grass mesh) around sand traps you can push grass down there to exclude it. You can span coloring texture over whole grass mesh to get different colors.

    Tom
     
  39. Meta-tron

    Meta-tron

    Joined:
    Oct 22, 2015
    Posts:
    19
    Did VolumeGrass 2 ever come out? I have alot of splat textures.
     
  40. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Question, @tomaszek, could this asset be used to make small trees nice and thick? We want thick forests (think something like a flight sim but slightly more detail) but so far no asset does them quite well enough to be usable without horrible performance.
     
  41. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    I'm thinking the answer on your question is no, but obviously my answer is not an official one, just a guess.

    Not to divert or derail, but @CaptainMurphy have you looked into Horizon[ON], Turbo Forest, or uNature (which is an update of Trees Manager System, coming soon)?

    And there's another approach as well: Texture Forest / Texture Forest Studio.
     
  42. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    We have looked at all of those, actually. We don't need actual 'tree' just something that looks like dense trees and canopy jungle type of look. We are exploring a ton of different options and this one caught my eye, plus I know that the author is responsive to requests and pretty helpful.
     
    hopeful likes this.
  43. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I don't think VG might be helpful here. HorizON has "tree baker" which makes possible to have 10k trees in 1 drawcall.

    Tom
     
  44. Riderfan

    Riderfan

    Joined:
    Jan 10, 2013
    Posts:
    514
    Hi Tom.

    Hoping you could answer a quick question for me. I'm looking to 'grassify' a football field (North American) and noticed that your soccer demo allows the grass to respect line colours which is important, but also the grass looks quite long.

    How would you recommend replicating something like really short grass or artificial field turf on a plane or mesh with a 2048*2048 football field texture?




    What's a bit crazy is that, in real life, you can't even see the 'grass' unless you're right down on top of it. But people expect it in games now even if it does look exagerated.

    thanks
    David
     
  45. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    You can try to mimic that short grass to the extents of VolumeGrass capacity. You know the technique behind current VolumeGrass is to place grass billboards on grid with some biasing when we look at them from the top. The effect is still billboard though. I'm not sure how close you'd expect VG against above screenshot which is photo. If my soccer demo is enough for you convicing - to for it, if not - VG can't make photos (yet) :).

    Tom
     
  46. kloogens

    kloogens

    Joined:
    Jul 1, 2015
    Posts:
    109
    Hey Tom, I just imported VG into my Unity 5.4.1 project and I'm getting 18 compiler errors. I deleted the VolumeGrass folder and tried again same thing. Tried it on my other computer same thing.
    Compiler errors like missing constructors and such, not conflicts with other unity assets or anything like that.
    Any suggestions?
     
  47. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I've just imported newest VG1.5d in U5.4.1f1. Except for pink terrain (which is not important here as this is add on for example scene) grass itself works fine for me.

    Tom
     
  48. kloogens

    kloogens

    Joined:
    Jul 1, 2015
    Posts:
    109
    Yeah this is really strange. I created a blank project and with works. It just fails on project I'm actually trying to use it with.
    I do have RTP installed on the latter project.


    Edit: Okay, figured it out, another asset is using PolyTri2 class, so it's just a namespace conflict in the project. Disregard, sorry to bug you.
     
    Last edited: Dec 2, 2016
  49. Venryx

    Venryx

    Joined:
    Sep 25, 2012
    Posts:
    444
    Fantastic plugin! Very easy way to make your terrain more realistic and beautiful.

    The ray-casting seems to be broken in Unity 5.6.0b4, however.


    As can be seen, the bark that used to show through the grass (in the gaps between the grass blades) is now being covered everywhere by the grass mesh rendering.

    I realize this is probably not high priority, since it's a beta version of Unity. But I thought I'd mention it.
     
  50. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Oh, good to know this plugin is not dead :). I'll look into it lateron... (on more mature beta - Unity changes things very actively on their betas :) )

    Tom
     
    Venryx likes this.