x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Shader complexity vs mesh density

Ive just been watching this tutorial about foliage: https://www.youtube.com/watch?v=kMCsp2Cu5oM

Between 8:00 and 8:30 he mentions that rather than using alpha on the foliage why not just model it.

So I have a foliage asset (a grass clump), after complete processing (baking the individual models onto fewer planes). it is about 16 Tris, Modeled it was in the region of 140

Is just using the whole mesh (the 140tri version) really a viable option? and how does this balance in performance vs using alpha masks? obviously the modeled foliage would provide a noticeably better visual but it seems like a lot of polys to be drawing considering there could potentially be hundreds of instances being drawn at any one time.

Product Version: UE 4.19
Tags:
more ▼

asked Jun 17 '18 at 04:31 PM in Rendering

avatar image

Eightshot
133 7 14 18

avatar image rklsImmersion Jun 17 '18 at 09:39 PM

I'm going to go out on a limb and say the reason having more polys on screen vs having more complex shaders is because how ue4 handles foliage. It uses instanced static meshes, so you can have a small army (1 million plus) instanced static meshes on screen without a huge problem. Granted, if those meshes don't have LODs you will begin to have a problem. The only thing that puzzles me is that instanced static meshes work as well as they do because there's a lot less draw calls, which means they share shaders, so you'd think it wouldn't be a huge problem.

I'm not sure, and the best way to be positive (other than someone more experienced than me answering this) is by testing it out. Trial and error is how I learned a lot of what I know.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

People have already tried it out (see here). Summary:

  • The extra triangles hurt more than the overdraw, unless you're looking only at nearby foliage (which is what you would expect, if you think about it*)

  • Don't use the foliage painting tool

  • Use the grass tool, as it can handle way more foliage with good performance

The reason why you would expect that to happen is simple. The further away the mesh is, the smaller it gets. Therefore it covers less of your screen and produces less overdraw. The extra cost of the increased poly count does not decrease with distance. So what ends up happening is that you lose the benefits of having less overdraw, as you display more and more grass, because the number of vertices explodes. Here, straight from the thread: "[...] a few extra triangles per mesh will start to add up when you have millions of them in the scene."

more ▼

answered Jun 17 '18 at 09:55 PM

avatar image

TheSniperFan
154 1 3 6

avatar image Eightshot Jun 17 '18 at 11:12 PM

So in the case of a top down game wouldit be better/equally efficient to go for geometry based assets rather than texture based? As there would be no distance viewing.

avatar image TheSniperFan Jun 17 '18 at 11:17 PM

That's a special case I could see go either way. The best would be to just try it out. It's not like you need actual grass meshes/textures for testing. You can use placeholders that have about the right dimensions for that purpose. That being said, the 140 tri version has way too many polygons. The question is how low you should go. You can look at what the guy in the thread I posted did for reference.

avatar image Eightshot Jun 17 '18 at 11:18 PM

thanks for the assist. Ill do some testing and take another look at that post with fresh eyes in the am.

Thanks again.

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question