I have a nvidia620 and in cases with very numerous objects, and numerous materials, it drops FPS to 10 or below.
On a 870M it runs fine at 120fps. Maybe use a “lower” profile when on the 540: in my engine, when coding with the 620, i use lower specs (LOD, number of details etc aggressively lowered) to not wonder about that.
But it helps to see what happens when a user has a low end computer and test to reproduce their problems, or better, improve algorithms and optimize code.
A computer have in average 12 models, each models have 3 to 10 materials (5 in average).
Only motherboard and certain graphic card have more than 6 materials
The most common: Drive, Ram and Fan have only 2 or 3 materials
All textures are atlased in the same file and all normal map as well. …
On the GTX1080 I can run this scene at 66fps with a 2160p resolution
On the GT540M I have 8 to 10 fps in 720p
Some ideas coming…
Do u set effect parameters even when they havent not changed?
Do u cache them or call them with parameter[thestring]?
Have you tried sorting the meshes by material to lower the calls?
Maybe MRT could help by drawing the 6 materials in one for loop. And then combining the results.
Or 2 loops of 3 if the hardware does not support up to 8
Apparently OpenTK.Platform.Windows.WinGLContext.SwapBuffers() (from gdi32full.dll) is drastically slower on the 540M.
I think this is what @nkast said earlier about CPU waiting the GPU before swapping the buffer.
But I don’t understand something… for testing purpose i have disable many thing in my shader + divide all texture and normal size by 3. With the GTX1080 i got 90fps but on the 540M still got less than 10fps no gains at all occurred.
With my engine, on a gt620 I get “only” 45fps when I get 130fps on a 670M for the exact same scene… So I guess generations before 6xx does not seem to be good at dx11, whereas it was fine with XNA 4 (dx9)
About Multi Render Targets i dont have bay tutorial, websites from my learning times are now closed but there must be some remaining tutorials on riemers’ website
Whichever tutorial you choose, use Rendertargetbinding to make things a little faster.
Only your key(s) is(are) cached, in a dictionary, which has lookup too, you make the work twice. ‘caching’ the value of the key of the parameters has a lookup on the array you traverse each time you need the value to be set.
But you must be loosing about 5 or a little more fps, not so noticeable.
MRT should be the way to go as you need many renders of the scene with different methods.
You were right i removed my Dictionary and use EffectParameter instead.
I got +4fps on the desktop platform and +1fps in average on the laptop.
I have got an idea but is kind of difficult to implement…
I means… I have many computer with multiple mesh and material in my game but not all of them are used at the same time.
do you think that would be great if I take unused computer in a background thread to combine the mesh of each component by merging the vertexbuffer and set the offset of the uvmap directly in one new model?
If i do this correctly all unused computer will have only one ModelMesh with one ModelMeshPart and should use only one draw call or two for transparent part.
I don’t really know how to create a entire model on the fly, I try some workaround without success yet.
Is there a correct method to combine ModelMesh or ModelMeshPart ?
Do you display all items in the scene or only the visible ones ? I’m not sure to understand.
If you need culling, it is easy: create a BoundingFrustrum from your camera, and for each item you need to display, check if any part/item is visible or not for each one:
ContainmentType _CtObject = _BoundingFrustum.Contains(this._BoundingBox);
if(_CtObject != ContainmentType.Disjoint)
{
//At least it is intersecting one of the camera's 6 planes, or all included
//So draw this ! (apply effect params etc)
}
I already culling object that not in view with BoundingFrustum.
What i want to try to do is merge the multiple ModelMesh of a computer in one ModelMesh.
Basically take all the vertex and put them in one vertexbuffer to be able to draw the entire computer in one drawcall.
But I couldn’t find anything useful about combining models.
Hum. That could be possible but a little complicated (respect of the indices => face orientation => culled by the rasterizer).
You can try but i’m not sure you will gain a lot of performance. MRT will be faster. (and lead you to postprocessing effects if needed)
But you could also try to cull ModelMesh/ MeshParts instead (Building their boundingboxes at loadtime or better with a custommodelprocessor)