-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT]Rewriting the engine in C++ #7
base: master
Are you sure you want to change the base?
Conversation
Not using Monogame anymore, switching to C++ DX11/DirectXTK
Made Shader,VertexBuffer, ShaderInputLayout and ResourceCreationException classes. Made Vector4 and Vertex[type]Declaration structs All that code was written in 1 go and it worked for the first time. lmao I'm still amazed
--> I continued to make the code more modular --> Implemented IObject and Camera TODO: --> Implement shader parameters
It looks so broken GAH
Now to fix the axis model...
I tested the physics engine initialization under a separate VS2022 project. I fixed some strange issue with vertices seeming to be skewed to the side because of a erroneous calculation inside I attempted implementing mesh picking without success. |
Including spritebatch, constexpr math API, grid setting, serialization and deserialization for I/O and more stuff I don't remember.,
SpriteBatch is almost finished, I just need to fix the rotation affine transformation. (I'm not including Font in this list). Fonts currently have a major memory bug involving reading the glyps from FreeType. I have added support for source rectangles (i.e custom UV coordinates) so it is possible to only render a part of a image. I didn't test that feature, but it will be used when I add the translation/rotation/scale buttons. |
- AssetReference was renamed to AssetID. - AssetID is just a templated struct that contains a unsigned integer, so an untyped ID is a plain integer. - Asset base type for classes that can be loaded using ContentManager::Load<T>. - Removed Asset<T> and IAsset. This was necessary, because the types of content being loaded were not identifiable during deserialization.
Project files are in a JSON format. Compiled projects will be generated using a compiler (i.e MSVC), so they won't be used in final projects. |
Stuff being done is too small to explain imo
I've also attempted to use precompiled headers, but I've failed.
Need to use font atlases and a preallocated vertex buffer for the SpriteBatch implementation. |
- Fix loading assets at opening project - Some nullchecks - Simplified AssetType registration - Work on integrating TextPrint object
Also added Texture2D::Texture2D(GraphicsDevice*, std::filesystem::path const &) overload to replace string and wstring overloads.
Kinda works, but all asset previews are broken and save a plain coloured image.
CMake building works with VS2022 on Windows 10. Post build processes are broken at the moment. |
Fixed by writing an optimisation in SpriteBatch to not create new VertexBuffers in each Draw() update, but to modify an existing Vertex Buffer with an initial capacity of 1024 and a growth factor of 2. Fixed VertexBuffer usage variable not being used in the ctor. Thus also fixing ::SetData() throwing exceptions. Finally, also fixed the post build process.
Visual Studio doesn't seem to define NDEBUG when switching to Release-x64, this is so fcking stupid. I'm beginning to hate VS2022. May want to try CLion again.
Rewriting the engine in C++ could allow more control and performance compared to the old Monogame releases. Monogame has limited 3D rendering capabilities, namely the assimp implementation allows a maxiumum of 72 bones, BasicEffect (Blinn-Phong with limited control over the variables), broken UVW mapping, and some cross compatibility issues.
I do realise this will take months, but I think it is worth it.
Currently, it is being written using plain Winapi32 and DirectX11 (native windows technologies, duh). Future implementation could use NVRHI and a cross platform GUI library.
Tasks are placed in the order they are finished.
Complete tasks
Tasks that are currently being worked on
TO DO Tasks
Tasks list taken from: https://github.com/orgs/3DRadSpace/projects/10