Wednesday 12 October 2016

Future City: Update 7 - Building a Better Skyscraper

Sorry for the late post, a few mad things going on at the moment.  One of which was the Rocketjump event in Bournemouth which @dannyt of @Moov2 invited me to, to showcase Apparance.  A lovely little event with some great speakers and games to see, where I got to show Apparance to a few more people.


Last week I decided that the stand-in skyscrapers were too dull and not nearly futuristic enough.
Temporary, non-futuristic, skyscrapers.
I was looking for things like these:
The sort of futuristic skyscrapers I was after
(Sources: source 1, source 2, source 3, source 4)


I knew I wanted interesting angular surfaces and chamfering so as a starting point I imported some old hull surface triangulation procedures I made for my spaceship construction experiments.
Ship hull built by connecting triangulated pieces.
The premise behind these is that we can build up large and interesting building hulls out of simpler parts that connect rectangular and angled edges together.  However we also want to make sure we can use shapes that map well to the frame construct used to model within.  Rectangular sections are easy, and right-angled triangles aren't too much of a stretch either.  In most of the cases I wanted these were sufficient to build interesting shapes.
Hull triangulation procedures

Cross Section

To limit the complexity of the models built I decided a cross-sectional form where each side can be in-set and corners chamfered independently would still provide sufficient flexibility to give interesting models.
Example of a skyscraper cross-section (two matching chamfered corners and an inset side)
This information is passed around encoded in Vector3's (like the connectivity information), one for each side, defined as follows:
Side inset/chamfer encoding for skyscraper cross-sections.
This will be used to describe the outline of the building at various elevations, with hull triangulation providing us with frames to build the surface geometry to fit.  The cross section will be mutated at random along the way to make the shape change and evolve as the evaluation proceeds skywards.  The changes we can make are:
  1. Leave it the same - a straight vertical sided section
  2. Chamfer any un-chamfered corners - introduce triangular sections.
  3. Inset un-chamfered sides - introduce slopes and overhangs.
  4. Remove any chamfered corners - return to square corners.
These can be applied in various combinations and quantities, some examples shown here:
Example cross-section mutations
The requirement for this building section triangulation exceeded the original hull construction primitives so I created a new one specifically for this, based on the various techniques employed before.
Diagnostics display for building section surface triangulation

Building It Up

By iteratively segmenting the skyscrapers into sections, potentially mutating the cross-section at each intersection we get all sorts of building shapes.
Example skyscraper shapes

Surface Noise

Initially I filled in the surface spaces with the general purpose smooth gradient rectangle and triangle procedures I had to hand.  These however had consistency problems at their edges.  Even though the sub-division they perform to add detail does maintain coherency internally between new triangles and rectangles, there was no way to maintain this between adjacent instances of the procedures.
Incoherent detailing, particularly noticeable on triangular sections.
A change of approach was needed to fix this; instead of choosing corner variations at random and then using midpoint noise to sub-divide, a simpler approach is turns out is to use the 3D noise distortion algorithm I was already using for landscape and wobbly building experiments.
Experiments with 3D noise mesh distortion
Adding an operator to do single samples in space for this allowed me to use the output to modulate the surface detail.  This had the advantage that the noise function was based in world space and so any two evaluations that happened to be at a coincident vertex, and hence the same position in space, would result in the same modulation effect.  This produced the effect I was after and improved the look of the buildings no-end.
Moving from a mid-point algorithm to world-space noise algorithm for surface detail sub-division.


A quick triangulation hack later and I had the geometry to cap off the buildings too.
Temporary roof tops for the skyscrapers
I will re-visit this later as it will be great to add intermediate roof pieces between building sections so we get stepped in parts and mid-level terracing.  This complicates the roof calculation though as we need to in-fill between two cross-sections, as well as potentially generating railing frames around the perimeters too.


For some extra finesse I also knocked up a 'window' filler for the rectangular sections, giving a much better sense of scale as you 'walk' around them. Oh, and I've been playing with grass for the plaza areas that break up the city space a bit.  Some level of success was obtained, more work to do on that though ;)
Simple surface window detail increases sense of scale

The City

These new buildings, with a bit more tweaking and polish give a very pleasing look to the business district and are far more in-keeping with the direction I was intending the city to go.

Business District, now with added futuristicness
Design choices can alternate up through sections
Bigger and better business buildings

No comments:

Post a Comment