Jump to content

Slow fps (water)


photo

Recommended Posts

What video card are you running it on? And what rendering API do you use?

Here are screenshots on DirectX 10: as you can notice, the difference is only 20 FPS, though there are dynamic reflections, foam and caustics at the same time.

 

If you can turn off dynamic reflections and use a baked texture instead. That should provide considerable framerate increase.

post-13-0-79596500-1317309070_thumb.jpg

post-13-0-06651700-1317309083_thumb.jpg

Link to comment

with directX 10 the problem is solved, but what to do with directX 9? passage does not have this problem

dynamic or nondynamic reflect not substantially affect the fps

 

video card Geforce GTX 580

Link to comment

It there a tutorial for baking water reflections?

 

Baking reflections works only in case there are no objects around your water mesh. For example, in case trees are leaning over the pool, baked reflections won't do, because changing the viewpoint will result in incorrect reflections of these trees. Dynamical reflections would be the only option here.

 

Static reflections stored in the cube map can be used if, for example, you have an open sky above. Baking itself is easy:

  1. Disable all surrounding objects, if any. Basically, only sky and ground should remain.
  2. Open Tools -> Grabber tab and choose Cube option.
  3. Save cubemap in the dds format.
  4. Go to Materials settings -> States tab and uncheck Dynamical reflections.
  5. Go to textures tab and Set Reflection -> Static texture.

post-13-0-93279200-1317892951_thumb.jpg

post-13-0-15342400-1317892961_thumb.jpg

post-13-0-72177300-1317892967_thumb.jpg

  • Like 1
Link to comment

Actually it is possible to write a simple code that invokes a grabber from current position and sets an environment texture to your water material, but if called too frequently it causes huge render stalls :(

 

float znear = 0.01f;
float zfar = 2048.0f;

Image image = new Image();

int size = 512;

Material waterMaterial = engine.materials.findMaterial("water_lake");
int refMat = waterMaterial.findTexture("reflection");

Player player = engine.editor.getPlayer();
if (player == NULL)
     player = engine.game.getPlayer();

vec3 position = player.getPosition();
mat4 projection = frustum(-znear,znear,-znear,znear,znear,zfar);

engine.render.renderImageCube(projection,position,image,size,NULL,false);

waterMaterial.setImageTextureImage(refMat, image);

 

I've just added a suggestion to use frame buffer data for cheap-and-dirty reflections to improve FPS in such cases:

https://developer.un...r-optimization/

Link to comment

with directX 10 the problem is solved, but what to do with directX 9? passage does not have this problem

dynamic or nondynamic reflect not substantially affect the fps

 

video card Geforce GTX 580

We have performed some tests - seems it's a graphics card driver issue. On cards other than Geforce GTX family rendering of water mesh under DirectX9 does not cause such FPS drops. We'll pass this bug to NVIDIA engineers to see what we can do about it.

Link to comment

Actually it is possible to write a simple code that invokes a grabber from current position and sets an environment texture to you water object, but if called too frequently and causes huge stalls :(

Anyway, thank you for the idea, Alexei :)

Link to comment
  • 1 month later...

Water is heavy for DirectX 9 in any case, so we can only recommend to optimize your art assets: check the number of triangles, surfaces, lights, etc. You can also try enabling Query flag for the mesh.

Link to comment

I'm sorry for posting here, but we are still having dx9 water issue - there is some kind of 'sparkles' when camera is close to water. It was reported already but I can'd find the topic.

post-26-0-28309700-1321521994_thumb.jpg

Link to comment

I'm sorry for posting here, but we are still having dx9 water issue - there is some kind of 'sparkles' when camera is close to water. It was reported already but I can'd find the topic.

 

What type of GPU and OS do you use?

Link to comment
  • 2 weeks later...

Can you give some info on graphical settings and rendering API you use? Log file or/and small test case would be highly useful, if possible:) You can

send it here: support@unigine.com

Link to comment
  • 2 months later...

We found a problem mentioned by alexei and ulf too (GeForce 8600 GT + Win XP SP2).

Any chance to fix this problem?

Really can't reproduce it. Tried and failed multiple times. There will an SDK update next week (most probably) so please check if it is still present.

 

About this whole low performance issue, again, it's on the driver level. The only option is to optimize the scene (which is good in any way). Check this post for recommendations on improving performance when rendering water.

Link to comment
×
×
  • Create New...