dlannan / defold-blender-export

A blender import/export system for Defold
MIT License
42 stars 1 forks source link

Support multiple UV coords #1

Closed dlannan closed 2 years ago

dlannan commented 2 years ago

Based on discussion here with Ivan_Lytkin: https://forum.defold.com/t/building-a-sync-tool-for-blender-to-defold/69920

Potentially add a new stream for texcoord1 in the buffer files. This could allow multiple coord access in the material.

To be tested.

dlannan commented 2 years ago

Did some tests and have added some code for handling extra uv's. Currently its quite unstable - determining the uvs for the second channel is a little tricky.

May need to have specific requirements for Blender to be able to use multi-layer uvs. Ie: Only two material layers, and they need to be specifically mapped to channel 1 and 2. Or something like that.

dlannan commented 2 years ago

I have added a single combined texture as per Khronos gltf pbr material spec: https://www.khronos.org/blog/art-pipeline-for-gltf The simple pbr material provided now has a combined AO + metallic + roughness texture that should allow applying shadowmaps individually to objects (per object shadow maps) and with modifications in Defold using the new second stream, global shadow maps as well. This is not an ideal setup, and I expect there will be many different ways to solve this. The method provided here is to minimise changes needed on the Defold user side, to have an "instant" working solution, rather than a fully featured solution.