BuildingProceduralGeneration
From OpenCity
BuildingProceduralGenerationOverview
Contents |
[edit]
Goal
Build a procedural building generator.
[edit]
Input
A limited set of parameter:
- a rectangular ground shape: width an height
- a seed
- an architectural style
- a game level (inhabitants or workers)
And data:
- grammar rules
- basic shape
- basic textures tiles
[edit]
Ouput
- Shapes with texture
- LOD information
[edit]
Postprocessing
Result model need be used in realtime render:
- remerge shape and texture when possible
[edit]
Concept
[edit]
Shape grammar
Axiome:
- foot-print
- mass model
Set of rules classed by priority. Apply rules if no rules of lower priority match. Priority set can be used to determine LOD.
- Shape: symbol, geometry, attributes (position and size aka scope), and terminal or non-terminal symbol
- Rules: replace (children) a non terminal shape by others, condition, probability
Rule operations (relative to mother shape):
- Translation T(x,y,z)
- Rotation R(x,y,z)
- Set Scope size S(w,h,l)
- Push and Pop scope contexte [ ]
- Instantiate Primitive (box, cylinder, etc) I(box)
- Split by axis Split(axis,[part size (absolute or relative) and symbol])
- Repeat by axis Tile(axis, part size and symbol)
- Component by split type Component(splitType, symbol)
- Roof Roof(roof type, angle)
- Empty
Function:
- current scope size Socpe.[w|y|z]
- +-*/
- random
[edit]
Contextual Shape grammar
[edit]
Condition for apply rules
- Occlusion test of current shape agains other Occlusion(agains all|leafs|all excepts parents, [distance]), returns none, partial or full
- Visibility (sightlines) test point of view (as street) Visible(placeType)
[edit]
Spapping
Adapt rule to embded snap plane:
- Split: allow addition of snap planes betwen generated part Snap(axis)
- Repeat: allow addition of snap planes betwen generated part Snap(axis)
Affect Split and Repeat operations if crossed by snap
- Split: snap closest split axis
- Repeat: cut into two parts around snap and compute repeat on parts
[edit]
Building generation
Applying grammar to produce tree of shapes. Only leafs are part of final model. Each tree node is contextual, have 3d matix situation.
[edit]

