google-ar / sceneform-android-sdk

Sceneform SDK for Android
https://developers.google.com/sceneform/develop/
Apache License 2.0
1.23k stars 604 forks source link

Emissive texture support missing from generated fbx material #997

Open tellypresence opened 4 years ago

tellypresence commented 4 years ago

In generated fbx material file build/sceneform_sdk/default_materials/fbx_material.sfm there is an emissive property declared: sfm.hasSourceProperty("emissive"), But the property is never defined below along with the other properties.

The gltf material build/sceneform_sdk/default_materials/gltf_material.sfm by contrast defines emissive properties:

      {
        name: "emissiveFactor",
        description: "Emissive Factor",
        options: [
          {
            default: sfm.sourceProperty("EmissiveColor", [0.0, 0.0, 0.0, 0.0]),
            ...
      },
      {
        name: "emissive",
        description: "Emissive Texture",
        ...

The documentation doesn't seem to have a lot of information -- are there special steps that need to be taken to get emissive materials working with fbx models?

VCDo commented 4 years ago

I assume you should create a new/custom material definition (sfm) and use this for your model instead of the default fbx material definition. The lit material model should support emissive property.

tellypresence commented 4 years ago

@VCDo Yes, you may well be correct; asking in case this was a mere oversight (since emissive gets a mention in generated material) and it was an easy fix...otherwise may have to resort to material override (and all the baggage/boilerplate that entails)