The principle FPS game box perspective

FPS games can be said to have been more popular, typical representatives Counter-Strike, Cross Fire, chicken, etc. Basically as long as the game will have the presence FPS perspective hanging, hanging and perspective also divided into many types, often with D3D perspective, perspective boxes, as well as some of the more high-end graphics perspective, realize the difficulty, box perspective is the most complex in perspective, this experiment will be learning algorithm box perspective and prepare to achieve universal secondary perspective effect .

First, look for the advantages and disadvantages D3D perspective and the perspective of the box it:

D3D Perspective: The principle is attached to the appropriate DirectX graphics library Hook function by way of injection, disable the Z-buffer before drawing, Z-buffer is to tell the camera, or if the person in the back wall of the box, you do not the character model displayed, if the characters in front of the box or wall, he is forced to render and display, usually mounted as DrawIndexedPrimitivethe mapping function to sense the drawing operation, by SetRenderState(D3DRS_ZENABLE, FALSE)modifying the parameters buffering function, perspective effect achieved, since the need to inject the corresponding the course of the game, so it is easy to be detected, need to meet in order to detect over-imaginative.

Box perspective: compared to D3D perspective, the perspective is more old-fashioned box, but the box perspective there is a very big advantage is that without the need to inject any code in the process, all the arguments are by the program algorithm obtained directly by GDI functions to draw graphics on the form, the advantage of this approach is difficult to detect, substantially more generic support any FPS game, but the disadvantage is frequently drawn graphics blinking, because the game refresh rate refresh rate and drawing functions caused by the inconsistency.

To be continued .. . . .

Guess you like

Origin www.cnblogs.com/LyShark/p/11620244.html