UPBGE Apply modifiers at game start: Testers needed

Hello!

Since a long time, we have an annoying performance bug in upbge with objects with modifiers rendering. So we tried to apply modifiers at game start and (to simplify) restore it at game exit. But the operation seems a bit risky and we don’t know all the bad side effects it can have.

THE GOAL OF THE TEST IS TO TEST A MAXIMUM OF .BLENDs WITH OBJECTS WITH MODIFIERS AND SEE IF THERE ARE BUGS RELATED TO THE PATCH “APPLY MODIFIERS AT GAME START”

To do this test, you will need:

Both are Windows 32 bits builds

If you have a bug related to upbge with “modifiers applied at game start” patch (This means the bug is in “modifiers applied at game start” build but not in upbge 0.1.5 release), you can open an issue here: https://github.com/UPBGE/blender/issues and prefix the issue title with no_modifier_bug.

If you want to test what effect this patch has, you can test with these files:

-> In upbge 0.1.5, you should have a big performance difference beetween the 2 files

-> In upbge with “modifiers applied at game start”, you should not have noticeable performances differences beetween the 2 files.

(We already know that in this file the rendering is faster in BF bge than in UPBGE even if we apply modifiers at game start)

Tested; The patch really boosts the fps in the room example. images: first uses the file E_StudyRoom_01
http://pasteall.org/pic/show.php?id=113501
http://pasteall.org/pic/show.php?id=113502

Hm I have no noticeable differences between the two examples and the both upbge versions only BF Blender is ~10 fps faster but all others tests with upbge have the same framerate even if the modifires are applied/no applied/applied at game start. But I haven 't noticed any bug so far too.

@Akira_san && @Maujoe: Thanks for your tests!
@Maujoe: Weird on my computer in upbge 0.1.5 release, Modifiers not applied .blend, I have ~120 fps whereas with upbge 0.1.5 with “modifiers applied at game start” patch I have ~420 fps

Don’t hesitate to test with other .blends with modifiers. Thanks!

In bf bge 278c i get crashes when switching to vbo, dont know, how was i able to do the first test with bf bge vbo.
@Maujoe, did you switch to vbo in bf bge? As long as i know, you have to use vbo to compare.

@ Akira_San: Oh I forgot it but it makes no big noticeable different maybe vbo is slightly slower than Vertex Array. I also have random crashes sometimes when I switch bf bge to vbo and start the game but in other tries it doesn’t crash.

By the way the example scene looks very good, is it a ported scene or is it a orginal bge scene?

Its true, that vbo can be a bit slow in some cases if you compere vbo vs va. But the va method is outdated and b2.8 is using only vbo. The room scene is an example from the blendswap. Heres some example, that i made, if you look at them you see:
BGMC 23 The Long way home: http://pasteall.org/pic/index.php?id=113544
BGMC 23 Onikiri Demon slayer: http://pasteall.org/pic/index.php?id=113545 from the start of the screen
BGMC 23 Onikiri Demon slayer: http://pasteall.org/pic/show.php?id=113546 At the end, when the main char is surrounded with lots of enemy.
In all examples i use VBO + frame rate off + vsinc off. In the Onikiri game i made a modification to add missing material constants and in the zombies i changed the transparent mode to opaque, cos the alpha blend was pumping the raster, when the hero gets surrounded by lots of zombies. As you see in the last image, the raster shows less % and more fps, so you get stable frames. You could test too?

Hello,

The apply modifier at conversion also have the effect to make all the objects using modifiers to own an unique mesh. Previously you were able to set a modifier upon an armature and let the modifier be recomputed every frames. Now this is disabled.

@Akira_San, @Maujoe, and everyone: Did any of your file show the usage of a modifier upon a mesh deformed by an armature ?

Made a test with the file: InfiniteBatchStoneTreesAnimatedBF; img: http://pasteall.org/pic/show.php?id=113563
The branch shows some speed up in different files. I tested with different games with armatures, but didnt saw any much differences. But the room shows quite a big speed up in the branch, i guess cos its using a single material with an texture atlas?

On armatures, this is normal that you don’t notice performances differences because I excluded armatures from the modifiers applied at game start because it caused issues. In BF blender, we used display list to speed up rendering of meshes with modifiers. But as Display lists are a bit obsolete, we removed it. In some files with modifiers, like the room (Sorry I didn’t mention the author because I didn’t find him on blendswap (I had the file in my test files)), and with some computer like mine, this caused a performances decrease. So now, we’ll try to apply modifiers at game start so we can render it with our normal VBO code and not with the viewport code which is slower. Panzergame will also try to find a solution to render meshes with armatures + modifiers with our normal VBO code.