I think this question should have something to do with compilation .... Some people may think that the importance of assembly is very low when learning games, especially when there are so many advanced languages... Error... Why is it wrong? Look for a book .. Click here... Read this articleArticleIt should be a bit of a compilation basis, just compile it yourself
In the early stages of GPU-programmable real-time rendering, before HLSL and CG languages appeared, GPU-based rendering was performed in a language similar to the ASM of assembly, which is difficult to get started, however, like an assembly language, it is more efficient than an advanced rendering language for the same reason, because the advanced language requires compilation. Let's take two minutes to briefly introduce the basic syntax and functions of vertex and pixel ASM language.
If you ask why you want to learn it, it is no harm for me to use one more course. Then I will tell you, because it used to be in this language, in addition, some people prefer this method, so many GPU programming books on the market are written Using ASM to find out how long it will not take, if you have learned the assembly, you can scan it. If you don't read it, you may miss a lot of wonderful things. Topic (I found that talking nonsense before the topic will make me a pleasure .... Khan ):
The first is the input and output of the vertex shader, that is, the overall architecture,
The following is a brief explanation. The vertex shader runs each vertex once. The main input is vertex. The registers include the input registers and output registers. The input registers include
An address register A0 is a special register that can index constants. Specifically, it sets the address register as the index value when processing each vertex, you can use the appropriate constants. A lot of people may not understand this, but it is actually very simple. When I use an instance, I will understand it at a glance.
12 temporary read/write registers R0 ~ R11 is a register used to store data in complex computing processes. Note that the registers and vertex color finder are not consecutive.
Constant register C (n), at least 256, which is of the floating point type. It stores four-dimensional vectors and is readable and can be used externally.ProgramWrite, the most common purpose is to set the transformation matrix and other data that affects the vertex.
Vertex element register V0 ~ V16, floating point type, is a four-dimensional vector that is readable and used to input vertex data.
Next is the output register, as follows: opos: The final vertex position after the output transformation, that is, the screen Coordinate
Od1 ~ 2, two color outputs, diffuse reflection and mirror reflection, four-dimensional Vector
Ot1 ~ 8. Texture output registers and four-dimensional Vectors
Ofog, output atomization value, float type
Opts, vertex size, floating point type
Then there are common vertex coloring machine commands. If you do not need to write them, give the figure:
Cut... Why can't all of them be uploaded? Bad blogs, and articles saved as drafts cannot be published. Isn't it because I am too sb to get it ?! Cut ...... BS ..
PS: the figure in this article comes to the "Real Time Rendering tricks and techniques in DirectX" online with an e-book. You can take a look at it. This book is all written in ASM. It's wonderful. Getting started, all the improvements are good... Do it yourself ....
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/gamedevers/archive/2007/08/11/1738618.aspx