Jump to content

How to make realistic detailed grass


photo

Recommended Posts

Hey.

i have played a lot with the grass in unigine already and using it in several projects in different ways.

I think it is a very pleasing object to work with and it does its job well.

BUT i never got a very photo realistic look to work.

One fact I am facing (and it might be one of my issues) is, that the alpha Test cuts out the grass very crudely.

- No matter what I try, I always loose details. -- Mipmap bias does help a lot, as the mipmapping is cutting even more away from the alpha in the distance.

It would be very helpful, if the distance is adjustable in some way? 

It is very costy when turned up too far as well.

- Which image sizes is the best to work with for the grass texture? 4K, 1K ? I experience different results. Is this a matter of mipmapping as well I guess?

- Is there any change, to get alpha Blending to work, eg. for foreground blades (certain distance) to get fine details and smooth blending. (Does that make sense)?

Or should I combine tecniques? Using other objects for the Higher grass blades.

- I got a small grass, lawn type grass working quite well in the other project (So small grass blades at a certain distance blend well).

- I saw the rendering SSS feature update in 2.8. (But that doesnt cover what I amtalking about)

 

Anyway, this is not very exhausting what I am asking here, but I am more asking for some hints, how to make it better (to use and produce better results) and if there are any ideas about making the grass look more realistic.

Does anyone have some ideas, examples or hints for me to improve?

Thank you!

b.werner

 

grass4.JPG.03f1c8ad5ebff1a8636f255cf9c2a30e.JPG

grass_q1.thumb.JPG.777a4f425825bddd8919c7b4498b8a97.JPGgrass_q.thumb.JPG.49c6239a4bdc8a7943727bd21c1f82c6.JPG

 

 

Link to comment

Clutter is definitely better.

many more ways to control thrugh the mesh material.

A lot depends on the texture. Minor changes can effect a lot.

Naja. Will work on ... 

I am curious, what your artists will come up with :()

w.

 

grassd.JPG

Edited by werner.poetzelberger
  • Like 1
Link to comment

Okay, I got some info.

  1. Yes, as you already said, the albedo texture is the first priority. The better one you'll get the more convincing it'll be. Can't be precise here, everything depends on how much time can you invest in this. More efforts = better result :)
  2. The normal map should be baked from high poly mesh only. Remember the issue with normals we've faced in the previous case with an animated model? I think it can strike again here.
  3. Variation can be achieved with multiple clutters using different meshes.
  4. Grass_base still could be useful. You can add ObjectGrass as a sort of a filler or less detailed grass to hide bald patches or make the field looks denser at less cost.
  5. Please, remember about performance. Clutter may give you great visuals, but it will drop performance if you need a huge area filled with them. Clutter grass can help in the "area of interest" only. By this, I mean the location where you'll be moving around. You still can combine it with grass_base for low-poly LOD.

Hope this helps.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

This article is big inspiration:

https://80.lv/articles/creating-next-gen-grass-in-ue4/

Conclusion is, that mesh grass is way to go and under some circumstances can have better performance than BB (depends on renderer though). 

So only question is, how Unigine renderer works for clutter objects? Does have overdraw sensibility like UE (=> more polygons and less overdraw will have better performance), or more like Unity (overdraw is not big issue in compare to polygons).

 

Edited by demostenes
Link to comment

Hi @demostenes,

I've checked with render team and it looks like there's no straightforward answer on your question. I'll try to explain why.

  1. The increasing draw calls number, as well as the number of polys, will always drop performance.
  2. Polygons will be rendered at the same speed with similar shading. Engine contributes a little here. In other words, the statement that Unreal handles polygons better than Unity should be evaluated with equal shading quality in both cases.
  3. However, draw calls are engine-dependent, so here you can get a performance difference with the same number of calls depending on the object and content being used.
  4. DIPs (draw calls in UNIGINE terms) also depend on CPU speed. Slow CPU + top GPU will give bad result in the scene with high DIP count, while probably be okay with high-poly content.
  5. Another noticeable thing that will affect scene performance is culling. Big objects can be rendered when it's really not needed and cause excessive DIPs and polygons to be counted.

To get better performance with your scene you'll have to test how the combination of used objects and content performs on the target config.

Sorry, I didn't answer the exact question, but the topic is more complicated than it seems to be.

Thanks.

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
2 hours ago, morbid said:

Hi @demostenes,

I've checked with render team and it looks like there's no straightforward answer on your question. I'll try to explain why.

  1. The increasing draw calls number, as well as the number of polys, will always drop performance.
  2. Polygons will be rendered at the same speed with similar shading. Engine contributes a little here. In other words, the statement that Unreal handles polygons better than Unity should be evaluated with equal shading quality in both cases.
  3. However, draw calls are engine-dependent, so here you can get a performance difference with the same number of calls depending on the object and content being used.
  4. DIPs (draw calls in UNIGINE terms) also depend on CPU speed. Slow CPU + top GPU will give bad result in the scene with high DIP count, while probably be okay with high-poly content.
  5. Another noticeable thing that will affect scene performance is culling. Big objects can be rendered when it's really not needed and cause excessive DIPs and polygons to be counted.

To get better performance with your scene you'll have to test how the combination of used objects and content performs on the target config.

Sorry, I didn't answer the exact question, but the topic is more complicated than it seems to be.

Thanks.

Ok, I ve got your point :) Anyway to be more precise, Unity has 64k vertex limit on mesh and it batches grass into 64k objects. So adding 10x more polygons can in the worst case cause 10x more drawcalls. AFAIK UE and Unigine does not have this limit, so it should behave better. Also what I read from various documentation, for modern GPU fill rate is bigger bottleneck than polygons (with reasonable shader), so it often makes sense to increase polygons of alfa blended meshes to lessen overdraw and fill rate issues. There must be of course ballance between number of polygons and alfa blended pixels.

Btw, what about Vulcan? It seems it was removed from the roadmap and my guess would be, tha it should help in scenes with lot of DIPs.

Link to comment

Alpha Blend helps a lot in terms of render quality.

Supersampling helps as well, then alpha test can work as well, but costs a lot performance when rendering a bigger resolution.

I am missing the post effects on the alpha blend materials. I would need SSAO for example, to sit the grass into the scene.

Can you extend the materials to use both at the same time? Alpha blend and Test? I rememder, that we used that in theforward render methods, a/blend in the blendmode and a discard funtion in the pixel shader. 

Grrrr. I want the whole world ^_°

 

Link to comment
5 minutes ago, werner.poetzelberger said:

I am missing the post effects on the alpha blend materials. I would need SSAO for example, to sit the grass into the scene.

Shouldnt be problem to add AO manually via AO map? I am doing that for some vegetaion, it gives much better results than SSAO, because vegetation requires different approach.

Btw, alfa blend is very dangerous from the point of view of overdraw.

Edited by demostenes
Link to comment
Just now, demostenes said:

Shouldnt be problem to add OA manually via texture? I am doing that for some vegetaion, it gives much better results than SSAO, because vegetation requires different approach.

I need that on the environment, eg. terrain.

Link to comment

This is quite interesting claim:

Using no mipmapping on the opacity map will improve the overall performance. With active mipmapping, the alpha mask is getting downsampled depending on your position (like LOD but for textures). The downsample will linear interpolate between the white space and increase the shader calculations, as well as some white spaces will just disappear but the render will still draw a fully transparent mesh.

In case it works for Unigine too, would be possible to add into material option to not use mips for alfa?

 

 

Link to comment

I ve just made simple experiment with mesh grass. And result is quite promising. There are no distribution masks, just random scatter, no texture variety on terrain bellow, no performance optimizations like LOD clutters with different density, high res textures, quite big visiblity, no special low poly shadowcasters, no LUTs, just simple scene with directional light. So there is still big space for improvement. Everything alfa tested, no alfa blend, it makes almost no difference. It makes cca 90FPS:

 

Edited by demostenes
Link to comment

looks very good.

I am really struggeling with the alpha test. I cannot get that to work properly.

But maybe it works well on straight grass.

Are you using just a single alpha mipmap? You can exclude mipmap creation on dds export from PS.

Normally, the mipmapping helps to improve performance a lot. So the quote about the mipmapping is new to me and different to my experience.

 

But the main thing is, how to create the textures. In my case I use a 4x4 tile texture (the same as for the grass).

That reduced down the accuracy of the alpha.

 

Did you create a Hard 0/1 alpha channel (only black and white) or greyscale?

Which fileformat do u use for the textures?

Can you show my your texture layout?

Edited by werner.poetzelberger
Link to comment

Regarding mip mapping, he was speaking just about opacity map, not whole texture. But in this case I am using fully mipmapped texture, truth is, that if I enable mip bias, I can see grass to much bigger distance and this is what he was speaking about. On the other side alfa test is much faster than alfa blend, so impact is probably not that big.

Grass is 8k texture, heavily atlased (so up to 100 types of grass is using this textures), flowers are second 8k texture (again cca 100 types of flowers uses is). I have third 8k texture for small ground plants (again cca 50), but it is not used in this scene. So result is, I can have cca 250 types of foliage using 3 textures. 

Alfa is almost hard (this is reason, why there is not big difference between alfa test and alfa blend).

Do you have some ftp? I can upload you one of these textures (it is big).

Edited by demostenes
Link to comment

Interesting, that you use such a huge map . But ya, I guess, thats why your alpha channel is so clean as well.

I made a quick and dirty test using more polygons rather than textures.

Somehow it is working, but I need to clearly figure out the turn dials for performance and visuals.

The positive thing is, better control, better variation, easy to build.

Here we go:

 

qdgrass3.JPG

qdgrass2.JPG

qdgrass1.JPG

qdgrass.JPG

Link to comment

Btw, my grass/flowers has 2-4 LODs (0,5k-2k poly LOD0, 200-30 LOD3). You need full detail only for several meters...That scene is made from 3 types of grass meshes 3 types of flowers. 2 tall and 1 low. The scene I showed has according to profiler cca 15M triangles in frustum (all LODs are casting world shadow, so with low poly shadow caster it can go down a lot), +-250dips. If I lower visibility of clutter and have 8M of tris, it makes only 3FPS more (+3%), if I turn off world shadows for higer LODs, I am on cca 2.4M and I gain other cca 1-2FPS.  It confirms, that modern GPU has no problem with big ammount of polygons. We shouldnt be afraid of using more geometry (with reasonable shaders), if we keep DIPs low.

For real usage it I would try to keep it lower anyway, but as I wrote, there is big space for tuning. My next try will be combination of both approaches, for example we can make cca -inf-10 meters with mesh grass and everything behind with standard billboard grass...

 

grass.jpg

Edited by demostenes
Link to comment

so. I go into the mesh direction.

For my grass I even do not use any blend option as I only have sticks.

I am getting quite close, and the performance is amazing, compared to the grass Billyboards.

With more tweaking I think I will be happy for the project......

Lets see.

Poly direction is a goo one!

 

grassPolyyy.JPG

grassPolyyy2.JPG

grassPolyyy1.JPG

Edited by werner.poetzelberger
  • Like 1
Link to comment

I'm watching this topic and trying to reproduce resuts that @werner.poetzelberger achived but I couldn't. Could you help me a little bit?
I have "grass" model with literally 8 planes (16 triangles) imported from fbx file created in Blender (please don't judge my 3d modeling skills :D).
I have world clutter with I think pretty low density of value 3 and I'm getting 10FPS on my GTX1060, it looks like this:

image.thumb.png.e8e6863392f9d6579cd23be0bdab1de7.png

While with billboards and texture without alpha I can get 4.3M triangles drawn at 50FPS:

image.thumb.png.742374fd1a00176c497a1f28cf804572.png

Link to comment
16 hours ago, werner.poetzelberger said:

so. I go into the mesh direction.

For my grass I even do not use any blend option as I only have sticks.

I am getting quite close, and the performance is amazing, compared to the grass Billyboards.

Fantastic progress!

Link to comment
2 hours ago, morbid said:

Speaking of performance, please, try MeshClutter instead of WorldClutter.

Whats the difference in performance between those 2 and when should we use World/Mesh Clutter?

Usability is probably better when using more mesh clutter, as you can desing a texture for each mesh to distribute.

@arzezniczak

There are many parameters which can influence the performance.

I can see from your screenshot, that you use a node with a hirachy. That is unnecessry costy as you have only planes. A single merged mesh is much better.

As well there is a balance in drawn objects and polygons. Having a single mesh with many polygons and fewer instances is cheaper than lower poly meshes and more instances.

Visibility distance is a big performance driver, as well the Step setting, as visibility works per cell.

1 hour ago, demostenes said:

Fantastic progress!

Thanks, I am surprised how well that works. Changes a bit my visions and possibilities. ^-^

Link to comment
24 minutes ago, binstream said:

With 2.8 vegetation improvements, your content will shine even better!

o__O 

What will that shiny shine be?

Curious =)

 

Ah. That one

Vegetation Improvements

Vegetation is a crucial factor that can make or break the overall look of a virtual landscape if we’re not talking about Mars of course. In this release we added even more features making it possible to create true-to-life outdoor environments delivering a highly immersive experience.

 

Impostors now have a depth texture which drastically improves their look making it very hard to tell them from original models! Corresponding parameters were added to all impostor materials.And of course this feature is now supported by the Impostor Grabber tool.

Subsurface Scattering (SSS) is one of the major contributors to the look of leaves and grass blades, so a number of improvements were made for this effect:

  • Shadows from the light sources now smoothly dissolve inside materials. The degree of smoothness is determined by the SSS Intensity value.

  • Screen-Space Shadows now work with SSS correctly similar to ordinary shadows drastically improving the look of foliage when viewed from both up close or far away. In the latter case this option coupled with improved impostors is especially efficient providing a real looking environment at a lower cost.

A new Normals Rotated to Camera  option was added to the mesh_base material enabling you to ignore geometry normals and orient them towards the camera. This is very useful for vegetation as it makes the fact that leaves and grass blades are composed of polygons less noticeable.

Another new thing in the mesh_base material is that the logic of the Angle Fade option has changed, now it does not require the Vegetation option to be enabled. You can use it for tree crowns to make them look less low polygonal due to clipping of polygons having their normals oriented away from the camera.

Edited by werner.poetzelberger
Link to comment

I tried to make a lawn, which worked out quite nicely with the GRASS object.

The only thing I would say about that method is, that the shader is basic and there are no features like normal maps, shading etc.

But its really fast ^__^

grasssda.JPG

Link to comment
×
×
  • Create New...