CityEngine Web Scene (3ws) is a custom, web-optimized format that can be shared on ArcGIS Online and viewed with the CityEngine Web Viewer.
Select the content you want to export in the 3D Viewport, and start the exporter. Click File > Export Models... > CityEngine Web Scene.
Export settings
In addition to the general export options, the Web Scene export has an additional export page which allows you to control settings of individual layers:
Export | Checkboxes denote if a layer's contents are exported. |
Layer Name | The layer name, as it is set in the CityEngine scene. |
Layer Group | Layers can be combined to layer groups: All layers with the same group name are collected in a Layer Group. In CityEngine Web Viewer, only one layer of a group is visible at a time (exclusive visibility). Furthermore, all layer groups enable Swipe View in CityEngine Web Viewer. |
You can name your CityEngine scene layers to automatically have their layer group set by using the pattern GROUPNAME.LAYERNAME.
Texture quality settings
Scene settings | Use global option set in Textures in first export dialog page. (Only available as per-layer option.) |
High Quality | Convert all layer RGB textures and store with high quality |
Medium Quality | Convert all layer RGB textures and store with medium quality |
Low Quality | Convert all layer RGB textures and store with low quality |
Half Sized | Resize all layer textures by 50%; RGB textures are written as medium quality JPG |
Compact | Resize all layer textures to 50% size but with a maximum of 256x256 pixels; RGB textures are written as low quality JPG |
Original Textures | Use original textures Note:Only JPG and PNG textures are supported in Web Viewer. Other textures formats will appear black |
No Textures | Do not include textures in layer objects. |
Individual layer settings
Layer state settings
Backdrop | Layer will not appear in layer pane, is always visible. |
Visible | Layer appears in layer pane and can be set visible or hidden. Initial state is visible. |
Hidden | Layer appears in layer pane and can be set visible or hidden. Initial state is hidden. |
Interaction settings
Scene settings | Use Global option set in Object Interaction in first export dialog page. |
Locked | Objects in this layer will not be selectable. All objects are combined to a single entity. Therefore locked layers contain a way smaller object count than pickable layers, which can often improve performance in the Web Viewer. As all objects are combined, per-object metadata can not be written (No Metadata option only). |
Pickable | Objects in this layer will be selectable, all objects are exported as single entities (features). High object count in a layer can decrease performance, it is therefore recommended to only set layers to pickable where required. |
Metadata settings
Scene settings | Use Global option set in Object Metadata in first export dialog page. |
All | Write both object attributes and reports to object metadata. |
Attributes | Write object attributes to object metadata. |
Reports | Write generated report data to object metadata. |
None | Do not include object attributes nor report data. |
Texture Quality
Scene settings | Use Global option set in Textures in first export dialog page |
High Quality | Convert all layer RGB textures to JPG with high quality |
Medium Quality | Convert all layer RGB textures to JPG with medium quality |
Low Quality | Convert all layer RGB textures to JPG with low quality |
Half Sized | Resize all layer textures by 50%; RGB textures are written as medium quality JPG |
Compact | Resize all layer textures to 50% size but with a maximum of 256x256 pixels; RGB textures are written as low quality JPG |
Note:
In all Texture Quality modes except "Original Textures" the texture size will be limited to 2048 pixels.
Other 3ws export features
Bookmarks defined in a CityEngine scene will be exported directly to a Web Scene, and are available in the bookmarks menu of CityEngine Web Viewer.
Note:
- Different camera angles are not supported at the moment, Web Viewer displays all views and view bookmarks with the default CityEngine angle (54 degrees).
- The current camera position and direction before starting the export is stored to the Web Scene and used as initial view in CityEngine Web Viewer.
The current shadow and ambient occlusion settings of a CityEngine scene are exported to the .3ws file, and are used as initial values in the Web Viewer. Be careful with enabling shadow and ambient occlusion before exporting, as on some machines Web Viewer might not support direct or diffuse shadows, or will get a performance impact.
Note:
As initial settings are stored during export, changing options (such as shadow settings) in Web Scene preview will not change the intial configuration of the Web Scene.
Export tricks and tips
- Due to browser limitations and to ensure compatibility on less powerful systems we recommend to keep Web Scene size (size of .3ws file) below 15MB. Reduce your Web Scene size by
- choose a smaller extent for export (select less objects)
- Use a smaller terrain resolution (512x512 or less). Terrain resolution can be set in Inspector pane of Terrain Layer, Layer Attributes, terrain resolution u and v.
- finetune Texture quality export options (use compact or half-sized)
- or manually convert your textures to lower-resolution JPG or PNG and use texture quality Original
- set export option Interaction to locked where pickability is not required
- reduce the geometric complexity of the models (e.g. lower level of detail, less details on streets).
- By default, terrain geometry is simplified during export. This can take a while for complex terrains. To speed up this process,
- use a smaller terrain resolution (recommended 512x512). Terrain resolution can be set in Inspector pane of Terrain Layer, Layer Attributes, terrain resolution u and v.
- disable Simplify Terrain Meshes in Main export options → Optimizations (not recommended, as this will increase .3ws file size)
- When setting Texture quality to Original Textures, make sure the layer only uses JPG and PNG textures. Other formats are not supported by WebGL, and will appear black in the Web Viewer.
- When preparing Web Scenes for a wider audience, keep in mind that a Web Scene might not run as fluent (or not at all) on other, less powerful systems (less memory, less powerful graphics card). Reduce the exported extent and 3ws file size to ensure wider compatibility.
CityEngine Web Scene Preview
Before publishing a Web Scene, it is a good idea to preview it locally to ensure it contains all the desired data and the layer setup in the exporter options are done correctly.
- Locate your exported Web Scene (the .3ws file) in the CityEngine Navigator (by default Web Scenes are exported to the current project's model folder).
- Double-click on the .3ws file or right-click the .3ws Web Scene file and choose Open With > CityEngine Web Scene Viewer
The Web Viewer opens in your system's default web browser
Preview settings
3D Web Scene Viewer | This option opens CityEngine Web Viewer from ArcGIS Online. An internet connection is therefore required. |
3D Web Scene Viewer (offline) | A local version of CityEngine Web Viewer application is used. No internet connection required. Note that the local viewer might not be as up to date as the online version. |
The preview URL opened in the browser is of the form
http://localhost:61351/ceviewer.html?3dWebScene=/PATH_TO/WEBSCENE.3ws
or
http://localhost:61351/ceviewer_offline.html?3dWebScene=/PATH_TO/WEBSCENE.3ws
for the offline version. The path to webscene.3ws is relative to the CityEngine workspace (web scenes need to exist in the CityEngine workspace to be previewed). A random, varying high port is chosen automatically by CityEngine.
Due to browser security restrictions when loading local files (e.g. the .3ws file) a local webserver is required for the Web Viewer. Starting the Web Viewer with a file protocol (file://...), which happens e.g. when starting the Web Viewer by double-clicking on the viewer.html will therefore not work.
Default browser
When starting the preview Web Viewer application, CityEngine starts the web browser that is set as default browser on the computer. In case you want to preview in a different browser
- change your system's default web browser
- or copy-paste the preview URL to the desired web browser
Misc Preview notes
All initial configuration settings of a Web Scene (e.g. camera position, shadow settings, ...) are done during export. Changes done in Web Scene preview are not stored to the Web Scene, and will not influence the initial configuration.
Upload to ArcGIS Online
- Locate the exported Web Scene in the Navigator.
- Right-click the Web Scene choose Share As...
The CityEngine CityEngine Web Scene Package dialog box appears.
- Click Upload package to my ArcGIS Online account and name your new Web Scene package.
- Fill in the required fields for Item Description.
- Click Analyze to validate your Web Scene for any errors or issues.
You must validate and resolve all errors before you can save it to disk or share it to ArcGIS Online. If any issues are discovered, an error will be reported. You have to fix the error before you can continue.
- Click Share to upload your SLPK to ArcGIS Online.
- Click File > ArcGIS Online and go to My Content to find your Web Scene online for sharing.
Note:
If the Web Scene already exists on the portal, the webscene will be updated with the new version, and will keep the same ID.
Package Web Scene and Viewer to a zip file
Instead of publishing to ArcGIS Online you can create a zip file of Web Scene and Viewer application, which you can manually upload to your own webserver.
- Use the same steps as above but choose Save package to file in the Web Scene package dialog.
- The created zip file contains two folders
- webscenes contains the Web Scene file .3ws
- webviewer contains the Web Viewer application files
Upload to custom server
Copy both folders to your web server. To start the application, point your browser to
http://SERVER.DOMAIN/PATH/TO/WEBVIEWER/viewer.html?3dWebScene=../webscenes/NAME_OF_WEBSCENE.3ws
Once the webviewer application is uploaded and you create additional web scenes, you only need to upload the .3ws files to the webscenes folder and adapt the URL to point to the respective web scenes via the query parameter ?3dWebScene.
Note:
Due to browser security restrictions when loading local files (e.g. the .3ws file) a local webserver is required for the Web Viewer. Starting the Web Viewer with a file protocol (the URL starts with file://...), which happens e.g. when starting the Web Viewer by double-clicking on the viewer.html will therefore not work.