H-uru / korman

Blender plugin for creating ages for Cyan Worlds' proprietary Plasma engine and its open source variant, CyanWorlds.com Engine.
GNU General Public License v3.0
35 stars 17 forks source link

Improve vertex color exporting significantly. #396

Closed Hoikas closed 7 months ago

Hoikas commented 7 months ago

This moves the piece-by-piece assembly of vertex colors from _export_geometry() into a one-stop-shop for getting the near final vertex colors as Blender knows them. Included in this is separating out the adjustment channels for wavesets - which are stuffed inside of vertex colors. It is now an error for a waveset to have a "col", "color", or "colour" vertex color layer. This is to prevent confusion. Wavesets now accept alpha (red), specularity (green), fresnel (blue), and edgelength (alpha) vertex color layers. The color values in these layers is averaged and output to the respective channels. Further, a default value for edgelength is now computed similar (but not exactly like) PlasmaMax's SetWaterColor() function. Artist input to the edgelength vertex color layer will modulate Korman's calculation.

CC @DoobesURU to verify nothing breaks and that waveset vertex alpha should now function as expected.

This is still a draft because I would like to do a pass over eliminating list comprehensions in the tight inner loop of _export_geometry(). Until Python 3.12, list comprehensions are actually implemented as function calls. I see 1 comprehension for every face and 1 comprehension for every vertex (!!!), which are major targets for performance optimization.

DoobesURU commented 7 months ago

At the moment, it appears to not only eat the textures, but we also have some sort of checker pattern on everything: Desktop Screenshot 2024 01 15 - 18 58 18 26

Hoikas commented 7 months ago

Can you share a screenshot with the results before this PR?

DoobesURU commented 7 months ago

Can you share a screenshot with the results before this PR?

Desktop Screenshot 2024 01 15 - 19 12 07 18 Should look like this.

Hoikas commented 7 months ago

This PR is almost completely wrong and needs to be revised significantly.

Hoikas commented 7 months ago

Closing in favor of rewriting the entire mesh converter, someday.