dev.nlited.com

>>

SimpleGrid

<<<< prev
next >>>>

2017-11-25 20:57:04 chip Page 2070 📢 PUBLIC

Nov 22 2017

Direct3D simple grid
My inspiration: Darwinia

First a brief shout-out to Introversion and Darwinia. I really like that game for its visual and aural themes. (Althought it is a bit thin as a game.) Darwinia is especially interesting for anyone starting out in 3D rendering for a couple reasons. It implements a wonderfully intuitive paradigm for navigating 3D space. An expansive 3D world can be rendered with simple polygons and attention to subtle coloring with little or no artwork, it is the allegorical counter to The Talos Principle. Background music can be both simple and integral to mood of the game. For most games, being able to create huge numbers of game objects is more important than detailed renderings. The Darwinia source can be purchased for $45, although I'm not sure how useful to would be to spend time reviewing code from 14 years ago (2004).


Getting Started

Starting from the DirectXTK Game template, I want to derive my own Game project to render a grid with terrain. SimpleGrid with DirectXTK

Lighting

Turning on the lights was like installing a light bulb in a dark house: first tear out the walls and install the wiring. I had to recreate the terrain model, figure out how to calculate vertex normals, create a sun object, mix polygon primitives with geometric shapes, add live user input controls, create a moveable camera, and introduce yaw and pitch. Direct3D Lighting

2D Text

I want to draw flat 2D text onto the window. This turned out to be a bigger task than expected, requiring code to transition between Direct3D resources and Direct2D libraries. Read the gory details here: Direct2D in Direct3D

Terrain Tracking

I want surface objects to move along the terrain. Moving Along the Surface and Terrain Alignment

Custom Object Models

I want to create simple custom models with bitmap textures.

Collisions

I want to fire a projectile from a point, apply ballistic forces over time, and detect when it collides with either my terrain surface or a model's bounding box.

Warps

I want to apply a warp effect to simulate an explosion when the projectile collides with something.

Predefined Models

I want to load a complex 3D model from a file and draw it in my world. Importing Models

Saving Models

The terrain doesn't change once created, it would be much more efficient to store the terrain as a static vertex table in the GPU rather than submitting it as a primitive batch for every frame. {THREAD_LINK:1763}

I want to save my terrain model as a standard model file that can be quickly reloaded later. My model needs to be transformed into triangle strips that can be fed directly into the GPU without running a loop on the CPU.

Mapping

I need to map a 2D mouse position into my 3D model, and a 3D point to a 2D screen position.

Sky

I need an interesting sky. Perhaps replicating the sky from Darwinia or a night sky with stars.



WebV7 (C)2018 nlited | Rendered by tikope in 40.293ms | 3.138.125.86