Search Unity

VOLUME GRASS - Unlimited Density

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

  1. MadJohny

    MadJohny

    Joined:
    Mar 8, 2013
    Posts:
    143

    Okay then, that sounds better ;p
     
  2. Jochen-Hanisch

    Jochen-Hanisch

    Joined:
    Oct 7, 2013
    Posts:
    25

    Thank's Tom, it works after reasign the camera script ;)
     
  3. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Calm down, guys. I'll address all the issues sooner than you could expect. But please, don't be so impatient. I admit - VG1.5 is kind of quick release that has been aiming soccer sale. When I got info from AssetStore staff about the sale I had only a few days to finish it to make it ready and trying to satisfy users I haven't sleep for 40 hours last friday... That's also the reason not every possible configuration have been tested (it's always impossible though). Waiting a day or two for solution is that bad ? Post me here on forum and let's try to find solution together. The positive attitude is for example a Mac user (AaronClark - thank you !) who contacted me and gave me GLSL compiler output from his Mac. This moment I can make it working on Macs in minutes ! And what's the opposite attitude ? Somebody will never understand how one star reviews can badly ruin somebody's reputation on AssetStore. And that's completely unnecessary in situation when developer is quite responsive. Isn't he ?

    Kindest Regards, Tom

    P.S. Yes, I'm also pissed off when some developers sell things that doesn't work and they DON'T reponse for ... weeks.
     
    Last edited: Jul 15, 2014
    CHoltz, RagingJacob and John-G like this.
  4. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    How does this work with runtime modification of Unity terrain? Both regarding to changing height and changing texture and removing grass from that spot?
     
  5. BBRome

    BBRome

    Joined:
    Jul 3, 2012
    Posts:
    373
    [QUOTE="
    I need Mac user to cooperate with... Using open gl mode in my Windows is not enough I see. (it works on my side)
    I see your point clearly, only give me some time rather than posting discouraging reviews on AssetStore as it is not my intention to mislead anybody... Just wasn't aware about Macs.[/QUOTE]

    Probably I wasn't clear!

    You must indicate in the description that is not tested on MAC device, so is up to the buyer take the risk, this is a serious behavior.

    I don't use Windows PC so I thrown the money, please refund.

    Thanks
     
    Last edited: Jul 15, 2014
  6. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Yes, VG1.5 uses static volume meshes unles you can build them dynamic. VG2 can use use both static (like current) and dynamic meshes that sticks to terrain and are drawn in requested viewing distance.

    Tom
     
  7. khos85

    khos85

    Joined:
    Jul 21, 2013
    Posts:
    541
    Many thanks Tom, much appreciated. Pity I missed the 50% discount offer... :(
     
  8. BBRome

    BBRome

    Joined:
    Jul 3, 2012
    Posts:
    373
    You must indicate in the description that is not tested on MAC device, so is up to the buyer take the risk, this is a serious behavior.

    I don't use Windows PC so I thrown the money, please refund.

    Thanks
     
  9. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    SImply resolved when you don't use write to z buffer and use special camera script (already attached to camera in my example scenes but disabled). SS Ambient Obscurance shouldn't produce this glitch then. This is, however Pro only solution then (like SSAO so it's not big problem in the end for you). I'll try to make it working when using depth writing, too. It's only matter that sidewalls should NOT be rendered in depth pass when Unity grab screen depth/normals for SSAO.

    Tom

    P.S. New update is just around the corner.
     
    Last edited: Jul 15, 2014
  10. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Like Marcurious noticed. This is an issue only in forward lighting because deferred uses its own shadow collecting pass. The reason for this weirdness is that I put shadow collector offset to the middle of the grass. This makes better impression. Without it we'll see that only top surface of grass volume receives shadows. Offsetting this makes it looks a bit better for my taste. Anyway I'll remove offseting for incoming update in case you like to use forward (forward can be faster for VG as this is not much cheap shader - we could make it "forward only" by removing a part of code from shader and I can instruct you - then VG would be rendered always in forward regardless of camera rendering path, but we would then handle one realtime directional light and one spherical harmonics light only). I'll think how to handle this better (shadow collecting) lateron.

    Tom
     
  11. BBRome

    BBRome

    Joined:
    Jul 3, 2012
    Posts:
    373
  12. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    @BBRome,

    The only up to date source for my assets is AssetStore. Unitymagic shop is ancient one. I wouldn't even bother with them. Actually, I haven't been getting ANY royalities from them for about 2 years, so - you can buy there - at your own risk ;).

    Considering your refund request. I've got no problem with it. You can go and ask AssetStore for refund as I can't give you your money back - Unity got them currently (till next month paymanet). And this is only Unity AssetStore that makes refunds, not developers. Unity might sometimes ask developers for refund approval in some problematic case. The case is not problematic for me. You can take your money back. So - do as you wish.

    I don't want to get the money and make anybody feel cheated. The reason I'm not answering your posts is that I don't want to make our discussion too emotional or personal. If you really want to use VG, wait a bit for your own good. If you get refund and see soon that VG works on opengl (because it works) you would need to rebuy VG at full price. Actually I wouldn't mind getting $75 instead of $37.5, but I'm trying to be kind person... Trying to behave seriously (even though I make mistakes - that's absolutely true), not kidding my customers.

    Kindest Regards, Tom
     
    Last edited: Jul 19, 2014
  13. Marcurios

    Marcurios

    Joined:
    Nov 19, 2012
    Posts:
    88
    thanks tomaszek, i'm quite happy with this asset now after i worked out the initial problems, keep up the good work !
     
  14. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Now your move (as keeping obsolete discussions on AssetStore review page is no good I believe). Because - just as I promised:

    Volume Grass 1.5b is on AssetStore
    All with new, very friendly price - check this if you're curious.

    Enjoy, Tom
     
  15. Marcurios

    Marcurios

    Joined:
    Nov 19, 2012
    Posts:
    88
    I understand, i wil adjust my review accordingly..

    Edit: changed my review, and thanks again Tomaszek !
     
    Last edited: Jul 15, 2014
  16. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Marcurious,

    I'm glad you found VG matching your expectations. Considering AssetStore reviews - there is a subtle difference between correct behavior and tacful behavior. I'm so sorry not everybody can clearly see such difference like you do.

    Wishing all the best with your projects, Tom
     
  17. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I'd like to ask Mac users to check both web demos now - meadow should work as well as soccer demo. BTW - is there such thing like browser cache for Unity movies ? If so - clear it before...

    Tom
     
  18. Marcurios

    Marcurios

    Joined:
    Nov 19, 2012
    Posts:
    88
    Thanks, and you're welcome Tomaszek, you helped me out real good, so it would be rude not to correct my review i think.
    I know not everyone thinks like this, but for me it's a no brainer.

    Yes i like it a lot, nice touch that i can diversify by making my own grasstextures for it and configure it so well with the settings you built-in.

    I don't think browsers can cache Unity's browser game settings, but it could never hurt to clear one's cache before opening a demo, just in case.
     
  19. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Wow, nice price is really friendly ; )
    Could you update your demo to include deferred as well, im curious how it will look since i don't use forward.
    Will most likely pick this up very soon : )

    Btw, is it possible to change grass height during runtime making the impression that it grows? Not a big thing just caught my mind : )
     
  20. mikaelwallin

    mikaelwallin

    Joined:
    Dec 11, 2013
    Posts:
    20
    VolumeGrassEdit.jpg

    Hi Tom,

    I have an issue with building the grassmesh. Sometimes Unity hangs when I try to build a mesh with a bit higher node count. It seems that it runs out of memory at VolumeGrass.cs line 556. I have attached a file that is the usecase that I am after. It hanged when trying to build the grass mesh. It seems that its the node count that is the biggest problem. A large mesh with low node count is easier for it to build.
     
  21. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    vertex green color defines coverage. It works the way where vertex color is pure green (g=255) this vertex is pushe down to the ground. If you can animatex volume mesh vertices colors realtime the impression might be that grass is growing up from the ground. Of course it is not real "growing" as we actually don't animate grass size but modify it's world y position. You could even try to modify a bit shader (tweak in 2 -3 places in VG_Base.cginc) so growing state can be controlled globally in material inspector.

    I'll try to check this right now. Meantime - I see you place the grass in an architectural scenario. You environment is made of meshes rather than terrain. In your case it might be much simplier to use Volume Grass script on custom mesh (look for such component). There is an example scene that presents this. I placed simply a plane and script on is. Clickng a button will turn it ino volume grass. In your scene you could separate grass areas as separate meshes and use it like I said. I don't need to manually construct grass outlines in my editor as you've got it already there.

    Tom
     
  22. mikaelwallin

    mikaelwallin

    Joined:
    Dec 11, 2013
    Posts:
    20
    Thanks for quick reply I have tried the component. I have an issue with the sidewalls.(When the mesh I put a component on is divided) I also think it looks flatter than using a mesh. It would otherwise be better. Yes it is architectural scenario. I use a Nvidia Quadro 4000 card. Two Images. The first is with two grass meshes the last is component. VolumeGrassSidewallsIssue.jpg VolumeGrassSidewallsMesh.jpg
     
  23. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I updated meadow demo - now you can switch between forward and deferred. Apart from MSAA not present in deferred I see no visual difference:

    meadow demo (forward/deferred switch)
     
  24. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I see the first one you tried to blend two grass volumes. You need to remember turning off building sidewalls for additional grass (it cuts holes in first volume). You disable bsidewalls as per node setting. Select node and you'll have an option on the bottom - node properties - turn off sidewalls.

    For the second screenshot. You need to copy grass area and push it a bit up (to the required grass height). Then you'll see grass sidewalls. You might not like it though 9then leave it as it is). I see your grass is distorted and I'm wondering if this is not caused by wind. Try to switch off wind in grass material and you'll see. I know that complex meshes divided into parts might be problematic for using custom mesh script component. You'll probably need to work on them manually after applying grass (by removing sidewalls where they are not necessary). You can also export extruded mesh and see how it's constructed - sidewalls bottoms have vertex color red=255 and normals that points up (the same direction as upper sidewall border normals point). So - with some effort in modelling software you could make your own volume meshes ready for grass material.

    Tom
     
  25. mikaelwallin

    mikaelwallin

    Joined:
    Dec 11, 2013
    Posts:
    20
    Ah thanks I missed that one.

    I did what you said. As you already figured the automatic sidewall generation is a bit off. The distortion is probably due to the topology or uv mapping used in the ground mesh. The ground mesh is automatically generated from height information. So the topology is ugly(bad).

    I exported the sidewall to 3D Studio Max made a few changes and imported back into Unity. I added the GrassRenderDepth shader to a material and use that on the adjusted sidewall mesh. However it only hides the grass behind it. What more do I need for the sidewall to behave as the automatic?
     
  26. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I'm wondering about distortion. VG shader doesn't use uv. Mapping is made top planar in world space xz plane. Sidewalls. There are 2 types of sidewalls. One is placed at edges of extruded top surface of grass (you see it from outside). Look also as child object of my grass - these sidewalls are meant to cut adges when we look from inside of grass outward direction. This child sidewalls doesn't need any specific setup, they don't even need normals. Remember that they need to be set for culling so that they are visible (although they are actually invisible, but write into depth buffer) when we look at them outward (staying with camera inside grass volume). I will try to make some video about VG principles later.

    Tom
     
  27. Marcurios

    Marcurios

    Joined:
    Nov 19, 2012
    Posts:
    88
    Question, can i double the grasstexturesize and make it 1024px ?
    I mean, do you use pixel measurment or divide in your shaders ?
    like 1/4 of texture, if so, i can just up the resolution and have more detail in it.
     
  28. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Yes, I measure it. From my tests it shoul work also on non square textures - look at my grass blades editor - number of grass slices times source texures height means texture height while we can adjust also texture width. Square textures are best tested by me, so if you experience any problems with non square - let me know.

    Tom
     
  29. mikaelwallin

    mikaelwallin

    Joined:
    Dec 11, 2013
    Posts:
    20
    It is the child sidewalls that caused me trouble, when I checked them again today I don't have the same issue(must be driver issue then). I include a few screenshot of the distortion. This is using the Volume grass as component.

    VolumeGrassDistort.jpg Distortion2.jpg Distortion3.jpg
     
  30. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Could you provide me with a sample mesh of any grass area in your scene - preferably this with hills above. You must know that Volume Grass uses top planar projection and on steep hills grass can look stretched. I like to build it on my side using your mesh (when you refer to Volume Grass component I understand that you take your custom mesh). To remove distortions in parallax shaders (VG is an example of such shader) it's sometimes necessary to tesellate mesh more (very big triangles can cause distortions).

    Tom
     
  31. CHoltz

    CHoltz

    Joined:
    Sep 6, 2011
    Posts:
    20
    Hello,

    First, I would like to say I am really excited about this tool. I have been looking for a better grass solution for covering large areas, so thank you for making this.

    Issue 1: Our scale is much larger than the max grass height of 3 that is currently hard coded into your system. Is there a way we can override this limitation?

    Issue 2: Clicking+Alt does not always show bezier handles on the nodes. Is there other step in the work flow?

    Thank you for your time and help--
     
  32. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    @CHoltz,

    Ad.1 - does the grass need to be higher than 3 m in world units in your project ? If so this is only the problem of VolumeGrassEditor.cs - find right slider there in code (look for label description of height slider) - there are params indicating min and max height in the same line of code:

    Code (csharp):
    1.  
    2.         GUILayout.Label ("Grass height in world units", EditorStyles.label, GUILayout.Width (180)  );
    3.          _target.mesh_height=EditorGUILayout.Slider(_target.mesh_height, 0.02f, 3f);
    4.  
    Replace 3f with the value needed (put f at the end if your value has fraction)

    Ad.2 - I assume that sometimes beziera handles work, but not always. Could you check if your scene view tool is "hand" ? Check if or issue is related to which tool is selected.

    Tom
     
    CHoltz likes this.
  33. CHoltz

    CHoltz

    Joined:
    Sep 6, 2011
    Posts:
    20
    Thank you very much for the support and help, I really appreciate it! It was very easy to make the script change. I am now encountering some new issues that are hard to describe and may be tuning related.

    I have set the grass height in world units to 10.

    The grass in-game appears to be almost a mesh with flipped normals. In the editor I can only see the blades of grass if I zoom in very close. Do I need to increase another value in the script to accommodate this new increased height value?

    Thank you again for your time and help!


    Volume_Grass_Debug_Screen-1.png

    Viewport - zoomed out a little bit
    2014-07-18_1527.png

    Viewport - When I zoom in closer I begin to see blades
    2014-07-18_1528.png
     
  34. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    This is to be set VG general settings - far distance and far distance fade params. I might need to adjust ranges accordingly (as like in case of height) because your scene scale is 100x higher than normal.

    Tom
     
  35. CHoltz

    CHoltz

    Joined:
    Sep 6, 2011
    Posts:
    20
    Hello Tom, thank you for the response! I was unable to get anything that looked correct for my 100x high grass in the general setting tuning. Are the "far distance" and "distance fade parameters" exposed in the Inspector or is this something I should find in the script? I am sorry I did not understand the feedback 100% Thank you again--
     
  36. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    It's available in VG material inspector. So - to tweak it you need to look into shader code - properties block and find right "Range" kayword values.

    Tom
     
  37. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I'm going on holidays for a week so I could be not available till the beginning of August (can't tell if will be able to use internet on the island I'm going to).
     
  38. Hedonsoft

    Hedonsoft

    Joined:
    Jul 11, 2012
    Posts:
    168
    Love this Asset, great look for my game/ The onle issue I'm having is getting it to work well with Skyshop. If I add a light to my scene the grass looks good but if I try to just use one of the Skyshop shaders the grass is just a solid colour. Are there any ways to make it look good with Skyshop?
     
  39. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    @Hedonsoft - skyshop has its own set of shaders. Volume Grass has its own shader that renders grass. You can't "merge them together" (that simple). But I put IBL switch in my material that you can use to light your grass with diffuse and specular (although quite basic) cubemaps. If you use Skyshop shader over my volume model you'll see nothing but volume shape (solid), because that's my model. What you see as grass billboards over the meadow is realised in my shader. Although they looks like separate mesh elements - they are not mesh based at all - that's why you can get unlimited grass density with no CPU overhead.
     
  40. FlarePoint

    FlarePoint

    Joined:
    Jun 18, 2014
    Posts:
    6
    Hello, i'm wondering if this can be placed easily onto the 'Terrain' object or does it have to be on some sort of plane or cube. And can it also be painted on like textures?

    Thanks.
     
  41. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Yes, you can stick grass patch on any object. In the meadow scene thats the case. I made a terrain and built a grass mesh using VG editor. Currently you can not paint with grass. Instead you can make a grass patch. Tesellate it if needed and remove grass per vertex on some areas. On meadow scene the hole made near the big tree is an example.

    Tom
     
  42. vkimone_1

    vkimone_1

    Joined:
    Jan 15, 2014
    Posts:
    2
    Is this support lightmapping ?
    When I bake my scene, I am getting the following waring message : Primary UV set on is missing!
    Of course, sidewalls child object was not be marked as static.
    What's problem??
     
  43. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    I'm not sure, but indeed VolumeGrass don't use primary uvs (it's mapped in world space xz plane top planar), but second uvs should be there in mesh generated by my script. This is set used by lightmapper I believe, so I don't know why Unity complains. Are you able to generate lightmaps with wargning or they just don't work at all on grass ?

    Tom
     
  44. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Hey Tom,

    I'm using your RTP3 and I'd love to implement this into my project ... I noticed you posted already that VG2 will hook into a splat map (which I assume means you can paint it on like normal?) ... any ETA?

    Also, if I switch over from using standard grass/flowers painted with a heavy density to this product, what performance change should I expect? For the better or for the worse?

    Can this produce fields of grass and flowers like what would be found in a more traditional RPG, or only "field" type of grass?

    Thanks!
     
  45. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Hey,

    I was too impatient and just picked it up. However, the shader isn't working right for me. It's giving me an "empty program string" error. I'm actually getting this for a few other shaders as well ... any idea why? I'm able to run your demos on the web just fine, so my computer can handle this ...
     

    Attached Files:

  46. DGordon

    DGordon

    Joined:
    Dec 8, 2013
    Posts:
    649
    Okay, I feel like I'm spamming your thread, sorry! It was just a problem with my project ... a fresh import worked fine. Very cool, thanks a lot.
     
  47. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    VG2 - I can't promise schedule here. Even ETA, sorry. For VG1.5 - your GPU hit will be higher, but you release CPU. One grass field is realised in 1 draw call, but its shader is obviously much more expensive than default alpha cutout used for Unity's vegetation. Anyway - for very dense grass you'll always get it working faster on VG. You're free to add some flowers here and there - they don't need to be that densely placed. You would like to bake flowers in my billboards used in VG shader you can - use editor that's meant to produce billboard slices texture out of source grass blades (you can use anything there).

    Tom

    P.S. VG2 will be more flexible (like using texture based coverage - "painting grass") and better looking but the same time this will also lead to higher GPU load. But this is meant to be used on new games, so GPUs like GTX470 and up isn't that big problem I guess ? (on such GPU VG1.5 works very fast, VG2 willwork quite reasonable).
     
  48. -Singularity-

    -Singularity-

    Joined:
    Jul 27, 2014
    Posts:
    122
    Hi Tom,

    Until now I've been holding off purchasing this in anticipation of V2.

    If I do buy now and set up a large scene using V1.5, will it be easy to upgrade to V2? Or would it be optimal to start from scratch using V2?

    If it will be as simple as updating the shader then I may as well purchase now!

    Thanks
     
    Last edited: Aug 22, 2014
  49. tomaszek

    tomaszek

    Joined:
    Jun 18, 2009
    Posts:
    3,862
    Switching between VG1.5 and VG2 might be involving a bit . However VG2 you'll be still able to use current funcitonality, new coverage system is something quite different and probably wont be done "automatically" (or I'll come up with some solution for this which is theoretically possible).

    Tom
     
  50. -Singularity-

    -Singularity-

    Joined:
    Jul 27, 2014
    Posts:
    122
    Thanks Tom, I think I'll go ahead and purchase soon!