When I was re-engineering something akin to these for the purpose of OpenGL rendering of the Reforged graphics on Retera Model Studio, one of the places I copied from was the code in the Hive's viewer ("view in 3D") which had a functional but less complete capability to render Reforged graphics. The one I set up is also not complete:
Hive/Ghostwolf's Viewer:
A WebGL viewer for MDX and M3 files used by the games Warcraft 3 and Starcraft 2 respectively. - flowtsohg/mdx-m3-viewer
github.com
A WebGL viewer for MDX and M3 files used by the games Warcraft 3 and Starcraft 2 respectively. - flowtsohg/mdx-m3-viewer
github.com
Retera Model Studio:
Retera's Java WC3 libraries. Contribute to Retera/ReterasModelStudio development by creating an account on GitHub.
github.com
"Warsmash" (Desktop Java port of Hive/Ghostwolf viewer with edits):
An emulation engine to improve Warcraft III modding - Retera/WarsmashModEngine
github.com
I'm guessing that you didn't spend time looking at these haphazard fan reinventions and instead used the official game or debug leaks as the basis for your work. If that's correct, you think these other systems might be able to use the Wc3Shaders repo to better render the Reforged graphics?
We can look at stuff like the Retera Model Studio reinvention of the shaders, which is somewhat functional but lacks ambient occlusion and some other things:
I recall some musing at one point about how I discovered the Hive Viewer version had the normal map loaded incorrectly:
The previewer inside Retera Model Studio is based on the Hive Viewer but has some enhancement to try to preview metals and stuff in PBR, and I changed the interpretation of the normal map to be more accurately reflecting how I think the game is supposed to be. After putting time into tinkering with it, I discovered that although I had not been focused on it, HiveWE developers independently made the same realization that I did, to basically realize that the normal maps have the Y coordinate magically flipped or something dumb like that. It's been a little while and I'm writing this without...
When I am playing World of Warsmash for example and I try to drop-in Reforged models using the Warsmash shader linked above into the graphics scene, it is again functional but misses ambient occlusion and also uses some possibly stupid lighting math that goes absolutely nuts and pukes rainbows if there are more than a few lights shining on the object:
All those shaders are written in Slang, so they compile to hlsl, glsl, metal, glsl, webgsl, spir-v, etc. I'm currently focused on matching the originals the best I can when recompiling. If you compile for d3d11 and generate the bls, at least sd and hd shjaders will match Reforged and you can replace the game shaders with my generated verions without losing any effects in-game.
you can use those shaders in warmash or retera model studio if you want, you may have to produce glsl for them, just run the python scriptsd on hd_vs, hd_ps, crystal_vs, crystal_ps, sd_vs, sd_ps, sd_on_hd_vs and sd_on_hd_ps; and use "--target opengl". The little tool which I use to develop cornflakes is actually in OpenGL and uses popcorn_fx_vs and popcorn_fx_ps from that repository:
Now I would suggest you wait a bit for me to release WhiteoutFlakes (
https://www.hiveworkshop.com/threads/whiteoutflakes-warcraft-iii-reforged-previewer.371713/) That's a render service written in C++ that I intend to release soon with language bindings for Javascript, Typescript, Python, Java and (maybe C# and Rust). It will be useful enough for you to render anything you want.
About Ambient occlussion: Reforged ignores it in the HD shader. it does an ambient occlussion pass later on but I have no idea how it works.
About Hive's viewer, it's good but it's off in ribbon emitters and it does not do the crazy transparency tricks the engine does. When rendering a Blend material the engine uses a Depth Prepass before rendering the actual model, this is what semi transparent models always show the front faces in the engine and almostz every viewer out there fails.
About your shader, you were missing the IBL calculations based on the specular and diffuse irrandiance cubemap.
Chapter 19. Image-Based Lighting is a good read about it. Reforged uses a few IBL Probes for that. I wish I could tell you how they work precisely but I can't, I'm still over reflecting stuffs compared to the game and I can't get the day/night IBL to work correctly.
Finally to answer your question, yes I'm based everything on the game. For the shaders I extracted the bls, then extracted the permutations out of each bls and made a uber-shader.hlsl which could produce all the permutations, afterwards I renamed variables until it made sense. Finally, I rewrote the shaders in slang. For reverse engineering the game, I'm using IDA Pro.