SWBFII HLSL Shader Toolkit

Releasing the source files for your mod or map? Post em' here. (Applies to both SWBF1 & SWBF2)

Moderator: Moderators

Second Lance Corporal
Posts: 119
Joined: Thu Mar 03, 2011 5:08 pm
xbox live or psn: N/A

SWBFII HLSL Shader Toolkit

Postby SleepKiller » Wed Nov 29, 2017 6:18 am

As many of you likely know I've been working on this toolkit for a few weeks now and I feel it is now reasonably complete. It allows you to write shaders for the game in HLSL and have those shaders target either Shader Model 2.0 or Shader Model 3.0. See the readme for more information.

To install and use this you'll need to download or clone the repository from GitHub. Put it into the root of your BF2_Modtools folder. The folder structure should go BF2_ModTools -> shader_toolkit -> src. It should not go BF2_ModTools -> shader_toolkit -> shader_toolkit -> src. After that you can bootstrap the toolkit or you can download this which is a shader_toolkit folder containing a build folder for you to copy into the shader_toolkit you got from GitHub.

After that simply see the Getting Started in the readme for how to use the tool!

GitHub Repository
Prebuilt Compiler and Pre-extracted Premunged Files
Prebuilt core.lvl containing the New Shaders

Master of the Force
User avatar
Posts: 4695
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod

Re: SWBFII HLSL Shader Toolkit

Postby Anakin » Sun Jan 28, 2018 10:13 am

i just tried to compile your compiler but i get a few errors:

Hidden/Spoiler:
Code: Select all
Keine Instanz von ├ťberladene Funktion "std::swap" stimmt mit dem angegebenen Typ ├╝berein.
c:\BF2_ModTools\shader_toolkit\compiler\src\json.hpp   12929

'std::allocator<std::map<StringType,nlohmann::basic_json<std::map,std::vector,StringType,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>,std::less<StringType>,std::allocator<std::pair<const StringType,nlohmann::basic_json<std::map,std::vector,StringType,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>>>>>::destroy': warning STL4010: Various members of std::allocator are deprecated in C++17. Use std::allocator_traits instead of accessing these members directly. You can define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
c:\bf2_modtools\shader_toolkit\compiler\src\json.hpp   2584   

'std::allocator<std::vector<nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>,std::allocator<nlohmann::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>>>>::destroy': warning STL4010: Various members of std::allocator are deprecated in C++17. Use std::allocator_traits instead of accessing these members directly. You can define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
c:\bf2_modtools\shader_toolkit\compiler\src\json.hpp   2592   

'std::allocator<_Ty>::destroy': warning STL4010: Various members of std::allocator are deprecated in C++17. Use std::allocator_traits instead of accessing these members directly. You can define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
c:\bf2_modtools\shader_toolkit\compiler\src\json.hpp   2600   

'std::allocator<std::map<StringType,nlohmann::basic_json<std::map,std::vector,StringType,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>,std::less<StringType>,std::allocator<std::pair<const StringType,nlohmann::basic_json<std::map,std::vector,StringType,bool,int64_t,uint64_t,double,std::allocator,nlohmann::adl_serializer>>>>>::construct': warning STL4010: Various members of std::allocator are deprecated in C++17. Use std::allocator_traits instead of accessing these members directly. You can define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING or _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to acknowledge that you have received this warning.
c:\bf2_modtools\shader_toolkit\compiler\src\json.hpp   1634

Please be courteous and use Hide tags with large walls of text/code. -Staff

Second Lance Corporal
Posts: 119
Joined: Thu Mar 03, 2011 5:08 pm
xbox live or psn: N/A

Re: SWBFII HLSL Shader Toolkit

Postby SleepKiller » Sun Jan 28, 2018 9:16 pm

Interesting, I'll try to look into this when I get the time. Hopefully it is as simple as replacing json.hpp with the most recent one from here. You could try doing that yourself in the meantime. Or you can put "#define _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING" at the top of main.cpp, it looks like that should silence the warnings and let it compile.

Master of the Force
User avatar
Posts: 4695
Joined: Sat Sep 19, 2009 11:37 am
Location: Mos Espa (germany)
Projects :: Republic Commando Side Mod

Re: SWBFII HLSL Shader Toolkit

Postby Anakin » Tue Jan 30, 2018 5:59 am

fixed it.

And if i understood everything correctly, i need to put my core.req file in the build folder, but what pre munge files to i need??

Return to Released Assets

Who is online

Users browsing this forum: Bing [Bot] and 1 guest