Skip to content

This repository contains a number of Unity-based PCG scenarios, including terrain, plants, meshes, and boids simulation.

License

Notifications You must be signed in to change notification settings

Jiay1C/PCG-Unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Procedural Content Generation Showcase

This Unity project combines four procedural content generation systems into one comprehensive showcase. The individual systems are integrated into four different scenes and one main scene that brings them all together. Below is a detailed breakdown of the features and setup of each system.

Base on Unity 2022.3.43f1

MainScene.mp4

Features

Project 1 - Terrain

Terrain

  • LOD-Based Terrain System: Dynamically generates and removes terrain as needed, optimizing performance.
  • Rain System: Randomly spawns objects within the player's area to simulate rain.
  • Camera Modes: Switch seamlessly between first-person and fly cameras using the 'F' key.
  • Customization: Fully customizable system configurations are available via the Unity Editor.

Project 2 - Plants

Plants

  • Dynamic Foliage Integration: Fully integrated with the terrain system, trees are generated dynamically during runtime.
  • Bezier Curve-Based Trees: Tree branches and leaves are generated using Bezier curves, allowing branches to bend and leaves to vary in shape.
  • Configurable Tree Styles: Tree styles can be defined through configuration files.
  • Seed-Based Generation: Identical trees can be generated by using the same random seed.
  • UV-Mapped Trunks: Trunk geometry includes UV information for texture mapping.

Configuration Files

  • Configs/BushConfig.asset: Defines the structure of tree branches.
  • Configs/LeafConfig.asset: Defines the appearance of tree leaves.

Project 3 - Implicit Surface

ImplicitSurface

  • Marching Cube Algorithm: Generates 3D objects based on implicit surfaces, such as a helicopter, using the Marching Cube algorithm.
  • Real-time Animation: Applied to various components of the generated objects.
  • Interactive Tool: A real-time tool allows modeling of implicit surface objects.
  • Geometry with UV Mapping: Implicit surface geometry includes UV information for texture mapping.

Note: Due to the high-precision marching cube grid, there may be a 1-2 minute delay at runtime for geometry generation to complete.


Project 4 - Boids Simulation

BoidsSimultation.mp4
  • Flocking Simulation: Simulates flocking behavior with procedural object generation, utilizing the implicit surface model from Project 3.
  • Fully Configurable: The simulation can be fully configured through configuration files, with real-time changes applied.
  • Object Trails: Trails behind flocking objects can be rendered and toggled via configuration.
  • Dynamic Object Count: The number of flocking objects can be adjusted in real time.
  • Force Configuration: Each flocking force (e.g., separation, alignment) can be enabled or disabled through the configuration.
  • Random Reset: Press the 'Space' key to reset the position and orientation of the objects to random values.

Configuration Files

  • Assets/Configs/FlockConfigDemo: Customizes flocking behavior in "Scenes/Project 4".
  • Assets/Configs/FlockConfigMain: Customizes flocking behavior in "Scenes/Main Scene".

Controls

  • Move Camera: Use 'W''A''S''D' to move forward, left, backward, and right.
  • Switch Between Camera Modes: Press the 'F' key to toggle between first-person and fly camera modes.
  • Change Settings: Use the Unity Inspector to modify values in configuration files (e.g., bush style, leaf shape, tree seed).
  • Reset Objects: Press 'Space' to randomly reset the position and orientation of flocking objects in the Boids simulation.

About

This repository contains a number of Unity-based PCG scenarios, including terrain, plants, meshes, and boids simulation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published