Prime Engine

Overview

Project Type: Solo/Team, Engine Modification
Technologies: C++, Lua, Cg (Nvidia)
Span: August 2017 – Present
System Support: Windows 7+, OSX, PS3, PSVita, XBox 360

[Source Code]: Unavailable due to contained proprietary console code

Projects

  1. New character AI behavior (solo)
  2. Frustum culling (solo)
  3. Collision physics with gravity (solo)
  4. Waypoint actions with animations and animation driven motion (3 programmers)
  5. Simulated wind using shaders (solo)
  6. Deferred Shading (2 programmers)
  7. Physically Based Rendering (2 programmers)

1. New Character AI Behavior
The soldier’s idle state was modified to aim at a data-specified target. In this case the target specified was a monster called an Imrod. Waypoint patrolling was changed to be more random and to change between walking and running based on the waypoint selected.

2. Frustum Culling
Oriented bounding boxes are generated at run-time for all static models in the scene, then these are checked for collision with the camera’s frustum to determine visibility. Debug rendering code was added to draw the collision boxes and frustum.

3. Collision Physics with Gravity
An oriented bounding box collider was added to static objects and a spherical collider was added to soldiers. Physics were introduced to the engine through the new PhysicsComponent and PhysicsManager.

4. Waypoint Actions with Animations and Animation Driven Motion
Each waypoint was modified to specify an animation to play while traversing to the next location. To make it look smoother I utilized the animation’s translation to determine the movement speed of the character. Thus, the character’s speed will change as the system blends between animations.

5. Simulated Wind using Shaders
Model data was modified at load time to add an additional set of UV coordinates which specify how much “wind” to apply to each vertex. The vertex shader was then modified to apply a wind force, which was retrieved from a constant buffer. These values were computed from the camera’s look at direction and the forward directions of the two soldiers. Although the effect looks silly, with some tuning it could be used to apply realistic wind to trees.
Note: The severe frame lag is due to recent issues with my computer, the video will be replaced after I get a new one.

6. Deferred Shading
The forward rendering implementation was replaced with a deferred shading model. Rather than immediately drawing to the screen, potentially wasting cycles on lighting equations that do not make it to the final screen, the positions, diffuse color, shadow factor, and normals were stored in intermediate texture buffers. To accomplish this my partner bound multiple render targets using DX12 using one for diffuse, one for normals, and one for position + shadow factor. I modified the shaders to output this data accordingly, and then in the final render pass I used the information stored in these buffers to run the lighting equation. Our implementation allowed us to use 15 lights (7 more than previously) on an outdated integrated GPU at more than 30 fps.

7. Physically Based Rendering
In an effort to improve realism and to remove the need for scene-based texture modification, we moved the engine from the blinn-phong model to the more accurate physically based rendering utilizing BRDFs. For the reflectance term, we utilized GGX geometric and normal distribution functions combined with the Schlick approximation for the Fresnel factor to achieve nice tails. To really showcase the superior realism of PBR, we also implemented a skybox and cube-mapped world reflection, the images for which were generated using a custom tool we implemented in the engine. By utilizing image-based lighting in combination with traditional lighting we were able to create a superior quality image. The demo is capable of running on a relatively old laptop with an integrated GPU at on average above 30fps.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s