Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Swyter22/08/2018
- Hi there! Fellow Arch user here. :penguin:(edited)
- Conversion isn't that hard once you figure out the pieces. You only need a text editor, glslangValidator (https://github.com/KhronosGroup/glslang/releases) and patience.
- William22/08/2018
- Hey Swyter, ty for coming by! Right to first just confirm it, the white textures that are appearing are due to what Vornne said?
- Swyter22/08/2018
- The main thing is to split every fragment/pixel and vertex shader into its own file. Then there's the endless renaming of float2 / float3 / float4 -> vec2 /vec3 / vec4 and tex2d() -> texture() and things like that.(edited)
- Oh, for textures and resources just ensure that the OpenBRF texture naming is the same in the filesystem. MySword.dds could be actually named mYsWoRd.dds and it would show up fine in Windows, not so much in Linux, which is case-sensitive. Same thing for folders. In Linux and macOS is important to keep the languages folder strictly in lowercase and things like that.(edited)
- William22/08/2018
- Alright had a look and it's basically all lower-case, in the files, in OpenBRF and in the mod sys so I believe we can exclude that
- Essentially, PW added certain custom shaders and applied it to quite a lot of materials
- And according to Vornne these shaders well aren't usable by Linux/Mac because they're not in the right format
- Problem is, I don't know the first thing about shaders so what you mentioned above, well, I can't even decipher it :stuck_out_tongue:
- Swyter22/08/2018
- If they are based on the Native ones you will need to adapt the ones in GLShadersOptimized or optimize them yourself from the original ones in GLShaders.
- Yeah, I think you should learn some rudiments of HLSL before attempting something like this. I started by doing some minor mb.fx tweaks (easy stuff like replacing with solid colors) with some mentoring from @mtarini.
- There's some information in TaleWorlds Forum about this. One handy thing to keep in mind is that by enabling Edit Mode you can live reload the shaders file with Ctrl + F, at least in Windows.(edited)
- William22/08/2018
- I had a peak here and there and what confuses me at the moment is that, PW was a module that had only that one "PW" module map that you inserted under "Modules" and that was it in terms of installing the mod. And yet there's no "GLShaders" map or anything of the sort in the module
- And yet it contains these custom shaders
- https://i.gyazo.com/35a9b64269bbf26c09789941198cbfa1.png
- Swyter22/08/2018
- There has to be a mb.fx file in the root folder of the mod. That's the HLSL shader bytecode. It's precompiled.(edited)
- William22/08/2018
- Right got it
- Swyter22/08/2018
- Now you need the source file that produced that precompiled bytecode file. If it isn't included you'll have to ask @Vornne.
- Plan B is you disassembling the DirectX shader bytecode. I don't recommend you that route.
- You can use TLD's source as reference.
- https://github.com/tldmod/tldmod/tree/master/_wb
- GitHub
- tldmod/tldmod
- tldmod - The Last Days of the Third Age — Tolkien-based mod for the Mount&Blade series.
- You can see that we have a file that we called mb_src.fx, that is based on the original TaleWorlds shader file and is plain HLSL source code. That's what you are interested in, the saucy part.(edited)
- William22/08/2018
- https://github.com/vornne/pw_module_system/blob/pw/shaders/mb.fx
- GitHub
- vornne/pw_module_system
- pw_module_system - Persistent World module system - source files of a mod for Mount&Blade Warband.
- Does this look like "it"?
- Swyter22/08/2018
- To generate the binary mb.fx from mb_src.fx you need the FXC compiler. We have a copy here: https://github.com/tldmod/tldmod/blob/master/_wb/fxc64.exe
- GitHub
- tldmod/tldmod
- tldmod - The Last Days of the Third Age — Tolkien-based mod for the Mount&Blade series.
- @William Yes, that's the HLSL source that you need to convert.(edited)
- William22/08/2018
- Perhaps we shoud move to #persistent-kingdoms . We cluttered the wrong channel, Barko will be mad.
- Swyter22/08/2018
- I am a bit busy right now with stuffs, but I can resolve specific issues you have. Better if we do it in the open so that others can benefit from it. I can't do it for you, though.(edited)
- William22/08/2018
- The other channel is open as well, it's just that this channel is reserved for requests/offers. But yeah I understand. I'll have to dig in a bit before I attempt to do this.
- Swyter22/08/2018
- If those few shaders in the screenshot above are the only ones you might not even need to create your own variants or even fiddle with shader code. Maybe just reusing existing ones and editing the GLShaders/techniques.xml will do the trick.(edited)
- William22/08/2018
- See that's the thing, I don't have any GLShaders map
- In the module
- Swyter22/08/2018
- Copy GLShaders/techniques.xml and the entire GLShadersOptimized folder to your mod. Try adding the missing techniques at the end (keep in mind that the technique name is not the same as the shader name) by reusing preexisting shader files that might be close.(edited)
- For example: You can see that for the technique standart_skin_nobump_nospecmap there are actually four variants (with the _SHDW, _ALPHATEST and _ALPHATESTSHWD suffixes).(edited)
- If you map them out to native shader files they may look a bit ugly, but it will be better than having white meshes. You can always incrementally polish the kludge.(edited)
- Let me know if you need some extra help.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement