Jump to content

[SOLVED] how to improve the performance of multiple ObjectWaterMesh in one scene?


photo

Recommended Posts

I have a scene, it needs about 10 ObjectWaterMesh, if no water exists, the FPS can reach 120, then I add one watermesh, fps drops to 70, then I add second watermesh, fps only 50, So it seems that I can not use all these watermesh in one scene.

 

All these water mesh are placed at different vertical position, and only one big watermesh as River, others are just ponds for different waterfalls and fountains, so How could I make this happen?

 

I've tried with static reflection, It looks good when camera is far away from these water, but if camera move close, it looks totally wrong.

Link to comment

There are several things you can do:

  • Enable Query flag in the Node editor. It's strongly recommended in case the material uses a heavy shader (just the case for water). Additional calculations are made to test object BB (that's why this option shouldn't be enabled for all objects indiscriminately) to reduce the number of triangles that need to be rendered.
  • Use Shared reflection (Materials ->States->Reflection->Shared checkbox). It allows to use the same reflection texture for the parent and its children in the node hierarchy (or all surfaces of the mesh). It is enabled only if all of reflective surfaces have the same reflection settings. For example, to use it, make all your water meshes children of one ObjectDummy (NodeDummy won't do!) - or use one of the ponds as parent. Check the rendering profiler (RReflections counter) to see how many reflections are rendered.
  • Skip rendering of shadows from objects in reflections (Materials ->States->Reflection->Shadow checkbox).
  • To optimize performance, only big object should be rendered in reflections. Skip rendering of all small objects (especially if you also use a normal map to distort reflective surface). This is done by setting up the following bit masks (see all details here):

1. Camera viewport mask (for the object to be drawn)
2. Camera reflection mask (not to draw the object in reflections)
3. Viewport mask for object material
  • Use Static reflections (Materials ->States->Reflection->uncheck Dynamical checkbox). I agree, it's mostly for long-shot ranges, named it here just to complete the list.

Link to comment

This is first time I read about how shared reflection working, I think those description should be added to manual. Thanks the final solution I used is only use dynamic reflection on river, all other water use grabbed static reflection texture. The performance is acceptable now.

 

Another question, query flags are set for water mesh or other objects?

Link to comment

This is first time I read about how shared reflection working, I think those description should be added to manual.

Yep, added that as soon as I saw the question arose.

 

Another question, query flags are set for water mesh or other objects?

Did not quite get you. It is recommended to enable query flag for the water meshes (as they are big and have heavy shaders).

But do not enable this flag for objects with simple materials, because it will lead to the reverse effect (performance drop). Simply be careful when enabling this flag for objects (test it each time! if there's performance gain - then it's all good).

Link to comment
×
×
  • Create New...