Synthesizing Patches using Vertex Shaders

Home | Up | Search | X-Zone News | Services | Book Support | Links | Feedback | Smalltalk MT | The Scrapyard | FAQ | Technical Articles

 

Written by Robert Dunlop
Microsoft DirectX MVP

< Previous: Page 4

Page 5

 

The Demo Application

The methods illustrated in this article are provided in a downloadable demo, including source code and a compiled executable.  DirectX 8.0 or higher is required to operate the demo.

Download Demo

Potential Improvements

 

    Texture mapping

 

    Variable LOD

While the method demonstrated here uses a static LOD, it is conceivable that it could be adapted to a support variable LOD through subdivision of quad patches.  To do so, the vertex shader would be modified to take input parameters specifying the scaling and translation of the sub-patch to be rendered.  For example, to break a quad into four quadrants, the vertex buffer would be rendered four times with a scale of (0.5,0.5) and translations of (0.0,0.0), (0.5,0.0), (0.0,0.5), and (0.5,0.5).

Additionally, provisions would have to be made to prevent seams between quads of differing LOD.  One approach would be to generate several different patch meshes that facilitate stitching of patches together along the seams.

    Per Vertex Lighting

 

    Dynamic Scene Management

 

    Morphing

 

 

< Previous: Page 4

Page 5

 

Downloadable demo for this article
landshader.zip

Table of Contents

Page 1

Page 2 Page 3

Introduction

Streamlining the calculations Computing Vertex Position

Catmull-Rom Splines

Using Vertex Shaders to Render Patches Computing Vertex Color

Surface Representation with Splines

Storage of Common Quad Data

The Completed Vertex Shader
Page 4 Page 5
Setting Up the Landscape The Demo Application
Measuring Height at Arbitrary Locations Potential Improvements
Rendering the Landscape  

This site, created by DirectX MVP Robert Dunlop and aided by the work of other volunteers, provides a free on-line resource for DirectX programmers.

Special thanks to WWW.MVPS.ORG, for providing a permanent home for this site.

Visitors Since 1/1/2000: Hit Counter
Last updated: 07/26/05.