Skip to content

andreapassini/DROP

Repository files navigation

DROP

a simple game engine

Setup

This set-up works for Windows x64

1. Download static libraries

Download the directory "dependencies", paste assimp.lib into the project dependencies folder.

https://drive.google.com/drive/folders/1BnptvQUHHxcnXt53LJGVPdqLg2EXvkPA?usp=sharing

2. Generate the vs solutions and projects

  • double click on "scripts\Setup.bat"

Next Big Features Roadmap

  • Vertex Animations for Grass
  • Outline and stencil buffer
  • Collision Detection & Response System
  • Physics simulation for rigid bodies made of particles (rework and how to convert particle pos into transform?)
  • Skeletal animations
  • Cloth simulation (just a rework)
  • Fluid simulation (Look at Doom:DarkAges video https://youtu.be/Ed4vNNQwCDU?si=3qRpfoFei1mSx-Qn)
  • RayMarching for clouds and fog (https://youtu.be/Ed4vNNQwCDU?si=3qRpfoFei1mSx-Qn)
  • Vulkan and renderer rework (winter is coming)

Architecture

DROPArchitecture

Shadows

In order to create shadows we need to put the camera on the light position with the same orientation as the direction of the light. We do a first render pass, without calculating the color, in order to find the surfaces that are hidden by the objects. We do a second render pass, this time we calculate the color of the fragments keeping in consideration also the area obscured by the shadows.

Scene Graph

Implementing the scene graph using a tree. We will store the transform in local coordinates and the cumulated transform in world coordinates. Local transform for the transformations related to the single object. The cumulated one for the scale, orientation and position of the object in world space, to be used by the other components.

Particle System

image

image

image

image

Terrain Streaming System

My Bare Bone Terrain Streaming System.

Pre-requisites

Pre requisite: having a terrain to stream.

Since this is just a toy game engine for the moment, I just generated a pseudo random terrain.

Terrain Setup

  • Divide the scene into grid of cells.
    For this example the grid is a square made of 11x11 cells TerrainSetup

  • Displace the terrain component or starting point to the bottom left of the scene.
    This will simplify the grid management since we will not need to handle row and col with negative numbers TerrainComponentPosition

Terrain Cell or Slice

Each cell is a slice of our terrain with width and length of 10x10. It's made of:

  • plane mesh

  • height map or vertical displacement texture

    This is the part that was pseudo randomly generated It is made of 81 floats (9x9), based on the number of vertices of the mesh we are using. Each pixel represent the vertical displacement applied to a specific mesh vertex.

SliceOfTerrain

Streaming

Streaming

The goal of the Terrain Streaming System is to dynamically load only the necessary displacement maps around the Target/Player.

Detection

Once the Target/Player changes cell, new displacement maps will be required.

TargetPosition

TargetMovingPosition

NewMapsRequested

Response

The map requested are forwarded to the Asset Thread that will read the specific files and fill its response buffer. Once every N loaded maps, the game thread will copy the results into its buffer to be rendered.

TerrainGridDisplacement

GridCalculation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors