A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Now in Beta! Get 1:1 live lessons on any Unity topic or help troubleshooting your project – Connect with an expert on Unity Live Help
Discussion in 'Assets and Asset Store' started by Nonakesh, Aug 17, 2015.
Just wondering, could you have a cube mesh but with sphere collider? Might that work?
That would still have the same problem. I made the displacement system (and the rest of the shader too) under the assumption that grass grows upwards, creating a more general system that supports all directions would be quite complex and use a lot more performance. Actually I can't even think of a good solution that would work in all directions, other than using something like the old displacement system, where you raycast to see the current point on the texture and then change the texture directly. And that system had quite a few disadvantages, first of all performance.
Hey @Nonakesh. Thanks for the response. Would it be possible to send me a build of the old displacement system so I can try it out and see if it will work for me?
I never removed the files, I just changed the example scene to the new system. Look at the CircularDisplacer script and the GrassManipulationUtility. You'll have to do some coding on your own, but those files should give you a basis for the work.
Thanks @Nonakesh. I'll give it a look.
Hey guys! Is there a way to make the plugin works for Lightweight Render Pipeline? Now it's a little pinky =)
I haven't looked into the lightweight render pipeline yet. does it restrict the shader level (e.g. DirectX / OpenGL number)? I will try to look into it as soon as possible, but I'm on holiday right now and have to work on a project with an fairly tight deadline right after. After that I'll finish the fallback system and look into the different pipelines. Fallback will probably be first, because it will (hopefully) be compatible with all pipelines and systems.
I have OBJ terrain that is scaled to (0.1). And all the object are scaled to (0.1) too. I tried to add grass shader by method on PDF, but the grass still huge and bigger than the unit that I had. How can I fix this? I can't resize back the terrain to 1, because the terrain extremly huge, let's say it's a country.
Oh, and also is there any other way to filter the grass beside the paint method? Because, yeah, terrain is too huge for me and such a pain to do it manually.
Hey, sorry for the late answer, as I've said previously I had to work on a project with a really tight deadline.
If you haven't figured out a fix on your own yet, you can simply scale down the grass width and height in the material settings.
You could create a script to calculate the density texture based on slope, or any other values. Then you could manually fix minor issues. I could go into more detail, if you want.
Hi, has anyone experienced a problem where you get Gfx.waitForPresent at 99% when using this asset? I drop from 500 fps to like 5. Its the same in the demo scene.
In my experience Gfx.waitForPresent just means that the GPU is working on rendering, while the CPU isn't doing anything. Either your GPU can't handle your current grass shader settings, or there is something else going on that is causing GPU load.
What GPU do you have? Did you leave all material settings at default? Could you try reducing the Max Density and increasing the Density Falloff setting?
@Nonakesh: I had sent an email through the site, but I have not heard back. I was just wondering do we have a plan or release date to have the grass work with the High Definition Rendering Pipeline or the Light weight render pipeline. I create high-end modeling for the engineering company I work for and having grass on the sites would improve them dramatically. Please let me know thank you!
Just as a side venture, you might make some money off of is using your shader for trees. Have the leaves be placed and aligned on the normals of the limbs with random rotations maybe *shrug*. Maybe like a hair shader that has collision detection? So if you walk into a bush or tree it will react to the player. Don't know. Not a shader programmer. I just make the models and textures.
Sorry for not answering your mail, for some reason it didn't show up in my mail program... I'll make sure to check manually in the future.
I am currently working on a very big update, with quite a few new features, but as it will also introduce some minor breaking changes, I'll have to do a lot of documentation work too. It will still take a while, but I will definitely look into supporting the HDRP if possible (it should be possible, unless Unity did some very strange things).
I can't say for sure, but I believe that the update will be ready within the next few weeks (Documentation and video tutorials will be a large part of that, also a new example scene, etc.).
If it turns out that HDRP can be supported in a few lines, I'll post the fix here.
Trees and bushes might be something I'll be looking into after the large update.
Hello, this grass package has worked wonders for our game and has never presented any issues of any kind. However, we have recently been developing on an Xbox Dev Kit and it seems to crash after a specific amount of grass sharers are active.
We have disabled the grass and have created builds with no grass, these builds work perfectly. When the grass is enabled and it crashes the Xbox Debug Menu does not seem to give us any information as to WHY it is crashing. I was hoping that you might have some idea as to what is causing these crashes, the grass is not terrain, and they do have Mesh Colliders attached.
There was (or is?) a bug in Unity where showing too many grass materials at the same time would crash the editor, maybe that is the same problem you are having? The answer from the Unity support was that they couldn't look further into the problem. Maybe you should try to contact them as well? If it is the bug I'm thinking of, you could try to not load all the materials at one, maybe create some sort of delay, so the compiler isn't overloaded? I'm honestly just wildly guessing here, but I hope it can lead you in a good direction!
@Nonakesh I use a procedural system to spawn buildings, how could I make the grass stop at the edge of the building? Also, is there anyway of preventing it from crossing inside the walls?
I know about using textures but Im trying to do this at runtime... what do you suggest?
EDIT: So I've done what I should have done before, I searched the thread. So from what I read there is no built in way to do this and my options are either modifying vertex colors or the textures at runtime... that seems quite complex. How do you define the area to be marked on the texture or which vertex to be modified? I could use raycasting but covering every millimeter of the ground sounds crazy... whats the best way to do this?
I wish we could just add a script to objects and be done with it and even without a procedural system, having to modify textures or vertex data everytime we modify the map is a real pain in the arse. Would definitly be a nice improvement (even if some post processing is required before it takes effect).
There is actually a fairly easy way of doing this in newer versions: Just use the burn feature! Get the displacement system set up and add a plane with 100% burn to each building, change the burn color to white (no recolor) and each building will remove the grass around it. You could even change it so grass is gradually getting smaller towards the building. For more advanced things, like changing density you'd have to change the texture, but I don't think that would be necessary in most cases.
Hi, Does anyone know what I can do to get rid of those shadow cascade artifacts?
What you are seeign is the grass set to render "shadows only". When rendering the whole grass you still see the shadow artifacts through it. Tried playing with the settings of the lights, the cameras, the plane underneath the grass, the quality settings (shadow distance, cascade, etc..)
Only 3 things had any effect:
Changing the projection to "close fit" which made the artifacts appear as lines across the field of grass instead of being concentric.
Setting the cascades to none
Moving how the cascades are split which just moved the artifacts closer or further.
Is disabling the cascades the only solution? Feels like the cascade blending is having issues but im not sure what to do about it.
@Nonakesh Thats a great idea! But I didn't want to go through each assets manually, so I settled for what I knew which is raycasting up at each vertex and setting its color. Takes about 1.6 seconds for our small maps and it makes it easy to allow grass under a balcony for example, but not through it.
On the other hand your solution would be instant... I'm just not sure how to create that burn plane in code so it takes into account the shapes of the buildings and allows grass in short spaces.
Hi! Sorry if I missed something but here's a couple questions from me:
1) Does this grass support alpha transparency? It's just I don't want to rely on DOF and FXAA/analogs since they often make things look worse and add up quite a load on cpu/gpu.
2) Does it support object masking/occlusion so it wouldn't stick through rocks or boards or floor/etc?
Hey your shader is beautifull! but sadly I'm having troubles in VR with it:
Inside VR (I used the latest steamVR plug in) and Unity 2018.2.02f.
It seems that the grass is rendered less dense once the Grass and the Camera is away from the center of the Scene (0,0,0,).
I had a plane using the grass shader and the SteamVR CameraRig in one empty Gameobject packed together and once i change any axis of that object to as much as 100 the grass is almost gone. But even changing it to only 20 or 30 makes the grass get a lot less dense.
I have tried using the Object Space mode (true) but it doesn't make any difference.
Does anyone encounter a similiar problem? is there a solution to this?
Is it possible that this problem has to do with the bounding box of the mesh? I'm just guessing here, but you could try adding the bounding box fix - script and see if that helps.
Other than that it might be a problem with Unitys implementation, in which case it would difficult to deal with.
I'd personally just create a burn material that is single color and burns away all grass, then use the Mesh class to create a mask below your buildings. That should still be very fast and you could support procedural meshes as well. Or well, just do the work manually, depending on your game that would probably be the fastest way.
1. It doesn't support alpha transparency, only alpha cutout. Alpha transparency isn't possible, because sorting all the blades of grass is simply impossible. The new version I'm working on will support Alpha to Coverage masking though, so the borders will look smoother than before, if you enable MSAA
2. Yes, but you'll have to create the masks yourself, either with the grass painter, or via script. Or you could do the same thing I've recommended in the post above and use the burn system to mask out grass around your objects.
Have you tried using the random direction grass type? If that doesn't help, it might be that the camera position works differently in VR. I'll check and see for myself if that's the case. It should (hopefully) be an easy fix in that case.
I just tried it with randomize direction and it doesn't solve the problem.
I figured out that the problem can be resolved when I switch to multipass rendering, however that ruins a solid frame rate for vr :/
I also had another idea to improve performance and looks for this beautifull shader package.
It would be great to have an additional shader that can be applied to the ground (like FlowerFloor Material for instance) but instead of beeing only one colour it could be combined with a higlight color. Blending those two with the same movement that the global wind uses. Like this the wind movement could be visible even when there's only very few mesh grass at areas far away. If it could be controlled with similar density fall off paramters that make the wind appear only in distand areas where the actuall grass fall off is already noticable.
Just an idea but maybe it makes sense?
Are there any plans for iOS support? I know it sounds kinda idiotic because it explicitly states its a DX11 solution, but I thought I'd ask.
Background: I'm working on a project that's been in development for almost 5 years and got handed to me for an internship job. I've been refactoring and cleaning it up for three months now and it's more glorious and performant than ever. But now - dear me - I actually have the time to start working on the mobile version for iOS. And bam! Someone some time ago made the call to use your asset probably without knowing there'd be an iOS port in the future.
And that's where I am now.
The grass probably isn't THAT important for the mobile version, but I feel guilty for doing this:
... clearly a lot of work went into this asset and now I'm basically stamping all over it with a few lines of code.
if i duplicate mesh plane in 3d software (and move it a bit (for using grass shader in unity next) it gets discarded, is there any other solution ? maybe like with variation shader.. thx
Hello,There's a drawcall issue.
I created three planes in a Scene, which has only one directional light. Then I gave them the Stix Games/Grass material;
In forward path, the three planes just cause 2 drawcall, but in deferred path, the three planes caused 6 drawcall.
Could u pls tell me why and how can I reduce the drawcall of grass in deferred path;
@Nonakesh The bounding box script doesn't change anything. Only way to get rid of it is to turn off either the ligthing, the shadows or the shadow cascades.
Does the shadow of the grass always does this? AFAIK we havent done anything special. That lawn is composed of multiple 20x20 tiles perfectly aligned. We checked the mesh inside out (uv, normals, etc) as as far as we can tell there is nothing wrong with it.
Looking at it again, the artifacts (or rather, the missing shadows) appear to be of the same shape of the tiles.
This screenshot seems to confirm that:
Also, besides the missing shadows artifact, can someone confirm if its normal for the threshold between shadow cascades to be so apparent? Shouldn't there be some blending involved?
You can clearly see the line here:
Hi! Any news about making the plugin works for Lightweight Render Pipeline? We were thinking to change into Lightweight Render Pipeline and this grass is awesome. Thanks!
You could actually accomplish this, by adding a second material with a different falloff. You'll have more control over this in the next update (which is actually fairly feature complete now, but I'm still having some documentation and tutorial work to do, as there are some minor breaking changes)
And I'll look into single pass rendering, but probably after finishing this update.
The new version will add a full CPU fallback system, so it will be possible to have at least a few grass billboards on mobile, or just deactivate the grass automatically.
Just duplicate the plane in Unity, that shouldn't cause any problems.
In the currently released version of the grass shader deferred rendering is not yet supported. This will be added in the big update I have been working on (which will hopefully be finished soon-ish)
It kind of looks like it isn't using the camera position for it's density calculations? I'll have to look into this.. again, probably after the large update. I had to delay it a lot already (because of.. well, life happening) and I'd like to release it soon, if possible. After that I'll look into all those bugs.. which should have a much faster patch cycle again. Bug fixes and minor features need much less testing and documenting.
I'm afraid I will not support HDRP or LWRP until they have stabilized a bit and the documentation is better. I've tried working with the HDRP and I got the shader to work, but only in unlit mode, I wasn't able to get the lighting information in the shader. I'll look into it again in the future, but it's not a high priority feature at the moment, as those render pipelines are still experimental anyways.
Thanks to give us some news and still support this great asset!
@Nonakesh Allright, I understand. I'll live with turning off the shadow cascades for now. In the mean time... what big update? Can anyone fill me in?
Hi, I read above that you're mid big update -- lots of exciting stuff -- excellent to hear.
EDIT: Doh! Realised I was looking at an out-of-date version. My apologise. I'll update and feed-back if relevant
Keep up the good work!
Hey @Nonakesh I'd just like to add my vote for Single-Pass stereo rendering support please (for VR)!
Hope the new update is going well - do you have a planned ETA for it?
I'm using the shaders that I bought very well.
I have a question I'd like to ask you.
While I was laying around the grass, I saw some of the empty areas.
Prior to this operation, the polygon size is uniform because the ZREESHER feature in ZBRUSH is used and imported.
But as you can see in the image, the grass is not uniform.
I don't understand why this is happening.
Is there a way to solve this problem?
(This question was written by the translator. Please understand that there may be a mistake.)
It's right at the top of my Post-Update TODO list now.
No promises though, it can be a bit hard to predict the problems with shader stuff in Unity.
I'd like to finish it this month, but considering I wanted to finish it during the summer, I can't really make promises. But that was mostly some unpredictable stuff getting in the way, so I'm fairly confident this time.
I have no idea what the problem is. Honestly it looks fine to me. Could you give me another screenshot from a different direction? Maybe the normals aren't right? Or there could be some invisible geometry between the triangles? No obvious problems though.
The largest thing is probably the CPU fallback. Basically you press a button and it renders the DX11 grass onto a texture atlas, which will then be used for a much less performance intensive renderer. I could even imagine it being used for creating grass textures in an easy way, it's quite nice to use, in my opinion.
Other than that, the whole workflow is different, displacement is a bit more straight forward, you don't have to set up the layers yourself any more. The grass now has a grass mesh filter, which can automatically normalize meshes, so if you have a mesh with very large and very small polygons, you can press a button and it will (more or less) work perfectly. You don't have to copy your mesh/terrain any more, that's handled by the scripts.
Also quite a few smaller changes, for example the burn system can now change the grass color dynamically, so you could use it to remove grass below a building in an RTS, while still being able to have charred blades of grass, where your flamethrowers did their work.
I bought this a while back & just finally got round to importing it into my project to try out. Really loving the results I'm getting so far, but I do have 1 issue which I'm unsure if anyone else would have brought up...
My game is using spherical gravity (mario galaxy style) - so to have grass on any side of the planet I need the render texture of the player stamp to be a cube instead of 2d.. I think?!
Changing that removes the grass from the scene so if that is the workaround I might need something custom?
Thanks for any help, it's a great shader!
If I'm understanding this right, you want to have a 3D world, but still use the grass shader with displacement? If you just want to get the grass working, just set it to follow surface normals in the shader settings. If it's about displacement, this will be more difficult. You could either edit the displacement texture directly (which is very performance costly, but there are a few old scripts included with the shader that do just that), or you could try getting the current system working. I think it might work if you rotate the cube instead of the camera. The displacement camera has to keep it's rotation, though. The displacement system is hard coded to work top down and it would have been extremely complicated to support planets.
Hi thanks for the quick response.
Can you clarify what you meant by 'rotate the cube instead of the camera'?!
I tried all sorts of rotation adjustments to the stamp object but didn't get any results, but don't think that's what you meant.
I know that idea might not be helpful depending on how you've implemented your project, but the easiest way of getting displacement to work on a spherical world is probably to rotate the world instead of the camera. For example you could rotate the world each time a certain threshold is reached, or just continuously update the rotation of your planet to keep your character in the center.
Oh ok, yeah that won't work for this project unfortunately.
Can I ask about the other method..
How would I go about trying this?
I don't need the texture to keep what is written onto it for very long. I have it set to 1.5 seconds lifetime on the displacement trail renderer at the moment. Although even with just the one top down camera at the moment, the displacement does begin to drift out of place the further from the center you go (due to the curvature of the planet).
You should look at the old CircularDisplacer script. It will need a editable displacement texture. The performance isn't affected by the path length, but by the texture size. Basically a larger texture will be more accurate, but it will also come with a higher cost.
I also think that you'll need some scripting to get the displacement working, but it should be possible to get it to work fairly smoothly.
When will the deferred rendering be supported?
Actually, that's a feature I forgot to mention! It will be included in the next update.
Hi, do you know how I may possibly fix the issue of these conspicuous tiles?
As you can see in this image, the grasses look like they are divided into many tiles, and it kinda looks bad.
I'm sorry, but it's a bit hard to see what's going on here... can you post an image that is a bit clearer? From what I see here, I don't think the grass causes the tiling, but the texture you have on each tile. The grass itself should never actually be tiling, unless you are using object space mode which should only be used for moving platforms.
Hey, just got your grass shader. I plan to mostly use it on Unity's terrain and I'm happy with the results. However, is there any way (like unity's grass painter) I can remove grass that has been added to the terrain? Because when following your steps grass is added everywhere, what if I needed a path with no grass on it for example.
I noticed in 2018.3 that the shader is broken when the terrain is set to be instanced. I don't know enough about terrain or shaders, but is this something that is expected? It's not a big deal since I have a system for handling the terrains anyways so terrain instancing isn't big for me, just something I ran into.
I'm sorry. I forgot to mention that this is actually a top down view of a large prairie, and the grassland is tiled into many different visible sections of squares, which is a behavior that I do not wish to have.