Tutorials to .com

Tutorials to .com » Software » Game-developer » Shaders and effects - high-level shading language 1.0 Introduction. Doc

Shaders and effects - high-level shading language 1.0 Introduction. Doc

Print View , by: iSee ,Total views: 9 ,Word Count: 686 ,Date: Thu, 28 May 2009 Time: 9:45 AM

The first chapter is devoted to high-level shading language

Read this article indicates that you have agreed to the statement at the end


In this chapter, we will describe the high-level vertex shader language (High-Level Shading Language, referred to as HLSL), we use it to prepare the following three chapters of the vertex and pixel shader. In short, vertex and pixel shader is the preparation of graphics card in the GPU (graphics processing unit) on the implementation of a small custom program that replaces the part of fixed-function pipeline. By using our custom shaders to replace fixed-function pipeline process of a component, we obtained the graphics to achieve the greatest degree of freedom. We are no longer subject to pre-defined "fixed" operation.

Procedures for the preparation of shader, we need a language to prepare them. In DirectX 8.x, the coloring used in the compilation of low-level shader language. Fortunately, we no longer need to compile shader languages, since DirectX 9 has been high-level shader language support, we can use it to prepare shader. The use of assembly language in the HLSL shader on the preparation procedures can benefit from the high-level language like c + +, like its way beyond the assembly language to write applications, that is to say:

n an increase of productivity - with high-level language programming than with low-level language faster and more easily. We can focus more time on algorithms rather than on the coding.

n improve the readability - high-level language program easier to read, which means that high-level language to write the procedure easier to debug and maintain.

n compiler, from time to time, will generate more efficient than hand-written compilation of assembly code.

n the use of HLSL compiler, we can compile the code available for any version of the shaders; the use of assembly language, we may need to code for a specific version of transplantation.

And C++ also HLSL or C + + syntax is similar, thus shortening the learning curve.

Finally, if the graphics card does not support vertex shader and pixel shader, you have to process for example shader equipment to switch to the REF.

Note: pixel shaders can be used for software simulation software vertex processing (software vertex processing) - D3DCREATE_SOFTWARE_VERTEX-PROCESSING.


n learn how to prepare and compile HLSL shader program

n learn how to in the application and the shader program for exchanging data between

n to become familiar with HLSL syntax, type and built-in function

[Statement]: In this paper, Frank Luna translated from the "Introduction to 3D Game Programming with DirectX 9.0", limited to the level translator, the text of the inevitable mistakes, criticism welcome all friends; this article only for the exchange of learning and reference purposes, shall not be used in any form of commercial use; For reprint take prior consent of the author and the translator's consent, to maintain the integrity of the article, and indicate the author, translator and the source, who violate the terms of the consequences of the above, the translator of this no responsibility. My email address is Raymond_King123@hotmail.com, welcome the love of 3D graphics and games, and graphics programming experience in a certain friend a letter from the exchange.

Game Developer Tutorial Articles

Can't Find What You're Looking For?

Rating: Not yet rated


No comments posted.