{
  "id": "unity/terrain-heightmap-resolution-mismatch",
  "signature": "ArgumentException: Heightmap resolution (1025) does not match terrain data (513)",
  "signature_zh": "ArgumentException：高度图分辨率 (1025) 与地形数据 (513) 不匹配",
  "regex": "ArgumentException: Heightmap resolution.*does not match terrain data",
  "domain": "unity",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "Importing or assigning a heightmap texture with a resolution that does not match the terrain's configured resolution (must be power of two + 1).",
  "root_cause_type": "generic",
  "root_cause_zh": "导入或分配的高度图纹理分辨率与地形配置的分辨率不匹配（必须为 2 的幂加 1）。",
  "versions": [
    {
      "version": "Unity 2021.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Unity 2022.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Unity 2023.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Manually resize the heightmap texture in an image editor to 1025x1025.",
      "why_fails": "Unity expects heightmap resolution to be 2^n + 1 (e.g., 513, 1025, 2049). Arbitrary resizing may still be incorrect.",
      "fail_rate": 0.45,
      "condition": "",
      "sources": []
    },
    {
      "action": "Delete and recreate the terrain from scratch.",
      "why_fails": "This is time-consuming and does not address the resolution mismatch if the same texture is used.",
      "fail_rate": 0.2,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Change the terrain's heightmap resolution in the Terrain Settings to match the imported texture. For example, set 'Resolution' to 513 if the texture is 513x513.",
      "success_rate": 0.95,
      "how": "Change the terrain's heightmap resolution in the Terrain Settings to match the imported texture. For example, set 'Resolution' to 513 if the texture is 513x513.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Resample the heightmap texture to the correct resolution using script: Texture2D resampled = new Texture2D(513, 513); Graphics.ConvertTexture(original, resampled);",
      "success_rate": 0.85,
      "how": "Resample the heightmap texture to the correct resolution using script: Texture2D resampled = new Texture2D(513, 513); Graphics.ConvertTexture(original, resampled);",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在地形设置中更改地形的高度图分辨率以匹配导入的纹理。例如，如果纹理是 513x513，则将“分辨率”设置为 513。",
    "使用脚本将高度图纹理重新采样为正确的分辨率：Texture2D resampled = new Texture2D(513, 513); Graphics.ConvertTexture(original, resampled);"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.unity3d.com/Manual/terrain-Height.html",
  "official_doc_section": null,
  "error_code": "TERRAIN-003",
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-09-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}