Well, I saw 54 fps in a screenshot above:
https://discord.com/channels/700706776840142948/700706776840142951/841809205371600926
So I assumed that my tool is worse... 🤔
But I think that the rendering is not the problem here
It is most likely the code
OpenGL may be slow, but not this slow
Adriens editor runs fine, but when you enable the "squads" layer, then the frames heavily drop
A squad is a group of enemies
At the beginning I used OpenGL and all 3D models vertices+indices were stored in system RAM, which was slow, especially on dedicated GPUs where it would have to transfer vertices of models from RAM to VRAM every frame, causing lots of performance drop.
But then I switched to Direct3D and made the editor create vertex/index buffers on VRAM, which made it a little bit more faster
It's possible to do that in OpenGL too, but you would have to use extensions or OpenGL 2+ which is a bit more annoying
you would have to import a library such as Glew to import extensions, whereas in Direct3D you have direct access to all features
Well, that's how my program works. I must consider rewriting the rendering parts of the code with some vertex buffers etc.
I was primarily basing my render engine on the parts of decompiled code from Kao2.
Which version of OpenGL do you use?
Yea, it is annoying.
But it's also funny becuase Kao2 engine uses none of such extensions and it works fine. But they also run a lot of weird optimalizations and sorting algorithms before finally presenting stuff to the screen.
I have some mix of legacy OpenGL 2 I think? 😅
I don't import any extensions.
And also my editor is not that much optimized neither. Like Spork said, enabling Squads will draw Romans, but my editor doesn't do any material sorting yet, so when there are Romans of different type, it would always set the current texture for every roman, instead of let's say drawing romans with the same texture together
In my case I use a simple algorithm that I "hijacked" from decompiled Kao2 portion of the renderer class, where it compares if the same material ID was already binded. It's not necessarily sorting by materials, it's just comparing their IDs and parameters (alpha blending, etc.) so the engine doesn't have so switch every material-state OFF and then only some material-states ON, but it can only switch those that actually change between the 3D models, leaving paraemeters that do not change untouched.
Yeah, but already switching one render state for every model might drop performance
but if that's how the game did 🤷♂️
Have you considered updating to a newer OpenGL version? You are still using old legacy stuff
Yes, but I am too lazy and I focused more on the functionality of the editor (converting stuff between engine versions, automating import and export of models and textures)