Using Instanced Meshes doesn't reduce draw calls
epic工程师的回答:
Instanced meshes will reduce the draw call overhead on the CPU but will not reduce the GPU cost. In fact the GPU time can increase when using instancing. Allow me to get a little technical for a moment:
This process has to do with the limitations of the CPU vs. GPU and how the API (OpenGL or DirectX) tries to maximize this limitation through batching. Instancing being a special case of batching. With a scene rendered with many small or simple objects each with only a few triangles, the performance is entirely CPU-bound by the API; the GPU has no ability to increase it. More precisely, "the processing time on the CPU for the draw call is greater than the amount of time the GPU takes to actually draw the mesh, so the GPU is starved." [Moeller, Real Time Rendering, 708]. So Batching attempts to allow the CPU to combine a number of objects into a single API call. In the case of Instancing it is the one mesh and the number of times you are drawing with a separate data structure for holding information about each separate mesh.
From a Rendering Engineerer:
"On meshes and material IDs, let me present a hypothetical situation to try to explain the situation more clearly. Let's say you have a mesh that has three materials: wood, chrome, and leather. Now let's say you place 100 of these meshes in your level. Ignoring other passes (shadow, depth only), this will result in 300 draw calls: one per-ID, per-instance. You can see this by looking at the section counts in the primitive stats window.
First thing to keep in mind: some draw calls are more expensive than others. The renderer sorts by material. So in this hypothetical scene we will draw the 100 wood elements first, the 100 chrome elements next, and the 100 leather elements last. Once we draw a wood element, the cost of drawing another wood element is not so high because we are rendering using the same shader and with mostly the same textures. But once we switch materials to draw the chrome we incur a high cost. That's why the renderer sorts by material.
Compare that situation to another scene where you have the same mesh instanced 100 times but each mesh has its own unique material. The scene is still 300 draw calls but the renderer incurs the material switch cost for every draw call. Instancing a mesh provides performance benefits even if the total number of draw calls does not reflect that"
To really see the performance boost in using Instances bring up the Stat UNIT and watch the DRAW versus GPU (CPU vGPU) and notice when you instance a mesh the CPU time remains fairly consistent depending on the additional information you are wanting to pass to each instance, while the GPU will increase. All of these numbers are still dependent on the size of your mesh and the type of material setup and the ultimate limitations of your CPU and GPU.
Thank You
Eric Ketchum
相关推荐
UE4高级教程建筑室内可视化 A-018---208集ue4官方从入门到精通视频教程(1080P高清中文字幕) UE4室内教程 AboutCG UE4虚幻引擎独立游戏制作教程 UE4编程教学 虚幻引擎4ok 1、Unreal Engine 4 零基础美术流程完全...
UE4艺术大师:蓝图Ⅰ 密码:dakaiwenjian
UE4艺术大师:蓝图 全套。密码在read.txt中,注意查看
UE4艺术大师:蓝图Ⅱ 密码:dakaiwenjian
ue4联机完整项目
UE4和web网页的UI交互
毕业设计基于C++的一款UE4射击游戏源码。一款UE4射击游戏Demo,包含UE4游戏框架及整套联网射击游戏功能。一款UE4射击游戏Demo,包含UE4游戏框架及整套联网射击游戏功能。一款UE4射击游戏Demo,包含UE4游戏框架及整套...
UE4插件:kd-tree 这是一个UE4插件,可提供用于将kd-tree构建为蓝图功能库的实用程序功能。 支援环境 该插件在以下环境中经过测试。 UE4版本:4.22 操作系统:Windows / Mac 安装 1.下载源代码 从下载整个项目的...
UE4加载本地图片
UE4KeyBindings示例:在UE4蓝图内部实现键绑定系统的示例
UE4 CanvasUI遮罩UE4 CanvasUI遮罩UE4 CanvasUI遮罩UE4 CanvasUI遮罩UE4 CanvasUI遮罩UE4 CanvasUI遮罩
UE4 socket 数据接收以及发送,功能示例
UE4艺术大师:蓝图Ⅲ 密码:dakaiwenjian
请查看以获取有关在Docker容器内使用Unreal Engine的与实现无关的信息,然后前往以查看特定于使用ue4-docker项目的详细信息。 ue4-docker Python软件包包含一组Dockerfile和随附的构建基础结构,可用于为Epic ...
UE4 network Character Movement UE4 network Character MovementUE4 network Character MovementUE4 network Character MovementUE4 network Character Movement
UE4 PAK查看器UE4 PAK查看器UE4 PAK查看器UE4 PAK查看器UE4 PAK查看器UE4 PAK查看器
虚幻4UE4程序游戏解包,获取资源等。
UE5使用DLSS(超级采样)提升场景的 FPS 远离卡顿的优化方案
虚幻引擎(UE4)技术基础 PPT课件(共8单元)项目八VR硬件平台搭建.pdf虚幻引擎(UE4)技术基础 PPT课件(共8单元)项目八VR硬件平台搭建.pdf虚幻引擎(UE4)技术基础 PPT课件(共8单元)项目八VR硬件平台搭建.pdf虚幻引擎(UE4)...
UE4、UE5读写Txt文件