Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2018
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.34 KB | None | 0 0
  1. Swyter22/08/2018
  2. Hi there! Fellow Arch user here. :penguin:(edited)
  3. 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.
  4. William22/08/2018
  5. Hey Swyter, ty for coming by! Right to first just confirm it, the white textures that are appearing are due to what Vornne said?
  6. Swyter22/08/2018
  7. 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)
  8. 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)
  9. William22/08/2018
  10. 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
  11. Essentially, PW added certain custom shaders and applied it to quite a lot of materials
  12. And according to Vornne these shaders well aren't usable by Linux/Mac because they're not in the right format
  13. 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:
  14. Swyter22/08/2018
  15. 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.
  16. 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.
  17. 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)
  18. William22/08/2018
  19. 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
  20. And yet it contains these custom shaders
  21. https://i.gyazo.com/35a9b64269bbf26c09789941198cbfa1.png
  22.  
  23. Swyter22/08/2018
  24. 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)
  25. William22/08/2018
  26. Right got it
  27. Swyter22/08/2018
  28. Now you need the source file that produced that precompiled bytecode file. If it isn't included you'll have to ask @Vornne.
  29. Plan B is you disassembling the DirectX shader bytecode. I don't recommend you that route.
  30. You can use TLD's source as reference.
  31. https://github.com/tldmod/tldmod/tree/master/_wb
  32. GitHub
  33. tldmod/tldmod
  34. tldmod - The Last Days of the Third Age — Tolkien-based mod for the Mount&Blade series.
  35.  
  36.  
  37. 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)
  38. William22/08/2018
  39. https://github.com/vornne/pw_module_system/blob/pw/shaders/mb.fx
  40. GitHub
  41. vornne/pw_module_system
  42. pw_module_system - Persistent World module system - source files of a mod for Mount&Blade Warband.
  43.  
  44. Does this look like "it"?
  45. Swyter22/08/2018
  46. 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
  47. GitHub
  48. tldmod/tldmod
  49. tldmod - The Last Days of the Third Age — Tolkien-based mod for the Mount&Blade series.
  50.  
  51. @William Yes, that's the HLSL source that you need to convert.(edited)
  52. William22/08/2018
  53. Perhaps we shoud move to #persistent-kingdoms . We cluttered the wrong channel, Barko will be mad.
  54. Swyter22/08/2018
  55. 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)
  56. William22/08/2018
  57. 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.
  58. Swyter22/08/2018
  59. 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)
  60. William22/08/2018
  61. See that's the thing, I don't have any GLShaders map
  62. In the module
  63. Swyter22/08/2018
  64. 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)
  65.  
  66. 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)
  67. 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)
  68. Let me know if you need some extra help.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement