Integrate D3D11 support and enhance rendering capabilities - #160
Open
alfonsmagd wants to merge 36 commits into
Open
Integrate D3D11 support and enhance rendering capabilities#160alfonsmagd wants to merge 36 commits into
alfonsmagd wants to merge 36 commits into
Conversation
Addin resolving dependencies glfw
- Updated CMakeLists.txt to include D3D11 in LIBRW_PLATFORMS. - Modified platform-specific code to handle D3D11 configurations. - Introduced new source files: - d3d11.cpp - d3d11matfx.cpp - d3d11render.cpp - d3d11skin.cpp - Updated rwbase.h to define RWDEVICE and RWHALFPIXEL for D3D11, and added PLATFORM_D3D11 enum. - Created rwd3d11.h for D3D11-specific structures and function prototypes. - Added TODO comments for further development in shader creation and rendering callbacks. These changes enhance the library's capabilities with modern D3D11
Introduces a new d3d11device.cpp with basic D3D11 device system stubs, mode management, and placeholder rendering hooks. Updates CMakeLists.txt to include the new file. Adds D3D11 structures and function prototypes to rwd3dimpl.h, and exports the D3D11 renderdevice in rwd3d11.h. Modifies d3ddevice.cpp to use the new D3D11 renderdevice. No actual rendering is implemented yet.
Create and release the Im3D shaders, input layout, dynamic buffers and matrix constant buffer. Add camera view/projection updates, D3D9-style matrix uploads and the initial Im3D transform path. Keep D3D11 HLSL sources separate and embed them through CMake, and ignore generated build artifacts.
Connect primitive draws, fix face winding, and remove the D3D9 half-pixel offset from D3D11.
D3D9 provides fixed-function alpha testing, while D3D11 does not. Emulate alpha testing in the D3D11 pixel shaders so discarded fragments cannot write depth.\n\nMove Im2D shaders into D3D11 shader files generated by CMake.
Rename the engine device field and provide CPU-backed static index buffers for the D3D11 backend.
Move object and light data into dedicated vertex shader constant buffers. Add a pixel shader state buffer for D3D9 fixed-function behavior that D3D11 must reproduce in shaders. Vertex lighting remains pending while the backend stays aligned with the D3D9 pipeline for GTA III and example testing.
Use the D3D9 column-major matrix convention and matrix-vector multiplication order in default and immediate 3D shaders. Align constant names and layout with the D3D9 shader registers, and cache vertex stream bindings using the existing D3D9 naming and behavior.
Explain that im3d_VS_d11.hlsl is bound by the D3D11 Im3D path for textured view planes, camera frusta, debug lines, and other immediate-mode 3D primitives. Document the camera case where opaque texels write depth before a coplanar outline is drawn, allowing the D3D9/D3D11 coverage difference to hide line pixels. Keep the half-pixel correction local to Im3D so Im2D and ImGui remain aligned and text stays sharp.
Use im3dVS, im3dPS, and im3dTexPS directly in the D3D11 immediate-mode path. Remove misleading default shader aliases while preserving the D3D9-style selection point for future Im3D lighting variants.
Add native geometry streaming, GPU skinning, and dual texture stages for MatFX.
Mirror the D3D9 MatFX environment path with dedicated constant buffers, dual texture stages, matching shader variants, and CMake-managed HLSL sources.
Cap packed directional, point, and spot lights to eight entries in total and keep the default, skin, and MatFX shader layouts consistent with the CPU constant buffer.
Build the video mode list from DXGI output modes, keep the windowed mode at index zero, deduplicate fullscreen resolutions by refresh rate, and rebuild the list when changing adapters.
D3d11 integration backend
Author
|
#122 I have been adding info about my steps in this issue , is working in GTA III but I have to fix some issues with FOG, right now is setting by one, I need to do more test in gta III . But I think is a versión that can be integrate without problem in librw, and more tweaks can be more easy to follow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.