Skip to content

Latest commit

 

History

History
148 lines (110 loc) · 6.76 KB

WickedEngine-Documentation.md

File metadata and controls

148 lines (110 loc) · 6.76 KB

WickedEngine Documentation (work in progress)

High Level Interface

The high level interface consists of classes that allow for extending the engine with custom functionality. This is usually done by overriding the classes.

  • MainComponent
    • This is the main runtime component that has the Run() function. It should be included in the application entry point while calling Run() in an infinite loop
    • It has a SetWindow function that expects a platform specific window handle. It is necessary to call SetWindow() before calling Run()
    • Once Run() is called in a loop, it will perform Initialize(), Update(), FixedUpdate(), Render(), Compose() functions.
    • ActivatePath() will activate a render path and optionally fade the screen to transition between them. Refer to RenderPath for additional details.
    • Refer to the order of execution diagram below for an overview:

Order of execution: OrderOfExecution
(Diagram generated with draw.io)

  • RenderPath

    • This is an empty base class that can be activated with a MainComponent. It calls its Start(), Update(), FixedUpdate(), Render(), Compose(), Stop() functions as needed. Override this to perform custom gameplay or rendering logic.
    • It has several ready to use variants, such as RenderPath2D, RenderPath3D_Deferred, LoadingScreen, etc.
  • RenderPath2D

    • Capable of handling 2D rendering to offscreen buffer in Render() function, or just the screen in Compose() function.
    • It has some functionality to render wiSprite and wiFont onto rendering layers
  • RenderPath3D

    • By itself, it only does everything that RenderPath2D can do.
    • It must be specialized for a specific 3D rendering algorithm, such as RenderPath3D_Deferred, Forward, TiledForward, etc.
  • RenderPath3D_Forward

    • Implements simple Forward rendering. It uses few render targets, but not very efficient with many lights
  • RenderPath3D_Defered

    • Implements old school Deferred rendering. It uses many render target, capable of advanced post processing effects, and good to render many lights.
  • RenderPath3D_TiledForward

    • Implements an advanced method of Forward rendering to be able to render many lights efficiently. It uses few render targets, so memory efficient.
  • RenderPath3D_TiledDeferred

    • Implements and advanced method of Deferred rendering to be able to render many lights with reduced memory bandwidth requirements.
  • RenderPath3D_PathTracing

    • Implements a compute shader based path tracing solution. In a static scene, the rendering will converge to ground truth.

System

You can find out more about the Entity-Component system and other engine-level systems under ENGINE/System filter in the solution.

  • wiECS

    • This is the core entity-component relationship handler class: ComponentManager
    • Entity is a number, it can reference any number of different components through ComponentManager containers
    • Component is not defined, it can be any data, that is stored inside a ComponentManager along entities
  • wiSceneSystem

    • This contains Scene, a class that is responsible of holding and managing everything in the world
    • There are also all of the Component types, like TransformComponent, MeshComponent, etc.
    • There are a number of systems here that can operate on collections of components
  • wiJobSystem

    • Manages the execution of concurrent tasks
    • context type defines a single workload that can be synchronized
    • Execute() function will schedule a task for execution on a separate thread for a given workload
    • Dispatch() function will schedule a task for execution on multiple parallel threads for a given workload
    • Wait() function will block until all jobs have finished for a given workload. The current thread starts working on any work left to be finished.
  • wiInitializer

    • Initializes all engine systems either in a blocking or an asynchronous way
  • wiWindowRegistration

    • This is a platform specific utility to manage the native display window

Physics

You can find the physics system related functionality under ENGINE/Physics filter in the solution. It uses the entity-component system to perform updating all physics components in the world.

  • wiPhysicsEngine_Bullet
    • Bullet physics engine library implementation of the physics update system

Graphics

You can find the Graphics related classes un der ENGINE/Graphics filter in the solution. The most notable classes are the folowing:

  • wiRenderer

    • This is a collection of functions that facilitate an engine-level rendering logic, like DrawScene, DrawLights, etc...
  • wiImage

    • This can render images to the screen
  • wiFont

    • This can render fonts to the screen
  • wiGraphicsDevice

    • This is the interface for the graphics API abstraction. It is higher level than a graphics API, but these are the lowest level of rendering commands the engine offers.
    • See wiGraphicsDevice_DX11 for DirectX11 rendering interface
    • See wiGraphicsDevice_DX12 for DirectX12 rendering interface (experiemntal)
    • See wiGraphicsDevice_Vulkan for Vulkan rendering interface (experimental)
  • There are many other classes that you can find here, such as wiEmittedParticle, to render emitter components.

The following quick reference shows an overview of common resource formats and spaces:

InformationSheet

Audio

Handles audio playback and spatial audio.

  • wiAudio
    • The namespace that is a collection of audio related functionality
  • Sound
    • Represents a sound file in memory. Load a sound file via wiAudio interface.
  • SoundInstance
    • An instance of a sound file that can be played and controlled in various ways through the wiAudio interface.
  • SoundInstance3D
    • This structure describes a relation between listener and sound emitter in 3D space. Used together with a SoundInstance in wiAudio::Update3D() function

Helpers

A collection of engine-level helper classes

  • wiArchive
    • This is used for serializing binary data to disk or memory
  • wiHelper
    • Many helper utility functions, like screenshot, readfile, messagebox, splitpath, sleep, etc...
  • wiMath
    • Math related helper functions, like lerp, triangleArea, HueToRGB, etc...
  • wiProfiler
    • A timer utility that can measure CPU and GPU timings and used across the engine
  • wiRandom
    • random number generator
  • ...

Input

The input interface can be found here

  • wiInputManager
    • This manages all inputs
    • There are several functions, such as down(), press(), etc. to check button states.

Network

Handles network communication features.

Scripting

This is the place for the Lua scipt interface. The systems that are bound to Lua have the name of the system prefixed by _BindLua.

  • wiLua
    • The Lua scripting interface

Tools

This is the place for tools that use engine-level systems

  • wiBackLog
    • Used to log any messages by any system, from any thread. It can draw itself to the screen. It can execute Lua scripts.