KhronosGroup / UnityGLTF

Runtime glTF 2.0 Loader for Unity3D
MIT License
1.81k stars 490 forks source link

Custom shader / transparency + refraction in export? #573

Closed efsjouw closed 8 months ago

efsjouw commented 4 years ago

Hi, it doesn't seem like my custom material/shader effect is being exported. Is there any way to make this work by copying the properties or something?

What it looks like in Unity: https://postimg.cc/LY41sG6y image

What is looks like in the previewer: https://postimg.cc/sB4Ws3yQ image

EDIT: edited image links

donmccurdy commented 4 years ago

glTF does not support arbitrary custom shaders, as these aren't portable across tools and engines. The core glTF PBR model has fixed inputs, described in the specification. These include alpha, with modes for "alpha blend" and "alpha clip". Only alpha-based transparency is currently supported.

There are proposals in progress for inputs with physically-based transparency, see https://github.com/KhronosGroup/glTF/milestone/2 for a full list of relevant discussions, and probably the item on KHR_materials_transmission is most relevant. However, these are still drafts and not yet supported in tools.