Jump to content

Optimization of scene with dense vegetation


Robert

Recommended Posts

Hi all,

I have been working on a scene with very dense vegetation and I’m starting to run into performance issues. The goal is to create a short movie (60-90 seconds). The screenshot shows the current state in which a render is already taking too long, even at ¾ of the target resolution of 720p. This is mostly due to memory problems because of the large amount of polygons. I have 18GB of RAM but apparently I’m terrible at optimizing.

All the vegetation is cooked and stored on the disk before rendering so it doesn't have to be recooked for every frame. For some of the more dense vegetation types the total polycount gets up to 8 million and according to the performance monitor it takes about 3GB of memory to load it from the hard drive.

What I have attempted so far to increase performance is only rendering the full geometry of the vegetation when it is close to the camera. I have split the terrain in about three different “scenes” where for each scene the camera coverage is calculated to determine where the full geometry will be placed. At a certain distance from the camera I’m using a set of polygon billboards with textures instead of full geometry to reduce the polycount. I have small groupings of about 10 billboards which are instanced across points that are scattered on the terrain.

During a transition between two scenes it will probably be very noticeable that some of the billboard geometry is replaced with real geometry, but updating this every frame seems like it would result in even bigger render times. Another problem with billboards is that they look really flat. There is a big contrast between the billboards in the background and the full geometry in the foreground.

I’m currently trying to replace the billboards with sprites which should help with the polycount but it will probably cause a new problem. Because sprites rotate with the camera it will be noticeable after a while. It has been suggested to me that I try to blend multiple textures based on the camera angle to give the illusion of 3d while it still remains a sprite. I have managed to blend two different textures using two different surface color nodes to cover a 90 degree angle. I still need to find out how I can plug in an arbitrary amount of textures so I can use a new texture every 10 degrees or something similar. I am also using normals maps to make the sprites appear like they were lit from the side so that they don’t turn dark because they are barely picking up light from above.

As far as the render engines go, what is the best one to use for this type of scene? In small scale tests I get the exact same render with the exact same render time so I don’t understand which one to pick.

In short:

-What kind of optimization techniques should I try for a scene with dense vegetation?

-How can I make the sprites/billboards look less flat?

-Is it possible to blend an arbitrary amount of textures on a sprite based on the camera angle?

-How can I reduce “popping” of geometry in the background when a new “scene” starts?

-What render engine (raytracing, physical, micropolygon) is best suited for the task?

Sorry for the wall of text but I would appreciate any input.

Regards,

post-9869-0-03078600-1385133101_thumb.jp

Link to comment
Share on other sites

Hi, thanks for the responses.

I am currently using instances on the geometry in the background. I am not using it for the full geometry in the foreground because it would become very limited in variation. I have around 10 different "patch" sizes which I copy on scattered points. Which "patch" variation is used is based on a custom attribute of the scattered points. Instancing only gives a few standard attributes you can vary your instances with, not any custom ones. I am using polysoups and saving the files as compressed bgeo.gz files. Should I also try the new packed geometry feature in H13,0?

Edited by Robert
Link to comment
Share on other sites

I am currently using instances on the geometry in the background. I am not using it for the full geometry in the foreground because it would become very limited in variation. I have around 10 different "patch" sizes which I copy on scattered points. Which "patch" variation is used is based on a custom attribute of the scattered points. Instancing only gives a few standard attributes you can vary your instances with, not any custom ones. I am using polysoups and saving the files as compressed bgeo.gz files. Should I also try the new packed geometry feature in H13,0?

Packed Primitives will give you instancing by default. You can pack your polysoup'ed geometry as well as this is just more efficient to save/render than raw polygons.

If you are using the Copy SOP, it can now in-line packed primitives. This means the Copy SOP can now do instancing and also introduce variability pretty easily.

You can use the Packed Edit SOP to control the display of packed primitives.

Lots going for you by switching your instancing to packed primitives for everything. The only thing missing is LOD right now.

  • Like 1
Link to comment
Share on other sites

Thanks for your response,

How would you approach LOD? Simply reducing polygons won't do alot since the vegetation is made of opacity mapped planes. I'm trying to force LOD by replacing full 3d geometry with sprites in the background but I do this every 200 frames or so instead of every frame since I'm afraid that updating every frame will become very expensive performance wise.

I've tried packing the geometry but it seems to mess with the materials. I assigned materials to individual leaves before they were pasted on the stem so this information is lost when the geometry is packed.

Edited by Robert
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...