Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Direct3D Rendering Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
Direct3D Rendering Cookbook

Direct3D Rendering Cookbook

4.1 (10)
close
close
Direct3D Rendering Cookbook

Direct3D Rendering Cookbook

4.1 (10)

Overview of this book

Table of Contents (19 chapters)
close
close
Direct3D Rendering Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1
Further Reading
2
Index

Preparing the vertex shader and buffers for tessellation


In this recipe, we will update the constant buffers to accept the tessellation parameters, and update the vertex shader to output a structure for input into the hull shaders in the next few recipes in this chapter.

Getting ready

For this recipe, we can begin with any Direct3D project with an existing vertex shader, the PerObject and PerFrame constant buffers, and their C# counterparts in ConstantBuffers.cs.

The completed source code for this recipe can be found within the Ch05_01TessellationPrimitives project, contained within the companion source code.

How to do it…

We will first update our HLSL (High-level Shader Language) and C# structures, and then make a new vertex shader to use with the tessellation pipeline.

  1. Update the PerObject constant buffer within Common.hlsl to include the following property:

    // Matrix to take world coordinates to view/projection
    // Used in the domain shader
    float4x4 ViewProjection;

    Note

    As mentioned in the recipe...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Direct3D Rendering Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon