Skylumz / Sollumz

Blender plugin to import codewalker converter xml files from GTA V
MIT License
388 stars 149 forks source link

Generate shattermaps on export #913

Open alexguirre opened 1 month ago

alexguirre commented 1 month ago

Shattermaps contain a distance field generated based on the window geometry. Should be relatively straightforward to automatically generate them export.

Ideally the workflow would just be, the user creates the geometry with the vehicle glass shaders, and export Sollumz detects it and creates the shattermap. No extra configuration.

The only (optional) configuration would be a way to mark exposed edges, window edges not attached to the frame. When breaking, these parts won't create a border of broken glass. This requires the shattermap to extend to the edge in those parts. See the window on the right here: image

For example, we could use a custom mesh attribute, then the user selects the exposed edges, clicks a button and they get marked as exposed in the custom attribute. Though, on import, we need to recover this info from the shattermap and store it in the attribute. image2