atteneder / glTFast

Efficient glTF 3D import / export package for Unity
Other
1.25k stars 251 forks source link

Models import as flat pink models with different appearance per eye (Android/Meta Quest) #725

Open atkulp opened 2 weeks ago

atkulp commented 2 weeks ago

Describe the bug Importing models from a C# MonoBehavior results in models that are with solid pink (no shading, like a silhouette) with each eye seeing the model at a different offset. Models appear fine in Windows Player, but not in Android build running on Meta Quest.

Left eye sees it in its correct location. The right eye sees it offset to the right and it moves around based on head movement.

I'm not doing anywhere in my app that renders differently per eye and I don't manipulate the instantiated model.

Files This happens with every model I've tried to load, but here's an example.

petroglyphs.zip

glTF Validator shows a few warnings that don't seem relevant, but no errors.

To Reproduce C# Code:

public async void LoadModelFile(string modelFilename)
{
    try
    {
        GLTFast.GltfImport gltf = new ();

        var success = await gltf.LoadFile(modelFilename);
        if (success)
        {
            GameObject go = new();
            success = await gltf.InstantiateMainSceneAsync(go.transform);

            if (success)
            {
                return;
            }
            else
            {
                Debug.LogError(">> Error adding to scene", this);
                UnityEngine.Object.Destroy(go);
                go = null;
            }
        }
        else
        {
            Debug.LogError(">> Load failed", this);
        }

        Debug.LogError(">> Success", this);
    }
    catch (Exception e)
    {
        Debug.LogError(e.Message, this);
    }
}

Expected behavior I expect it to load with correct shape, textures, and stereo view.

Screenshots If you can do cross-view 3D (cross your eyes) you can align the grid and see how each eye has the model shifted a bit. Gltfast model load issue

Desktop (please complete the following information):

additionally (if significant for the bug):

Additional context n/a

snaik27 commented 1 week ago

I'm also seeing this, adding my specs here too in case it helps