Page 1 of 1

SWBFII HLSL Shader Toolkit

Posted: Wed Nov 29, 2017 6:18 am
by SleepKiller
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

Re: SWBFII HLSL Shader Toolkit

Posted: Sun Jan 28, 2018 10:13 am
by Anakin
i just tried to compile your compiler but i get a few errors:
Hidden/Spoiler:
[code]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[/code]
Please be courteous and use Hide tags with large walls of text/code. -Staff

Re: SWBFII HLSL Shader Toolkit

Posted: Sun Jan 28, 2018 9:16 pm
by SleepKiller
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.

Re: SWBFII HLSL Shader Toolkit

Posted: Tue Jan 30, 2018 5:59 am
by Anakin
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??