RenderQuery Result reducing performance when looking at a mesh from specific angle

4GB GTX680
i7 3930K

This is a weird one, I’ve been trying to diagnose if for the past two days and every time I discover something I get more confused. I’m not sure if anyone can help by looking at screenshots and reading my description alone, but maybe someone will notice something obvious that I’m missing.

I built some test trees which I thought were performing fine, until I realized that looking at them at some specific angles and distances cause quite severe frame drops (pic #1).

After viewing stats, I noticed that these frame drops were happening when RenderQuery Result appeared. The red bar doesn’t really fluctuate much, it is either there or not there, depending on which angle I look at the trees and only within a certain distance of them, for example in pic #2 where I look down by a few degrees and the performance increases and RenderQuery Result stops doing whatever it’s doing.

If I look at the trees from the other side, the performance is fine (pic #3). The left side of the building is less furnished and complete than the right side, which is possibly why, but still I don’t think it should be enough to cause those performance issues when looking at the right side of the building through the trees.

Some additional info -

• I’m using a post process shader to draw outlines on objects with custom depth enabled. Disconnecting this shader from the post process fixes the performance issue, but disabling objects in the scene from being affected by the shader by disabling custom depth doesn’t have any effect.

• The tree’s flowers are a two sided decal, changing the material to ‘one sided’ fixes the performance issue, and turning the flowers off all together fixes the performance issue

• Forcing the flowers to use their LOD1 mesh fixes the performance issue, but it doesn’t explain why there would be a performance issue only at certain angles with the LOD0 mesh, which usually performs very well even when ALL the trees are in view.

• There is some fairly heavy geometry inside the building, but checking those to be hidden in-game doesn’t have any effect on performance

I don’t really have a conclusion, other than it’s clearly the hi-res flower mesh that’s causing issues, possibly combined with my post process shader (which isn’t actually applied the flowers, but only the trees) but that doesn’t explain why only certain angles and distances are problematic. I can reduce the expensiveness of the flowers with some better LOD solution I guess and forget about the issue, but what I’d like to learn is what might cause RenderQuery Result to work so hard, so I can prevent it in the future.

Any help is seriously appreciated, I’m trying to get better at optimization and my game needs to run as lightly as possible, but this one has me stumped.

I was just noticing that myself. So looked up this thread.

I sadly don’t have the answer but you are not alone. We see occassional 24ms spikes due to Renderquery result.

Without seeing what the scene looks like in shader complexity mode it is hard to say for sure what is going on but my initial reaction to this is that you are probably experiencing some serious translucency over darw. Which would explain why at some viewing angles your performance drops. To help out with this issue you should cut your mesh so that it forms a shape that is close to the translucency that it is trying to render. Here some documents that explain what is going on in more detail.

View Modes

How To Use Transparency

Performance Guidelines

Performance for Mobile Devices

Hope that helps!

Hey Sam,

Thanks for the reply, I should have mentioned in the OP that transparency overdraw is not the issue, or at least not the contributing factor. I’ve tested by changing the material to opaque and the RenderQuery Result appears all the same. I also have a PixelDepth node that switches on and off alpha after a certain distance to help reduce overlapping alphas.

I reduced the tree polycount which has helped a little, and after packaging the game and running without the editor the performance is fine. Playing in-editor still gives unacceptable drops, and I’d still like to understand what RenderQuery Result was doing so zealously at those problem angles, but for now I’d consider the issue to be temporarily resolved.

I have the same question, Is there any solution now?