Bentley Descartes - Raster Texturing


Raster Texturing

With the growing popularity of virtually representing real city around the world with full 3D models it is very important to be able to easily create photorealistic textures for 3D building. With Bentley Descartes it is possible to create MicroStation texture for 3D building from any raster files supported by MicroStation.

New Approach To Photorealistic Texturing

Until recently the creation of textures for photorealistic model was solely made from small bitmaps repeated over 3D model surfaces. For example, for a wall of a known building the user would create a small bitmap or take a bitmap from some wall texture factory representing most accurately the building wall. For complex wall covered with many different type of materials (e.g. : bricks, vinyl, wood, painted steel, ...) the user would have to create a texture for each of those materials. The visual properties of those materials (e.g : material reflectance) would than have to be correctly tuned to ensure that the virtual materials behave as the real materials under different source of lights.

With the advent of 3D digital camera and positioning system it is now very easy to take real terrestrial photographs of an house, city block or even and whole city from a mobile survey platform (i.e. : car equipped with terrestrial georeference photographic capture system) very fast. With this revolution a new approach for creating photorealistic texture has now emerged; the creation of textures directly from real pictures. The advantages of using real picture for creating photorealistic texture are significant :

Texturing Tools Overview

Descartes offers a set of texturing tools available in the Texture Tools toolbox (Raster Manager->Tools->Texture)  that need to be used during the multisteps texturing process.

The multisteps process summarize in the diagram below starts with a pair of element/raster and  finishes with a texture (i.e. : MicroStation material).

 Dataset provided by Ville de Québec

Selecting Element/Raster Pair(s)

The first step for raster texturing is the selection of one or many element/raster pairs, the element representing some surface of a 3D object that will be textured and the raster representing a real picture which includes some part of the modelized surface, preferably the whole surface.

  • Option Image Buttons : Specify the assign operation to do (respectively new, add or remove).
  • Use Selection Set : Specify that the elements in the selection set should be used as element/raster pair.
  • Process Multiple Areas : Specify that the texturing will be applied to multiple contiguous areas.
  • Raster Source : Specify if the area(s) to texture is present in one or multiple rasters.

 

Productivity Tip : When a surface is composed of multiple elements (e.g. : a rectangular wall modelized by two triangles) use the Process Multiple Areas option to texture both elements in one operation. 

Default Operations in Descartes For One Element/Raster Pair

  1. Select the Assign to Area tool.
  2. Click on the attached raster containing the texture data.
  3. Click on the element representing the surface to texture.
  4. Optionally select other element/raster pairs has required.

Once those operations have been done Descartes has some in-memory list of element/raster pairs.

Texturing Example - Step 1

Here is the first step of a texturing example in which a wall of a 3D church model will be textured using a real picture of the church wall. This step involves the selection of the church picture and the element representing the church wall to texture which are shown below.

Church picture

Dataset provided by Ville de Québec

 

Church 3D model with selected surface to texture

Dataset provided by Ville de Québec

Visual quality tip : If the surface that needs to be drape appears in more than one picture select the picture on which the surface has the best resolution and is the most parallel to the camera objective  plane (e.g. : the picture taken in front of the surface).  

Warp To Area

The warp to area tool is used to rectify the picture to remove any perspective effects and clip the picture to obtain the texture pixels.

Descartes offers two different methods for warping the picture to the area to texture :

Operations Overview

Warping the raster to the associated element(s) required multiple operations which vary depending on the warping method selected.

Dataset provided by Ville de Québec

Selecting The Warping Method

After the raster(s) to warp have been selected it is necessary to choose some options which will determine how the warping will be done and the included operations.

  • Working View : The view in which the warping operations will be done.
  • Crop Source Raster : Specify if some clipping operation should be included before warping the image and which clipping method (Shape or Block) to use.
  • Method : The warping methods (Rectangle or Points).

Rectangle Method Specific Option

  • Raster Is Rectified : When selected the operation of selecting the rectangular feature in the picture will be skipped.

Productivity Tip : If the area to texture appears very small on the raster cropping it will facilitate the specification of the points (Points Method) or the placement of the rectified image (Rectangle Method).

Points Method

The point method is the easiest and most intuitive method to warp the picture to the area of the 3D solid model to be textured. It works by specifying many pairs of image/monument points, a pair representing a relation between a point in the raster and its corresponding modelized representation in the element.

 

 

  • Image Buttons : Four buttons which respectively represent Add Points, Move Image Points, Move Monument Points and Remove Points.
  • Dynamic Transparency : The transparency value of the dynamic raster display during point capture.
  • Keep Area Opaque : Specify if the raster area appearing inside its related element(s) should be opaque or not. The area appearing outside is always transparent.
  • Use Last Option Dialog : Specify if the rectified image file creation properties dialog which is also used by the Merge tool should be displayed or not.

Texturing Example - Step 2 - Warp To Area - Points Method

The point method requires to repeatingly select pair of image/monument points until the raster is correctly warp on the element. In this step the side viewed church wall picture is rectified so that it wrapped on the rectangle element modelizing the wall of the church.

 

Dataset provided by Ville de Québec

 

Selecting More Than 4 Point Pairs

Though that usually 4 point pairs are enough to warp correctly the picture to the element(s) there is no limit on the number of point pairs that can be entered. It is worth noting that the warping transformation uses a projective model to compute the warped raster. Since the projective model requires 4 point pairs to be completely defined, defining more point pairs mean that the projective model is overdefined (i.e. : residuals are not equal to 0) and the projective is thus calculated using a least square algorithm.

Visual Feedback

When entering more than 4 point pairs some residual (e.g. : distance between the pixel point selected and the pixel point mapped to the related element point) will be present. The residual is presented as a dot white line in the view during the point pair capture step as shown below. When the Keep Area Opaque option is selected it is easy to visualize the resulting warped raster compared to the related element, the final warped raster that will be saved to file being opaque while the remaining raster pixels outside the assigned element being transparent.

Dataset provided by Ville de Québec

Rectangle Method

The rectangle method is an alternative to the point method which purpose is to help texturing building when point pairs cannot be easily identified (e.g. : a picture of the mid-section of a sky scraper modeled by a simple rectangular prism). In that case it might still be possible to use a feature in the picture on the surface to texture that is known to be physically rectangular. Indeed, it is well known that object's shape appears usually deformed on a picture (i.e. : circle looks like ellipse, rectangle like irregular quadrilateral) because of the perspective phenomenon. Using properties of the projective transformation it is possible to reconstruct the projective matrix which can convert original picture of the rectangular picture appearing like a irregular quadrilateral to that of an rectified image on which the rectangular feature appears now rectangular.

Texturing Example - Step 2 - Warp To Area - Rectangle Method

The rectangle method is based on placing a quadrilateral on the picture representing a feature that is know to be physically rectangular (e.g. : door, window, etc...). Once the the quadrilateral is defined the picture is warped so that the feature delineated by the quadrilateral is rectangular in the warped picture. Finally the warped picture is modified so that it fits correctly the surface to texture.

Dataset provided by Ville de Québec

Operation 5 Option Dialog

Here is the option dialog available during the operation 5.

  • Image Buttons : Mirror the warped image based on an horizontal or vertical axis respectively. 
  • Dynamic Transparency : The applied transparency to apply to the whole image or the area of the rectified image outside the assigned element(s).
  • Keep Area Opaque :  Specify if the area of the rectified image falling inside the assigned element(s) should be opaque or not.

Operation 6 Option Dialog

Here is the option dialog available during the operation 6.

  • Image Buttons : Select some basic placement tools : move, scale, rotate  and anchor point. Note that the default anchor point is the warped picture anchor point.
  • Dynamic Transparency :  The applied transparency to apply to the whole image or the area of the rectified image outside the assigned element(s).
  • Keep Area Opaque : Specify if the area of the rectified image falling inside the assigned element(s) should appear opaque or not.
  • Use Last Option : Specify if the rectified image file creation properties dialog which is also used by the Merge tool should be displayed or not. 

Create Rectified Image

After the picture has been rectified and warped correctly on the surface to texture the rectified image needs to be saved on disk. The properties (e.g. : resolutions, file type, file name, etc...) of the rectified image file to be created can be selected through the dialog which is also used by the Merge tool.

Stretch Area

The stretch area tool is useful for making small adjustments to the rectified image so that it better fits the modelized surface.

Texturing Example - Step 3 - Stretch To Area

The stretch to area tool works by stretching point on the rectified image to the corner of the assigned element. Note that the destination position must be a point of the assigned element(s).

Dataset provided by Ville de Québec

 

Convert To Advanced Texture

Once the rectified image has been created it needs to be converted to an advanced texture. After converting the rectified image to an advanced texture the rectified image is detached from Raster Manager and a new procedural material similar to DCDrape is (i.e. : the texture data is kept in an external file) added to the material library (i.e. : Added to the material list in the Material Editor dialog).

During the conversion of the rectified image to the advanced texture a stripped down version Merge tool option dialog with only the resolution pane will be displayed to be able to select the resolution of the advanced texture to create.

Editing An Advanced Texture

The difference between an advanced texture and a normal texture is that it is possible to edit the texture with the Descartes editing tool. When an advanced texture is selected for editing its external raster file source is automatically attached to Raster Manager, allowing the editing of the texture as a normal raster attached in Raster Manager.  

Convert To Texture

Once the advanced texture doesn't need to be edited it can be converted to a simple texture that is embedded in the .dgn file. Note that a normal texture cannot be edited with Descartes' tools.

 

  • Transform all : Transform all advanced textures to a  simple   MicroStation textures.
  • Quality : Select the quality of the texture.