-
Notifications
You must be signed in to change notification settings - Fork 72
[ZH] Remove the unused WWShade library #596
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, USE_WWSHADE is also used in ww3d2/shdlib.h
. If USE_WWSHADE is always false, shouldn't it be deleted in there as well?
GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
Show resolved
Hide resolved
@@ -23,7 +23,6 @@ target_include_directories(z_wwcommon INTERFACE | |||
WWMath | |||
WWSaveLoad | |||
Wwutil | |||
wwshade |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would a WWShade model look like? Does the WWShade code work in principle? Would it be possible to revive this feature instead of deleting it? Would it be worth it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can try building W3DView with USE_WWSHADE on and open these w3ds https://www.moddb.com/games/cc-renegade/addons/cc-renegade-2-model-pack
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would a WWShade model look like? Does the WWShade code work in principle? Would it be possible to revive this feature instead of deleting it? Would it be worth it?
I agree with that, this library although it seems like it has no use, it's quite good starter step for managing the pixel shader 2.0 and 3.0 of dx 9 or later version
I don't agree with removing it, but it can be replaced with something else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Launching w3dview with USE_WWSHADE crashes:
> W3DView.exe!ShdHWPixelShader::Create(unsigned long * shader_code_str) Line 355 C++
W3DView.exe!Shd8BumpSpecClass::Init() Line 120 C++
[Inline Frame] W3DView.exe!ShdRendererClass::Init_Shaders() Line 95 C++
W3DView.exe!ShdRendererClass::Init() Line 85 C++
[Inline Frame] W3DView.exe!DX8Wrapper::Do_Onetime_Device_Dependent_Inits() Line 383 C++
W3DView.exe!DX8Wrapper::Create_Device() Line 616 C++
W3DView.exe!DX8Wrapper::Set_Render_Device(int dev, int width, int height, int bits, int windowed, bool resize_window, bool reset_device, bool restore_assets) Line 1076 C++
W3DView.exe!WW3D::Set_Render_Device(int dev, int width, int height, int bits, int windowed, bool resize_window, bool reset_device, bool restore_assets) Line 446 C++
W3DView.exe!CGraphicView::InitializeGraphicView() Line 209 C++
W3DView.exe!CMainFrame::Select_Device(bool show_dlg) Line 2195 C++
W3DView.exe!CMainFrame::OnCreateClient(tagCREATESTRUCTA * __formal, CCreateContext * pContext) Line 564 C++
It fails with call to D3DXAssembleShader
with shd8bumpspec_psh_code
. Then crashes.
The crashes can be avoided. Then all things in Shd8BumpSpecClass::Init
fail initialize.
The Ren2 models do open, but I do not know what to look for in regards to wwshade. Considering it fails to initialize shaders, perhaps it will not work anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, do we remove WWShade, or not? Any opinions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried to run it. Exception states, shader_code
is null, while it is -- if I understand correctly -- supposedly to be set by a DirectX API method, but it doesn't. Most documentation I can found refers to DirectX9 for shaders, not DirectX8. Wasn't Renegade 2 in DirectX9? Maybe they were planning to port ZH to DirectX9 but never got to it. Maybe shaders were never properly implemented in DirectX8?
Current models don't have shading and if there are no tools available to add shading to W3D models, then everything we want to with regards to shading needs to be built up from the ground anyways.
From that perspective, I think WWShade is more a liability then an asset and should be removed, including any reference to it. Worst case when it turns out WWShade is the way forward, we can restore it and take the extra work for granted. This PR is clear enough to understand what has been removed and can be easily reverted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is still for DX8
Not all models use the chunks, indeed kirov is one that didn't, examine in wdump which do
Grizzly iirc does
GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/Shadow/W3DVolumetricShadow.cpp
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased and comment added to the relevant header for the WWShade removal.
WWShade code isn't called in any ZH binary, no tools for making these W3D models exist, only models in existence are ones Westwood quietly posted on their FTP after Renegade 2 got cancelled and some strange odballs in BFMEs that use some of the SHD chunks. No game or tool however can show these models as nothing is compiled with this code