文档

​
​

Development

User Acquisition

Monetization

工业

Asset Transformer SDK

2025.7

受支持
​

User Manual

Python API

C# API

Changelog

Discussions

Asset Transformer SDK

2025.7

受支持
​

此页面不支持所选语言。
​
​
Get started
  • System requirements
  • Licensing
  • Setup
  • Migrate from Scenario Processor
Framework
  • Framework
  • Preferences
Input/output files
  • Supported formats
  • Import files
  • Export files
  • Export textures
  • CAD vs Mesh
Scene
  • Product structure
  • Occurrence
  • Component
  • Material
Algorithms
  • CAD
  • Healing
  • Optimization
  • Combine and bake
  • Reconstruction
  • UVs
Viewer
  • Viewer
Pixyz UI
  • Setup
  • Overview
  • Create a custom UI
Guidelines
  • Data preparation
    • Import
    • Stage
    • Optimize
    • Generate LODs
    • Export
  • Process point clouds
Debug and diagnose
  • Log files
  • Debug best practices
Other
  • Samples
  • Glossary
  1. Asset Transformer SDK (ex Pixyz)

LOD generation guidelines

Learn how to generate Levels of Detail (LODs) for optimal real-time rendering performance.
阅读时间4 分钟
最后更新于 9 个月前

Why generate LODs?

Levels of Detail (LODs) are multiple versions of the same 3D model with varying polygon counts. Real-time engines automatically switch between these versions based on the object's distance from the camera, dramatically improving rendering performance.
Key benefits of LODs:
  • Better frame rates - Distant objects use fewer polygons, reducing GPU workload
  • Larger scenes - Support more objects in a scene without performance degradation
  • Scalable performance - Automatic quality adjustment based on viewing distance
  • Memory efficiency - Only high-detail meshes are used when needed
重要
LOD generation is performed after optimizing your LOD0 (master model) and before exporting. Always optimize your LOD0 first using the optimization guidelines to establish the best quality baseline.

LOD generation vs optimization

While both LOD generation and optimization reduce polygon count, they serve different purposes and use different approaches:
Optimization (LOD0):
  • Goal - Create the best quality model within performance constraints
  • Approach - Conservative reduction, preserve visual fidelity
  • Philosophy - Balance quality and performance for close-up viewing
LOD generation (LOD1+):
  • Goal - Create highly simplified versions for distant viewing
  • Approach - Aggressive, destructive reduction
  • Philosophy - Maximize performance, visual quality is secondary
注意
LOD generation is intentionally aggressive and destructive. Lower LOD levels may have visible geometry simplification, missing details, or simplified materials. This is acceptable because these versions are only used when objects are far from the camera.

1. Automatic LOD chain generation

The most common approach is to generate a chain of LODs using progressive decimation. Check the following example to automatically create multiple LOD levels:
from pxz import core, algo, scene, polygonaldef generateLODChainCommon(occurrences, count): partOccurrences = list() for occ in occurrences: partOccurrences = partOccurrences + scene.getPartOccurrences(occ) partOccurrences = set(partOccurrences) lodOccurrences = [[] for i in range(count + 1)] # init empty list of lists processedParts = list() for partOcc in partOccurrences: partComp = scene.getComponent(partOcc, scene.ComponentType.Part) if partComp == 0 or partComp in processedParts: continue mesh = scene.getPartMesh(partComp) if mesh == 0: continue if not polygonal.getMeshDefinition(mesh).triangles: continue processedParts.append(partComp) owner = scene.getComponentOccurrence(partComp) # returns the occurrence that "owns" the component name = core.getProperty(owner, "Name") occ0 = scene.createOccurrence(name + "_LOD0") scene.setComponentOccurrence(partComp, occ0) scene.setParent(occ0, owner, addInParentInstances=True, worldPositionStays=False) instances = scene.getInstances(occ0) for instance in instances: lodOccurrences[0].append(instance) for i in range(1, count + 1): lod = scene.createOccurrence(name + "_LOD" + str(i)) partClone = core.cloneEntity(partComp) scene.setComponentOccurrence(partClone, lod) scene.setParent(lod, owner, addInParentInstances=True, worldPositionStays=False) instances = scene.getInstances(lod) for instance in instances: lodOccurrences[i].append(instance) if len(lodOccurrences[0]) == 0: raise Exception("This process works for meshes only (requires the selected parts to be tessellated first)") return lodOccurrencesdef generateLODChainTarget(occurrences: list[int], ratios: list[int]): try: core.pushProgression(len(ratios) + 1, "Generate LOD Chain") lodOccurrences = generateLODChainCommon(occurrences, len(ratios)) for i in range(len(ratios)): algo.decimateTarget(lodOccurrences[i + 1], ["ratio", ratios[i]]) core.stepProgression() except Exception as e: core.popProgression() raise e core.popProgression()ratios = [50, 25, 10] # LOD1: 50%, LOD2: 25%, LOD3: 12%generateLODChainTarget([scene.getRoot()], ratios)

How it works

The script creates multiple LOD occurrences for each mesh:
  1. LOD0 - Your optimized master model (highest quality)
  2. LOD1 - First simplified version (50% of LOD0 triangles)
  3. LOD2 - Second simplified version (25% of LOD0 triangles)
  4. LOD3 - Third simplified version (10% of LOD0 triangles)
Each LOD is stored as a separate occurrence in the scene hierarchy, making it easy to export LOD groups for Unity, Unreal Engine, or other real-time engines.
提示
Start with 3-4 LOD levels. More LODs provide smoother transitions but increase memory usage and export file size. Always test LOD switching distances in your target engine to ensure smooth transitions.

2. Advanced LOD generation

For the farthest LOD levels (typically LOD3 or LOD4), you should generate a single mesh with a single baked material to achieve optimal performance with just one draw call.
Recommended approach:
  1. Single mesh
  • Merge and decimate - Combine all meshes into one, then apply aggressive decimation
  • OR use retopology - Generate a simplified mesh using retopology functions like Proxy Mesh
  1. Single material - Create a single baked material from LOD0 using the bakeMaterials function
This approach provides significant performance benefits:
  • One draw call - The entire object renders in a single GPU call
  • Minimal overhead - Use small resolution texture and a small number of polygons
提示
Only apply this aggressive single-mesh approach to the farthest LOD levels. Closer LODs (LOD1-LOD2) should maintain separate meshes and materials for better visual quality during transitions.

Copyright © 2026 Unity Technologies
法律信息隐私政策CookiesDocumentation Terms of Use请勿出售或分享我的个人信息您的隐私选择(Cookie 设置)

“Unity”、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属公司在美国和其他地方的商标或注册商标(此处查看更多信息)。其他名称或品牌是其各自所有者的商标。

为方便起见,一些页面是机器翻译的,可能包含不准确的内容。如有信息不一致的情况,以英文版本为准。

  • 在本页上
    • Why generate LODs?

    • LOD generation vs optimization

    • 1. Automatic LOD chain generation

      • How it works

    • 2. Advanced LOD generation

  • 其他资源
  • Optimization guidelines
  • Export guidelines

报告此页面的问题