Librelancer 2022.02
-
It’s rendering optimization/resorting.
Well, there’s another bug that came in sight both in my attempts and LibRelancer: not all parts’ maxtrices are applied in real.
These are 3 Aurora nebulae in Ku02 system in original Freelancer:
But in SystemViewer all three are rendered in one position:
starsphere_ku02.cmp
Mine renders same as i started “optimizing”. Unlike old archieved build, where i used to reapply shader on each mesh and reset matrices for each part, but that, of course, impacts performance. (images are HD just in case, right click - open, my browser cuts large previews here so i reduce them)
I’m personally planning to bind a buffer of part indices parallel to vertices and allocate Parts[MAX_PARTS] in a shader. More no thoughts yet.
About blending, texture’s runtime format is incorrect. In my code (and this is Direct3D) there’s a conversion:
Alpha := FreeImage_IsTransparent(Targa); if Alpha then Format := DXGI_FORMAT_B8G8R8A8_UNORM else Format := DXGI_FORMAT_B8G8R8X8_UNORM; ```All i know is this makes match Freelancer in drawing starspheres.
-
Hello.
I don’t check this very often, so if you’re having rendering bugs like in Ku02 please report them in the github issues with the version of the software you’re using.
R.E. that awful cmp/mesh:
- There is a very limited amount of mesh fixups applied in the engine on load time, but they’re only applicable in very small amounts of situations. The only solution there will be to export the model properly, as the FL resource loading model simply doesn’t work in such a way that I can modify the vertex buffers at runtime and maintain full vanilla compatibility.
And with “Latest SystemViewers work for me, but not gameengine itself. Some of previous daily builds work, some don’t.” this is not something I can do anything with as there is simply not enough info. There’s a lot of game engine work going on at the moment, and while it does work with vanilla I can’t guarantee mod compatibility. Especially if you’re not using the nice Copy Details button I made when there are crash errors
-
Mini investigation for fun:
The reason you’re getting 6200+ drawcalls and 10fps on that specific model, besides the fact it is completely broken, is because Librelancer could not find the materials at load time. If the .mat file is loaded before the model (e.g. you set the archetype right), it is safe enough to apply the reordering optimisation and it drops down to 6 drawcalls, proper FPS. Though it’s not guaranteed if it can’t find a place to shove the new index information.
-
The game engine crashes on intro scene’s end (in New Game start) for me.
GL Error: Invalid Value at LibreLancer.GL.CheckErrors() at LibreLancer.UniformBuffer.BindTo(Int32 binding, Int32 start, Int32 count) at LibreLancer.BasicMaterial.Use(RenderState rstate, IVertexType vertextype, Lighting& lights) at LibreLancer.CommandBuffer.AddCommand(RenderMaterial material, MaterialAnim anim, WorldMatrixHandle world, Lighting lights, VertexBuffer buffer, PrimitiveTypes primitive, Int32 baseVertex, Int32 start, Int32 count, Int32 layer, Single z, DfmSkinning skinning) at LibreLancer.Utf.Dfm.DfmMesh.DrawBuffer(CommandBuffer buffer, Matrix4x4 world, Lighting light, Material overrideMat) at LibreLancer.Utf.Dfm.DfmFile.DrawBuffer(CommandBuffer buffer, Matrix4x4 world, Lighting& light, Material overrideMat) at LibreLancer.CharacterRenderer.Draw(ICamera camera, CommandBuffer commands, SystemLighting lights, NebulaRenderer nr) at LibreLancer.SystemRenderer.Draw() at LibreLancer.RoomGameplay.Draw(TimeSpan delta) at LibreLancer.FreelancerGame.Draw(Double elapsed) at LibreLancer.Game.Run() at lancer.MainClass.<>c__DisplayClass0_0. <main>b__0() at LibreLancer.AppHandler.Run(Action action, Action onCrash)Recent daily build. Another crash was about [; parsing aka disabled ini section when i tried to load a mod. I'm running virtual machine actually, wherein 4.7.1 NET is installed only. Systemviewer is stable for me though. ______ Looks like i fixed parts in my code by resetting cached material index when a new different part starts rendering https://pastebin.com/yru1Rq7E</main>
-
Thanks for the error, I’d actually missed something in the OpenGL spec there. Engine should no longer crash on vanilla (though it isn’t very interesting yet)
-
2021.01 is out
-
Amazing work Ichiru. I’ve dreamed for an open client to help me learn programming through. Textbooks on C# can teach me basics, but seeing so many examples of how things are implemented, can help me wrap around more game-related, practical uses. Going to love this. Downloading it and the source now, for when I get a rainy day and can jump back into learning C#. I have some scripting/programming OOP knowledge from full-stack web development, but nothing software. Hoping it still affords a good headstart into basics.
Thanks again. This is an amazing project and a great start.
-