DirectX 11 – Waves with Tessellation, Displacement mapping and Normal mapping

Waves from Waves post improved with lighting and normal mapping.

Details on the waves’ surface have been increased by implementing lighting and applying normal mapping on the waves.
Normal vector values are derived from normal map textures which also contain height values for the vertices of the waves that are used for the implementation of displacement mapping(Height mapping).
Light source utilized in the scene is directional light.

Backface culling is disabled.
Uses fixed-axis rotation.

Program file can be downloaded here.

Requirements: DirectX 11 supported graphics card, Windows 7/8/8.1/10/11, Visual C++ Redistributable Packages for Visual Studio 2013(x86).

Control:
Left-click anywhere in the scene then hold left-click and drag the mouse to move the camera around in the scene.
Double-click to toggle between solid and wireframe mode.
Scroll up and down to zoom in and zoom out.

Platform: Windows
Programming Language: C/C++, HLSL

Resources: Normal map and height map textures(normal vector values and height values are combined into the same texture) are from companion DVD of the book 3D Game Programming with DirectX 11 by Frank D. Luna, Mercury Learning.

Texture loading is implemented using DirectX TK library.

DirectX 11 – Waves with Tessellation and Displacement mapping

Waves.

Waves are created by drawing 4 control points and subdivide them with tessellation, new vertices for waves plane are generated.
Displacement mapping is then applied to each generated vertex.
In applying displacement mapping, the height value for each vertex is derived from the height map textures(Height mapping). There are more than one height map textures being used for displacement mapping for the vertices of the waves.
Height values in height map textures can be generated using Wave equation.
Animating the waves is done with transform texture coordinate technique when applying displacement mapping to the vertices of the waves.

Tessellation is talked about in this post.

Back-face culling is disabled.
Uses fixed-axis rotation.

Program file can be downloaded here.

Requirements: DirectX 11 supported graphics card, Windows 7/8/8.1/10/11, Visual C++ Redistributable Packages for Visual Studio 2013(x86).

Control:
Left-click anywhere in the scene then hold left-click and drag the mouse to move the camera around in the scene.
Double-click to toggle between solid and wireframe mode.
Scroll up and down to zoom in and zoom out.

Platform: Windows
Programming Language: C/C++, HLSL

Resources: Height map textures are from companion DVD of the book 3D Game Programming with DirectX 11 by Frank D. Luna, Mercury Learning.

Texture loading is implemented using DirectX TK library.

DirectX 11 – Tessellation

Tessellation implemented in DirectX 11.

This is the same terrain from Terrain post. Colors of the terrain’s surface are now assigned at pixel level instead of using interpolated vertex color.

Tessellation is implemented.
Tessellation level is varied according to the distance of terrain from the camera. The closer the terrain gets to the camera, the more details the terrain becomes.
As shown in the video, the closer the terrain gets to the camera, the more subdivided and more polygons the terrain becomes.

This technique can be used instead of normal distance modeling(Level Of Detail; LOD) technique where low-detail model is used when an object is far from the camera to help improve performance, in a trade-off for the amount of memory required to store different versions of an object model and memory bandwidth needed to load a different model at a different level of detail.

Using Tessellation, the more model gets closer to the camera, the more it gets subdivided to have more polygons, thus increasing the detail of the model. This saves the need of having to keep multiple models with different levels of detail for the same object, saving the amount of memory the system requires and the amount of memory bandwidth required to load a different model at a different level of detail.

The terrain is originally drawn as 4 control points then gets subdivided and new vertices are generated.

Camera can be moved around in the scene.
Back-face culling is disabled.
Uses fixed-axis rotation.

Program file can be downloaded here.

Requirements: DirectX 11 supported graphics card, Windows 7/8/8.1/10/11, Visual C++ Redistributable Packages for Visual Studio 2013(x86).

Control:
Left-click anywhere in the scene then hold left-click and drag the mouse to move the camera around in the scene.
Double-click to toggle between solid and wireframe mode.
Scroll up and down to zoom in and zoom out.

Platform: Windows
Programming Language: C/C++, HLSL

DirectX 11 – Image Postprocessing with Direct Compute – Blur and Bloom

Postprocessing implemented in DirectX 11 using Direct Compute.

Full-screen blurring and light bloom effects are implemented. The scene is rendered into texture only one time in a frame then the texture generated is processed by compute shader to create blur and bloom effect.
The blur technique utilized is Gaussian blur.
There is actually only blur technique implemented. Bloom effect is achieved by manipulating weight values in the blur equation while doing Gaussian blur.

Direct Compute and GPGPU are talked about in this post.

Uses fixed-axis rotation.

Program file can be downloaded here.

Requirements: DirectX 11 supported graphics card, Windows 7/8/8.1/10/11, Visual C++ Redistributable Packages for Visual Studio 2013(x86).

Control:
Left-click anywhere in the scene then hold left-click and drag the mouse to rotate the object.

Platform: Windows
Programming Language: C/C++, HLSL

Resources: Fire animation textures(as separate image files, not texture atlas) are from companion DVD of the book 3D Game Programming with DirectX 11 by Frank D. Luna, Mercury Learning.

Texture loading is implemented using DirectX TK library.

DirectX 11 – Image Postprocessing with Direct Compute – Blur

Postprocessing implemented in DirectX 11 using Direct Compute.

Full-screen blurring is implemented.
In comparison to normal image postprocessing techniques where the scene has to be rendered into texture and postprocess the generated texture. Then the postprocessed texture might get rendered into texture and postprocess, again and again, several times in a frame depending on the postprocessing techniques required. Using Direct Compute, the scene can be rendered into texture only one time in a frame. Then the texture generated can be processed by compute shader to create the desired postprocessing effects.
Postprocessing technique, blur, is implemented using Gaussian blur.

Direct Compute is an API, a part of DirectX that is used to perform calculations on GPU.
The process of calculating data on GPU can be referred to as General-Purpose computing on Graphics Processing Units, abbreviated as GPGPU.
The calculation does not have to involve graphics. Many calculations benefit from the parallel processing of GPU such as calculations in scientific fields.
Direct Compute operates on the use of compute shader. There are other APIs for GPGPU such as compute shader in OpenGL, OpenCL, NVIDIA CUDA, and AMD STREAM.

Uses fixed-axis rotation.

Program file can be downloaded here.

Requirements: DirectX 11 supported graphics card, Windows 7/8/8.1/10/11, Visual C++ Redistributable Packages for Visual Studio 2013(x86).

Control:
Left-click anywhere in the scene then hold left-click and drag the mouse to rotate the object.

Platform: Windows
Programming Language: C/C++, HLSL

Resources: Fire animation textures(as separate image files, not texture atlas) are from companion DVD of the book 3D Game Programming with DirectX 11 by Frank D. Luna, Mercury Learning.

Texture loading is implemented using DirectX TK library.