procedural modeling n.
Skip this Video
Loading SlideShow in 5 Seconds..
Procedural Modeling PowerPoint Presentation
Download Presentation
Procedural Modeling

Procedural Modeling

362 Views Download Presentation
Download Presentation

Procedural Modeling

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Procedural Modeling Slides for DDM by Marc van Kreveld

  2. Procedural modeling • Creating 3D models from a set of rules • L-systems • Fractals • Generative modeling • Procedural modeling gives procedural content • Procedural modeling uses • many parameters that can be set • often randomness

  3. Procedural modeling • Cheaper and faster than manual construction, especially when many similar models are needed • Possible to generate • the geometry • the texture • the placement of the model in a scene • whole scenes (e.g. urban: street pattern, buildings, trees, …)

  4. Procedural modeling

  5. Procedural modeling

  6. Procedural modeling

  7. Procedural modeling

  8. Procedural modeling

  9. Procedural modeling

  10. Procedural modeling

  11. Procedural modeling

  12. Procedural modeling

  13. Procedural modeling

  14. Procedural modeling

  15. Procedural modeling

  16. Procedural terrain modeling • Oldest, best known, for height maps: midpoint displacement algorithm • New vertices get an elevation that is the interpolation of its neighbors, +/- some random term

  17. Procedural terrain modeling • The random term decreases in every iteration, other-wise the terrain gets more and more steep/rugged • Ruggedness can beglobally controlled bythe standard deviationof the random term

  18. Procedural terrain modeling • Looks good, but is not natural: • symmetric with respect to high and low, but real terrains are not • real terrains are formed by erosion from wind, rain, water flow, … • ridges and valleys are not realistic • Possible solutions: • apply wind and rain erosion models to the generated terrain • compute where rivulets/rivers would form based on local gradient and apply river erosion models

  19. Procedural terrain modeling • Overhangs and cliffs are not supported • No global user control

  20. Procedural terrain modeling • A similar approach can be used for coastlines, but there are different coastline types • Constraints are needed to ensure that the coastline does not self-intersect

  21. Procedural terrain modeling • For rivers, one must be aware that rivers and terrain height cannot be generated independently • generate a height map and determine where the rivers are • generate a river network and compute a consistent height map • with little height influence, meandering must be modeled • River deltas, waterfalls, cascades, …

  22. Procedural urban modeling • For urban environments: • start with generating a dense road network • partition the resulting blocks into lots • (a) use the lots as building footprints and raise them to random heights (skyscrapers, office buildings), or(b) place a building footprint of a house on the lot and generate the house by some scheme • extrusion plus roof generation • L-system or other grammar

  23. Procedural urban modeling

  24. Procedural urban modeling

  25. Procedural urban modeling

  26. Procedural urban modeling

  27. L-systems • Named after Aristid Lindenmayer • Parallel grammar: every non-terminal symbol is rewritten simultaneously to get the next object • Models the growth of plants • Typically self-similar at different scales (like fractals)

  28. Grammar G = (V, , P) where V is a set of symbols (terminals or non-terminals)  is a symbol or sequence of symbols that is the start P is a set of production rules (rewriting rules)Symbols that do not occur on the left-hand side of a production rule are terminals (constants) L-systems, definition

  29. Algae: Variables: A B Start: A Rules: A  AB , B  A Start: A 1st generation: AB 2nd generation: ABA 3rd generation: ABAAB 4th Generation: ABAABABA 5th Generation: ABAABABAABAAB L-systems, example 1 Intuition: - A is mature and spawns a young (B), but also stays- It takes young B one generation to mature (become A)

  30. L-systems, example 1 A A B A B A A B A A B A B A A B A B A tree L-system

  31. Non-deterministic version of algae: Variables: A B C Start: A Rules: A  AB , B  A , B  C , C  A Start: A 1st generation: AB 2nd generation: ABA or ABC 3rd generation: ABAAB or ABCAB or ABAA or ABCA 4th generation: … L-systems, example 2 Intuition: - It takes B one or two generations to mature

  32. A tree can be written using brackets [ and ] that enclose branches L-systems, bracket notation subbranch branch H F branch I E G D AB[CD[F]E]G[I]H C B A

  33. L-systems, example 3 • Simple tree: • Variable: S • Start: S • Rule: S  S[S]S[S]S • Start: S • 1st generation: S[S]S[S]S • 2nd generation: S[S]S[S]S[S[S]S[S]S]S[S]S[S]S[S[S]S[S]S]S[S]S[S]S

  34. L-systems, example 3 • We can interpret the generated strings as drawing instructions like in Turtle Graphics: • S : draw line segment • [ : rotate by 45 degrees • ] : rotate by -45 degrees and use the state from before the matching [ • S[S]S[S]S

  35. L-systems, example 3 • S[S]S[S]S[S[S]S[S]S]S[S]S[S]S[S[S]S[S]S]S[S]S[S]S

  36. L-systems, example 4 • Another tree: • Variables: A, S • Start: A • Rules: A  S[A]S[A]A , S  SS • Start: A • 1st generation: S[A]S[A]A • 2nd generation: SS[S[A]S[A]A]SS[S[A]S[A]A]S[A]S[A]A

  37. L-systems, example 4 • Example of subapical growth mechanism: • new branches are created at apices (A) only • stems (S) only become longer Question: How quickly do stems get longer? How can we change this in the grammar so that stems get only one unit longer per generation?

  38. L-systems, control mechanisms • Lineage: transfer of genetic information from an ancestor cell to its descendant cells • Interactive: information (or nutrients) is exchanged between neighboring cells • Lineage corresponds to context-free L-systems • Interaction corresponds to context-sensitive L-systems

  39. L-systems, context-sensitivity • Context-sensitive L-systems have production rules with not just a single variable on the left side • A<B>CD  … is a production rule to rewrite B if it is preceded by A and succeeded by CD • If a context-sensitive production rule can be applied and also a context-free rule, the context-sensitive one takes precedence

  40. L-systems, context-sensitivity • With brackets it gets complicated:a production rule BC<S>G[H]M  … can be applied to the string ABC[DE][SG[HI[JK]L]MNO] because bracketed parts to the right may be skipped/ignored ABC[DE][SG[HI[JK]L]MNO] E J D B A C I H S K L G M N O

  41. L-systems, example 5 • Context-sensitive L-system: • Start: J [ I ] I [ I ] I [ I ] I • Rule: J < I  J • Models a signal from the root upwards to the apices I I I J I I I J I I J J I I J J I J J J I J J J J J J J

  42. L-systems, example 5 • Context-sensitive L-system: • Start: I [ I ] I [ I ] I [ I ] J • Rule: I > J  J • Models a signal from an apex downwards to the root J J J J I I I I I J J J I I I I I I J J I I I I I I I J

  43. L-systems, signals • Example where the root structure and branch structure develop simultaneously (top) • Same L-system but starting with a severed branch

  44. L-systems, geometry • Branching as given by production rules is topological; no coordinates are involved yet • We add symbols in the production rules that steer the process, they are ignored when applying rules • The symbol “[” pushes a situation onto a stack, the symbol “]” recovers it (meaning: the branch has been drawn; continue with the stem)

  45. L-systems, examples 3a and 3b Example: + rotates by +45 degrees, - by -45 degrees, variable S moves forward a fixed distance and draws Recall the rule S  S[S]S[S]S S  S[+S]S[+S]S S  S[-S]S[+S]S

  46. L-systems, example 6 • Grassy plant: • Variables: X F • Start: X • Rules: X  F-[[X]+X]+F[+FX]-X , F  FF • + uses an angle of 25°; - uses an angle of -25°;F draws; X does not 6th generation

  47. L-systems, 3D models • The drawing state in 3D requires a position and a yaw, pitch and roll • In 2D we had 2 rotation symbols, in 3D we need 6 • The symbol “[” pushes a state with position, yaw, pitch and roll onto a stack, the symbol “]” recovers it

  48. L-systems, appearance • More symbols can be used to control color, and increase/decrease edge length and edge thickness color length thickness

  49. Extensions to L-systems • Stochastic L-systems: • A rule is applied with a certain probability in every generation • When multiple rules can be used for the same symbol, we can assign relative probabilities describing which one to apply (cp. non-deterministic L-systems) • Example: • Variable: A • Start: A • Rules: A(0.6)  A[+A][-A]A , A(0.4)  AA full sparse