首页/ CityEngine/ Material Shape Attributes

Material Shape Attributes

作者:dreamsong 2019-10-16 12:33:12 CityEngine


Material Shape Attributes

Synopsis

AttributeDescription
string material.name
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.

FeatureCE Viewport (OpenGL)KML/DAE readOBJ read3DS writeKML/DAE writeFBX writeOBJ writeRIB writeVOB writeFileGDB write
nameYYYYYYYYY-
shader-------Y--
colorY (2)Y (1)YYY (1)YYYYY
ambientYYY-YYYY--
specularYYYYYYYYY--
opacityYYYYYYYYY-
reflectivityYYYYYYYYY-
shininessYYYYYYYYY-
bumpValueYYY-Y-YYY-
colormapY (2)Y (1)YYY (1)YYYYY
bumpmapYYY-YYYYY-
dirtmapY (2)Y--YY-YY-
specularmapYYYYYYYYY-
opacitymapYYYYYYYYY-
normalmapYY--YY-Y--
UV offsetYY--YY-YY-
UV scaleYYY-YY-YY-
EdgesY--------Y
VerticesY--------Y

Remarks:

(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.

Related

Example

 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)


阅读:246