Skip to content

Unity importer creates URP-incompatible materials that render magenta #3273

@danyalahmed1995

Description

@danyalahmed1995

Intro

Hi,

I am using the MuJoCo Unity plugin to test MJCF import workflows in Unity. While importing sample MuJoCo models into a fresh Unity 6 Universal 3D / URP project, I noticed that the imported materials initially render magenta until Unity's Render Pipeline Converter is used to upgrade the materials.

My setup

  • MuJoCo version: 3.8.1
  • Unity plugin source: unity/package.json from the MuJoCo repository at tag 3.8.1
  • Unity version: 6000.3.10f1 LTS
  • Unity template: Universal 3D
  • Render pipeline: URP / SRP
  • OS: Windows
  • Architecture: x86_64
  • Native MuJoCo package: mujoco-3.8.1-windows-x86_64.zip

What's happening? What did you expect?

When importing MJCF models into a fresh Unity Universal 3D / URP project, the generated/imported materials render magenta.

This appears to happen because the imported materials are not compatible with the active render pipeline. Running Unity's Render Pipeline Converter with Material Upgrade fixes the rendering, after which the same imported model displays normally.

Actual behavior:

  • The MJCF model imports successfully.
  • The model appears in the scene.
  • The imported materials render magenta in a URP project.
Image

Expected behavior:

  • Imported materials should use a shader compatible with the active render pipeline, or the importer/docs should clearly mention that URP users need to run Unity's material converter after import.

Workaround:

  • Open Window > Rendering > Render Pipeline Converter
  • Select Built-in to URP
  • Run Material Upgrade
  • The imported materials render correctly afterward.
Image Image

Steps for reproduction

  1. Create a new Unity project using the Universal 3D template.
  2. Add the MuJoCo Unity package from unity/package.json.
  3. Import an MJCF model using Assets > Import MuJoCo Scene.
    • I reproduced this with model/humanoid/humanoid.xml.
    • I also saw the same behavior with model/balloons/balloons.xml.
  4. Observe the imported model in the scene.

The model imports successfully, but its materials render magenta until they are upgraded through Unity's Render Pipeline Converter.

Minimal model for reproduction

This reproduces with existing sample models in the MuJoCo repository:

  • model/humanoid/humanoid.xml
  • model/balloons/balloons.xml

No custom model is required.

Code required for reproduction

No code is required. This reproduces through the Unity editor import flow:

  1. Assets > Import MuJoCo Scene
  2. Select model/humanoid/humanoid.xml
  3. Observe the imported model in a Universal 3D / URP project

Confirmations

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions