Asterix Gaming Guild Logo GeneralXXLXXL 2XXL 3XXXLOlympic GamesXXL EditorToolsOff-TopicXXL RomasteredXXL 2 RemasteredOther GamesModsCaesar's ChallengeUnfair XXLPatchesFan ArtPersonal ArtSpeedrunningMediaRandomizerBETA RomeHSKALPresence AdrienPresence SPQRSupport Bot Helpdesk

#general

flower35
Well, I saw 54 fps in a screenshot above: https://discord.com/channels/700706776840142948/700706776840142951/841809205371600926 So I assumed that my tool is worse... 🤔
pegperegogaucho
But I think that the rendering is not the problem here
pegperegogaucho
It is most likely the code
pegperegogaucho
OpenGL may be slow, but not this slow
pegperegogaucho
Adriens editor runs fine, but when you enable the "squads" layer, then the frames heavily drop
pegperegogaucho
A squad is a group of enemies
adrientd
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.
adrientd
But then I switched to Direct3D and made the editor create vertex/index buffers on VRAM, which made it a little bit more faster
adrientd
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
adrientd
you would have to import a library such as Glew to import extensions, whereas in Direct3D you have direct access to all features
flower35
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.
pegperegogaucho
Which version of OpenGL do you use?
flower35
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.
flower35
I have some mix of legacy OpenGL 2 I think? 😅 I don't import any extensions.
adrientd
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
flower35
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.
adrientd
Yeah, but already switching one render state for every model might drop performance
adrientd
but if that's how the game did 🤷‍♂️
pegperegogaucho
Have you considered updating to a newer OpenGL version? You are still using old legacy stuff
flower35
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)