overte-org / overte

Overte open source virtual worlds platform.
https://overte.org/
Other
128 stars 47 forks source link

support VRMC_materials_mtoon and KHR_materials_unlit #936

Closed HifiExperiments closed 2 months ago

HifiExperiments commented 2 months ago

Fixes #900 and #933

this was sooooooooooooo much easier with cgltf! thank you @ksuprynowicz ❤️

Here's a super simple gltf file with MToon for testing: https://raw.githubusercontent.com/pixiv/three-vrm/dev/packages/three-vrm-materials-mtoon/examples/models/cube.gltf

There are some unlit models for testing in #900

Funding

This project is funded through NGI0 Entrust, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.

NLnet foundation logo NGI Zero Logo

HifiExperiments commented 2 months ago

(whoops I had commented on the wrong PR)

some compiler complaints:

 /__w/overte/overte/libraries/procedural/src/procedural/ProceduralMaterialCache.h: In copy constructor 'NetworkMaterial::NetworkMaterial(const NetworkMaterial&)':
/__w/overte/overte/libraries/procedural/src/procedural/ProceduralMaterialCache.h:81:10: warning: 'NetworkMaterial::_lightmapParams' will be initialized after [-Wreorder]
   81 |     vec2 _lightmapParams;
      |          ^~~~~~~~~~~~~~~
/__w/overte/overte/libraries/procedural/src/procedural/ProceduralMaterialCache.h:74:10: warning:   'bool NetworkMaterial::_isOriginal' [-Wreorder]
   74 |     bool _isOriginal{ true };
      |          ^~~~~~~~~~~
/__w/overte/overte/libraries/procedural/src/procedural/ProceduralMaterialCache.cpp:825:1: warning:   when initialized here [-Wreorder]
  825 | NetworkMaterial::NetworkMaterial(const NetworkMaterial& m) :
      | ^~~~~~~~~~~~~~~
/__w/overte/overte/libraries/procedural/src/procedural/ProceduralMaterialCache.cpp: In copy constructor 'NetworkMToonMaterial::NetworkMToonMaterial(const NetworkMToonMaterial&)':
/__w/overte/overte/libraries/procedural/src/procedural/ProceduralMaterialCache.cpp:1211:31: error: call of overloaded 'NetworkMaterial(const NetworkMToonMaterial&)' is ambiguous
 1211 |     _outline(material._outline)
      |                               ^
In file included from /__w/overte/overte/libraries/procedural/src/procedural/ProceduralMaterialCache.cpp:9:
/__w/overte/overte/libraries/procedural/src/procedural/ProceduralMaterialCache.h:29:5: note: candidate: 'NetworkMaterial::NetworkMaterial(graphics::Material)'
   29 |     NetworkMaterial(const graphics::Material material) : graphics::Material(material) {}
      |     ^~~~~~~~~~~~~~~
/__w/overte/overte/libraries/procedural/src/procedural/ProceduralMaterialCache.cpp:825:1: note: candidate: 'NetworkMaterial::NetworkMaterial(const NetworkMaterial&)'
  825 | NetworkMaterial::NetworkMaterial(const NetworkMaterial& m) :
      | ^~~~~~~~~~~~~~~
HifiExperiments commented 2 months ago

unrelated to this PR, embedded textures maybe aren't working? and hard to tell that the mtoon material is working from this photo. but it is!

Screenshot 2024-04-19 160501

SilverfishVR commented 2 months ago

Yes, textures on embedded gltf does not work, I don't think it ever did because I rep0rted this issue 2 years ago in Vircadia. I think I still have some test files so I make a new issue here.