Collada DAE Export

Format Description

"COLLADA is an XML-based schema for digital asset exchange that enables the use of diverse digital-content-creation tools to author sophisticated assets for use by 3D applications, including graphics, animation, kinematics, physics, and shader effects. COLLADA represents authored data in multiple forms, enabling the transformation of assets as they journey from content tools that use high-level descriptions to run-time applications that require optimized, platform-specific representations. The COLLADA specification, documentation, and sample code is available at the Khronos.org website at www.khronos.org/collada." -- The Khronos Group

CityEngine supports OpenCollada (871).

Get the plugins for 3DS MAX and Maya here:

https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools

Specific Export Options for Collada

In addition to the general export options, Collada/DAE adds the following switches:

Option Description
Master File All written geometry files will by linked together by a master collada file.
Vertex Indexing Choose between indexed polygon vertices or separated vertex copies per polygon.

CGA Mapping to Collada / Examples

The following table lists the mapping of the major CityEngine elements to Collada elements. Note: the instancing/multi-texture behavior of Collada is similar to FBX.

CityEngine Collada Example
Whole Scene or Selection Multiple models are collected and referenced in the <prefix>_master.dae file:
<library_visual_scenes>
  <visual_scene id="VisualSceneNode">
    <node id="rootInst_lot1697" type="NODE">
      <instance_node url="./model_lot1697.dae#root_lot1697"/>
    </node>
  </visual_scene>
</library_visual_scenes>
Model/Shape The following elements are stored in a file per lot, e.g. model_lot1697.dae:
<scene>
  <instance_visual_scene url="#VisualSceneNode"/>
</scene>
Leaf Shapes (with references to assets and materials and optional transformation matrices)
<library_visual_scenes>
  <visual_scene id="VisualSceneNode" name="scene_lot1697">
    <node id="root_lot1697" type="NODE">
      <node id="VisualSceneNode1"
          name="mat0_CityEngineMaterial_CE" type="NODE">
        <instance_geometry name="mat0_CityEngineMaterial_CE" 
            url="#Geometry">
          <bind_material>
            <technique_common>
              <instance_material symbol="mat0_CityEngineMaterial_CE" 
                target="#VisualMaterial">
                <bind_vertex_input semantic="cityengine_colormap" 
                    input_semantic="TEXCOORD" input_set="0"/>
                <bind_vertex_input semantic="cityengine_dirtmap" 
                    input_semantic="TEXCOORD" input_set="2"/>
              </instance_material>
            </technique_common>
          </bind_material>
        </instance_geometry>
      </node>
    </node>
  </visual_scene>
</library_visual_scenes>
CityEngine Assets/Meshes
<library_geometries>
  <geometry id="Geometry" name="mesh1">
    <mesh>
      ... <triangles> or <polylist> ...
    </mesh>
  </geometry>
</library_geometries>
CityEngine Materials
<library_materials>
  <material id="VisualMaterial" name="mat0_CityEngineMaterial_CE">
    <instance_effect url="#Effect"/>
  </material>
</library_materials>

<library_effects>
  <effect id="Effect">
    <profile_COMMON>
      <newparam sid="Image-surface">
        <surface type="2D">...</surface>
      </newparam>
      <newparam sid="Image-sampler">
        <sampler2D>...</sampler2D>
      </newparam>
      <newparam sid="Image1-surface">
        <surface type="2D">...</surface>          
      </newparam>
      <newparam sid="Image1-sampler">
        <sampler2D>...</sampler2D>
      </newparam>
      <technique sid="common">
        <lambert>
          <emission><color>0 0 0 1</color></emission>
          <ambient><color>0 0 1 1</color></ambient>
          <diffuse>
            <texture texture="Image-sampler" 
                texcoord="cityengine_colormap">
              ...
            </texture>
            <texture texture="Image1-sampler" 
                texcoord="cityengine_dirtmap">
              ...
            </texture>
          </diffuse>
          ...
        </lambert>
        ...
      </technique>
    </profile_COMMON>
  </effect>
</library_effects>
CityEngine Bump/Normal Maps Because of a restriction of COLLADA, CityEngine bump and normal maps are exported as BUMP maps in the effect extra tag:
<effect id="MyEffect">
  <profile_COMMON>
    <technique sid="common">
      <lambert>...</lambert>
      <extra>
        <technique>
          <bump>
            <texture>...</texture>
          </bump>
        </technique>
      </extra>
    </technique>
  </profile_COMMON>
</effect>
	
CityEngine Textures
<library_images>    
  <image id="Image">
    <init_from>./brickwall2.tif</init_from>
  </image>
  <image id="Image1">
    <init_from>./dirtmap.15.tif</init_from>
  </image>
</library_images>
  

Further Reading

Copyright ©2008-2017 Esri R&D Center Zurich. All rights reserved.