jpaver / opengametools

A set of open c++ game development tools that are lightweight, easy-to-integrate and free to use. Currently hosting a magicavoxel .vox full scene loader.
MIT License
375 stars 36 forks source link

ogt_vox: Merge materials #39

Closed jibjoub closed 2 years ago

jibjoub commented 2 years ago

Add the materials of the scenes into the merge scene in ogt_vox_merge_scenes. I added the materials when the color of the master palette is added in previous update_master_palette_from_scene funtion

38

PS: this is my first PR 🙂

jpaver commented 2 years ago

Looks great, thanks for the contribution. Currently palette matching considers only color (see find_exact_color_in_palette and find_closest_color_in_palette), so if you have two palette entries that are both orange but different materials, only one will be transmitted to the final palette. Feel free to take a stab at solving that if you're interested, otherwise no worries, I'll get to it later. Thanks again!