mayur.patel Posted April 23, 2018 Share Posted April 23, 2018 Hello everyone, I'm working on projects like.... creation of virtual sets using Unigine Editor. But I'm looking for optimization methods to bring more FPS... Already studies "superposition benchmark" to get know how to optimize.... i got know that in S.positon's used LOD, OCCLUDER... but doesn't work in my project. Moreover, (In "superposition benchmark")It's having lot of probs and high resolution textures but getting excellent FPS but HOW?HOW?HOW?HOW?. I'm wondering to know that... Find attached snapshot of my small project..... with THIS TOPICS.... Please tell me... Guide me...... suggest me.... advice me......... Regards, Mayur patel Link to comment
werner.poetzelberger Posted April 23, 2018 Share Posted April 23, 2018 Hi, I cant tell you exactly whats going on, as every scene is very different. Just looking at your lightcount ... 17 lights in this scene? This can have some impact. Switch the lights on an doff and see what happens. Shadows can have big impacts as well. 1 Link to comment
Greg.Mildenhall Posted April 24, 2018 Share Posted April 24, 2018 On your Superposition screengrab and also on our own application, the Total time is very close to the sum of the Update and Render CPU times. In your scene it's almost twice that! So I'd say the first thing would be to figure out where all the rest of the Total time is going. It might not be the rendering that is the bottleneck. 1 Link to comment
mayur.patel Posted April 24, 2018 Author Share Posted April 24, 2018 To :@werner.poetzelberger @Greg.Mildenhall I made it all lights hidden except one environment prob..... but still not getting good FPS... I don't know how to figure out this problem... please tell me if you have any other ideas or methods to figure out... To: @Greg.Mildenhall, I don't know about bottleneck or something like that..please guide me about that... to : @werner.poetzelberger @Greg.Mildenhall Thank you for your time to read this problem.. i hope to hear possible solutions from you.... find attached screenshots... Link to comment
werner.poetzelberger Posted April 26, 2018 Share Posted April 26, 2018 (edited) The update and the cpu render is pretty high. The rendertime is low. Probably there is a lot happening, beside the rendering? Scripts? Do you have enough memory on your gpu? Which gpu u are utilizing? Check the overall usage of your system with eg. MSI afterburner. Run your project in releasemode not in editor, use the advanced (graph) mode of the profiler. Edited April 26, 2018 by werner.poetzelberger Link to comment
mayur.patel Posted May 8, 2018 Author Share Posted May 8, 2018 Thank you for replying werner, There is no scripting in the project, and the GPU we are using is ZOTAC GeForce® GTX 1080 AMP Edition(8 GB). "Probably there is a lot happening, beside the rendering?" I did not understand this. Can you be more specific about which areas to look for. Link to comment
werner.poetzelberger Posted May 10, 2018 Share Posted May 10, 2018 (edited) Hmm. So what else comes into my mind... - If there are many objects in hirarchy it takes up some frametime. But I am talking about a lot of objects. - A lot of different, none inherited materials can cause some more effort. - Big Texture maps with none power of 2 and not .dds formats can cause some more effort. Also dont forget, that you have a bottleneck, which brings down the framerate just one its own to lets say 65 fps, other elements do not cost so much any more. e.g. If each element costs a lot on its own, the sum of those may just reduce the framerate by a small percentage. So you need to check each element alone. Anyway, 60 fps is a good framerate and sufficient for every need (normally). Which framerate are you aming for? best. Edited May 10, 2018 by werner.poetzelberger Link to comment
sebastian.vesenmayer Posted April 25, 2019 Share Posted April 25, 2019 Hi, I have a bottleneck when loading a specific scene in our project. It has very much different materials, meshes and textures (~6000). What I can read from the profiler is, that the material count is very high (~20000). Can this cause the impact on performance. GPU load is arround 85 % with gpu z Regards, Sebastian Link to comment
morbid Posted April 26, 2019 Share Posted April 26, 2019 Hello Sebastian, Yes, a huge amount of unique materials in the scene will impact performance. But I can't say what exactly is slowing down rendering based on this screenshot. You may notice that the majority of frame render time is in Render CPU. Probably, the issue is not in materials. To give you better advice I'd like to see a microprofile capture. You can find these tutorials useful: https://developer.unigine.com/en/docs/2.7.3/videotutorials/essentials/microprofile And could you please mention, which SDK version is this? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
sebastian.vesenmayer Posted April 26, 2019 Share Posted April 26, 2019 (edited) Hi, I am using 2.7.2 right now with OpenGL. Graphics card is a GTX 1070. Regards, Sebastian Edited April 26, 2019 by sebastian.vesenmayer Link to comment
morbid Posted April 26, 2019 Share Posted April 26, 2019 According to this screenshot, there's a lot of heavy content in the scene, basically, everything is lagging. Have you tried isolating nodes in the editor to find what's exactly consuming all resources? This could be unoptimized LODs, shadows from high-poly meshes or something else. Without a scene, I could only guess which object(s) is the most expensive. I suggest investigating world hierarchy to find the guilty ones. By the way, shadows are consuming 48ms here. To make your work smoother you can disable all shadows with console command "render_shadows 0". Speaking of them, in 2.8 we're bringing a major optimization with static shadows for any light source. Should help in a lot of cases. Thanks. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
sebastian.vesenmayer Posted April 26, 2019 Share Posted April 26, 2019 I did some iterations and found out that when I set the TRANSPARENT_ALPHA_TEST on materials as default, the shadow pass takes really long which makes sense. But I cannot reduce the amount of meshes, I have over 6000 different materials and each has an own mesh, they are all displayed in a worst case view. Any ideas how I can optimize this? Regards Sebastian Link to comment
morbid Posted April 26, 2019 Share Posted April 26, 2019 With this info I can suggest the following: You have almost 60 millions of triangles. That's a lot (really, a lot). This is the first problem that should be solved with LODs and content optimization 6000 of unique meshes and materials also contributing to the issue. Have you considered clusterization? The best practice is using MeshClusters but they work with identical objects only. The other way - is WorldCluster. The second one could help with unique meshes, but not that much. Is there any way to occlude part of geometry? If yes, please, consider using Occluders. You also mentioned that GPU is not fully loaded. If so, we're dealing with CPU bottleneck as well. This could be caused by complicated node hierarchy (hundreds or even thousands of child nodes) or by transforming a huge amount of nodes simultaneously. This was improved in 2.7.3 on the engine level. Thanks. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
sebastian.vesenmayer Posted April 26, 2019 Share Posted April 26, 2019 Thank you for your ideas, I will have a closer look at the data. At the moment it looks like I am mostly cpu bound, I just tested it again with gpuz and now I have a GPU load of aroound 50% for arround 100 M tris/s Link to comment
demostenes Posted April 26, 2019 Share Posted April 26, 2019 (edited) Hello, maybe I am missing something, but I dont see any reason, why such scene should have 60m triangles. What I see should be possible with 1-5m (surfaces seems simple..). If you have some heavy meshes there, try decimation (simplygon is now for free - https://www.simplygon.com/) and create several LODs. It also allows you to make texture atlases, so you can easily decrease number of materials. You can also make decimated mesh and by projection from high poly to low poly mesh create good normal/height map for low poly mesh and difference will be minimal. Also if you manually tune normals on meshes, you will eliminate sharp edges without adding geometry, etc...You should also create low poly shadowcasters (just use some decimated LOD). 6000 unique meshes is really a lot, you should merge them into some groups to not loose advantage of frustum culling and create texture atlases for such clusters. In this case could be also interesting some fullscene baking tool like: https://www.texturebaking.com/, you can decrease number of materials by two decimals (so it will tremendously decrease CPU load). Edited April 26, 2019 by demostenes 1 Link to comment
ulf.schroeter Posted April 28, 2019 Share Posted April 28, 2019 excellent input demostenes ! Performance ALWAYS means: reducing polygon/vertex and state change counts. Unoptimized content still kills even high-end GPU/CPUs. Old stuff, but still applies: Batch, batch, batch ! https://www.google.com/url?sa=t&source=web&rct=j&url=https://www.nvidia.com/docs/IO/8228/BatchBatchBatch.pdf Link to comment
sebastian.vesenmayer Posted April 29, 2019 Share Posted April 29, 2019 Thanks for your input @demostenes :) I am glad that I don't have 60 million triangles per Frame, it is only about 6 million, half of it are shadows, so it is arround 3 million. It is as big as the oil ref demo which also has arround 6 Mio per frame and runs on a GTX1070 with 400 - 500 million triangles per second with > 60 fps So I guess triangle count should be ok for the scene but Node/Object/Material count is not. You are right @ulf.schroeter , state change does really matter, but maybe Unigine takes advantage of bindless technologies of graphics apis and provide a high level solution for it without restruction of our model. Link to comment
morbid Posted April 29, 2019 Share Posted April 29, 2019 @sebastian.vesenmayer, 60m triangles - my mistake, sorry. I wanted to mention two other option that could be helpful on the import stage: Merging static meshes Merging similar materials And recently we worked on a project where tens of objects with complex hierarchy (planes with all related details) were moving around a control tower. The solution was to make "hierarchy LODs". We're disabling a part of nodes when the plane is far away. Just thought it could be useful for your case. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
sebastian.vesenmayer Posted April 29, 2019 Share Posted April 29, 2019 (edited) @morbid that sounds like a great idea, I will have a look at it :) Thanks. Edited April 29, 2019 by sebastian.vesenmayer Link to comment
sebastian.vesenmayer Posted May 9, 2019 Share Posted May 9, 2019 (edited) Hi, just want to ask if it is possible to render only shadows for an object, so I can batch shadow data different from drawing data? Edit: Video memory for geometry does not matter. Edited May 9, 2019 by sebastian.vesenmayer Link to comment
demostenes Posted May 9, 2019 Share Posted May 9, 2019 24 minutes ago, sebastian.vesenmayer said: Hi, just want to ask if it is possible to render only shadows for an object, so I can batch shadow data different from drawing data? Edit: Video memory for geometry does not matter. Not sure what do you mean, but you can disable camera viewport via bitmasking for any surface, so surface will be not visible and shadow will remain. This is trick how to do low poly shadow caster for meshes. Link to comment
sebastian.vesenmayer Posted May 17, 2019 Share Posted May 17, 2019 Hi, thanks demostenes, that is what i am looking for. I have another question regarding performance. We are using alpha blended materials and auxiliary buffer (for outlining) writes for many unique objects, which can change their appearance individually (3 possible materials). These objects are placed slightly over the ground and need alpha blending to not fully occlude the underlying graphics. When I am enabling alpha blending or auxiliary write the material count rises to the number of objects and the framerate drops significantly with 2000 visible objects. Activating show_profiler shows a lot of time spend in Render CPU (about 10 ms). We are using opengl, unigine version 2.7.2, in the attachement is a little reproducer. Any ideas how I can make this faster with Unigine? Thanks, Sebastian material_count.zip Link to comment
demostenes Posted May 17, 2019 Share Posted May 17, 2019 (edited) 1 hour ago, sebastian.vesenmayer said: Any ideas how I can make this faster with Unigine? Everything was already told. Did you try it? Especially mesh and material merge (to lower number of objects and surfaces)? There is no magic solution to this, you MUST optimize your assets/scene. Everybody does it. If you lower number of unique objects (and for such small scene there is no reason to have 2000 unique objects), everything will be faster. Edited May 17, 2019 by demostenes Link to comment
sebastian.vesenmayer Posted May 17, 2019 Share Posted May 17, 2019 (edited) Is it faster to recalculate clustermeshes every time a instance in it will change its material, so I need to collect/sort 2000 matrices and push them into 3 different clustermeshes? Edit: Ok I tried it in a short example and it performs way better by pushing new matrices in a cluster mesh every frame. I will try this approach. Edited May 17, 2019 by sebastian.vesenmayer Link to comment
Recommended Posts