Material Shape Attributes

The material shape attributes control the shading, texturing and export of the shape's geometry. CityEngine supports six texture channels with a fixed semantic.

All of these attributes can be changed using the set shape operation. You can use the print operation to output the value of a certain material attribute, eg. print(material.colormap.r).


Attribute Description
The name used to reference materials in the exported model files. If this attribute is not set, the material will get the name of the rule which did the last modification.
string material.shader
The shader name used for export (currently supported by RIB).
float material.color.{r|g|b}
Diffuse color. Individual access to each color component. Default is white. More details.
string material.color.rgb
Diffuse color. Access to the complete color as hex-formatted string, eg. RED = "#ff0000". More details.
float material.ambient.{r|g|b}
Ambient color. Individual access to each color component. Default is black.
float material.specular.{r|g|b}
Specular color. Individual access to each color component. Default is black.
float material.opacity
Opacity factor. 1 is fully opaque, 0 is fully transparent. Default is 1.
float material.reflectivity
Reflectivity factor. 0 is no reflection, 1 is full reflection (of the Reflection Map set in the Panorama Settings). Note that reflection depends on the specular color: the default black color means no reflection!
float material.shininess
Phong specular exponent in the range [0, 128].
float material.bumpValue
Controls the bump scaling factor (if material.bumpmap is set).
string material.colormap
string material.bumpmap
string material.dirtmap
string material.specularmap
string material.opacitymap
string material.normalmap
Texture file paths for the texture channels. More details.
float material.{colormap|...|normalmap}.s{u|v}
Per-channel texture scaling factors.
float material.{colormap|...|normalmap}.t{u|v}
Per-channel texture translation factors.
float material.{colormap|...|normalmap}.rw
Per-channel texture rotation factors. The texture is rotated around the w-axis (w is the cross product of u and v).

Rendering and Export

For rendering in the CityEngine preview and for exporting the generated models, the material attributes need to be mapped to the respective format. The following table shows what format implements which feature.

Feature CE Viewport (OpenGL) KML/DAE read OBJ read 3DS write KML/DAE write FBX write OBJ write RIB write VOB write FileGDB write
name Y Y Y Y Y Y Y Y Y -
shader - - - - - - - Y - -
color Y (2) Y (1) Y Y Y (1) Y Y Y Y Y
ambient Y Y Y - Y Y Y Y - -
specular Y Y Y Y Y Y Y Y Y - -
opacity Y Y Y Y Y Y Y Y Y -
reflectivity Y Y Y Y Y Y Y Y Y -
shininess Y Y Y Y Y Y Y Y Y -
bumpValue Y Y Y - Y - Y Y Y -
colormap Y (2) Y (1) Y Y Y (1) Y Y Y Y Y
bumpmap Y Y Y - Y Y Y Y Y -
dirtmap Y (2) Y - - Y Y - Y Y -
specularmap Y Y Y Y Y Y Y Y Y -
opacitymap Y Y Y Y Y Y Y Y Y -
normalmap Y Y - - Y Y - Y - -
UV offset Y Y - - Y Y - Y Y -
UV scale Y Y Y - Y Y - Y Y -
Edges Y - - - - - - - - Y
Vertices Y - - - - - - - - Y


(1)The official COLLADA standard does not support a diffuse solid color and a diffuse texture at the same time.
(2)In the CityEngine viewport, the colormap and dirtmap values are multiplied with the (diffuse) color.



attr wallC       = "#FFFFFF"
attr wallTexture = "facade/walls/wall.c.09.tif"
attr dirtTexture = "dirtmaps/dirtmap.16.tif"
Wall --> 
    primitiveCube() color(wallC)
    set(material.colormap, wallTexture) projectUV(0)
    set(material.dirtmap, dirtTexture) projectUV(2)

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