flowtsohg / mdx-m3-viewer

A WebGL viewer for MDX and M3 files used by the games Warcraft 3 and Starcraft 2 respectively.
MIT License
131 stars 47 forks source link

swirl behavior #68

Closed 435352980 closed 3 years ago

435352980 commented 3 years ago

Hi, i found a problem with the model display. circle.zip

This model looks like a swirl in game. 1F4EF2BB-5547-4EDB-883D-F6FC96BA01ED

But the viewer's behavior like below. 4月-14-2021 19-39-11

flowtsohg commented 3 years ago

Looks like XYQuad particles need to take the node orientation into account. I don't know the exact rules, but I'll get some implementation going.

flowtsohg commented 3 years ago

I added a quick implementation that I need to clean a bit. I also needed to double the emission rate to get the same results as WE, otherwise it would spawn too slow and it became more of a rotating pentagram than a whirlpool. I never really compared the emission rate of the different emitters to the game, maybe the implementation isn't correct.

But something still feels off about it 🤔 I think the angles aren't quite circular in my implementation.

Y6OuELPde9

flowtsohg commented 3 years ago

I changed it to use the velocity instead of the node orientation, since Retera apparently added this in the past to his code already. I am not sure if there's a real difference in this model, I think I just didn't set the angles quite right in the image above.

5sJgGnkwgJ

Still need to investigate the emission rate, or we get this:

O8aJ9iAgpc

435352980 commented 3 years ago

Cool! It's very similar. JT IVY}{_Y2$WM4CF H`HNN

flowtsohg commented 3 years ago

Retera mentioned that the emission being different relates to the particles setting in WC3, and indeed it is. This model only looks like a spiral in high setting, which seems to be somewhere around x2 emission as I mentioned before.

Ironically I had a x2 many years ago in a much older implementation, which I didn't understand then either :)

Please test it now.

435352980 commented 3 years ago

GIF GIF1

flowtsohg commented 3 years ago

I am not sure what I am looking at, these are from in-game, yes? Are you saying it's working or not? The ubersplat textures are not overriden in my images if that's what you are pointing at, since they didn't run in the context of a map. It feels like in-game the spiral is somewhat bigger and there's more space between the spiral "line", but I am not sure if that's my imagination because I don't see it with the same background terrain textures, or it's something in the map, or the implementation is still wrong in some way.

435352980 commented 3 years ago

Yes, in game. Viewer works fine now. 4月-16-2021 09-07-24