⬆️ ⬇️

Visual Studio vNext for game developer

In this article I would like to talk about some of the innovations in the Visual Studio 11 Developer Preview concerning the development of DirectX-applications.







Directx



No one will be surprised by the fact that video games today are a huge industry and much of them are based on DirectX technology. In Visual Studio 11, we seriously worked to make the development of such games easier, more convenient and faster. The main emphasis was placed on the following three things: shaders, resources, debugging.



Shaders



A shader is a piece of code that runs on a GPU (for example, to calculate an effect). When using DirectX, shaders are usually written in HLSL (high-level shader language). Visual Studio 11 includes several enhancements for HLSL — from writing and compiling to highlighting and formatting code:

')





In addition to the ability to write code manually, the developer now has the opportunity to use a visual tool that allows you to create effects graphically, without having to write code. It is very convenient - you can experiment and see what happens at each step. Here, for example, is a simple example of a shader that takes two constant colors and connects them together:







Further, Visual Studio allows you to export this graph to HLSL:







You can create quite complex effects in this editor, which also has a real-time mode, allowing you to observe effects that change over time. Here is an example that our development team uses as a test case. Unfortunately, the screenshot does not transmit this, but many of the nodes in this graph contain animation:







Resources



One of the main features of game development is a large number of resources that are not embedded directly in the code. Historically, it was often not very convenient for a programmer to work with these files. If he wanted to view / correct some kind of texture or model, he had to launch completely different tools (or even involve a designer). Now with Visual Studio 11, many of these resources (for example, .FBX 3D models or .DDS textures) can be viewed and edited directly in the IDE. Although Visual Studio is still not a complete tool for creating such resources, its new tools still save time on some simple operations.







Debugging



When developing DirectX applications, traditional CPU-oriented debuggers are often inefficient, because developers need to trace the operation of the GPU, rather than the processor. For example, you may need to understand why some parts of the scene are not visible, or why a particular pixel has the wrong color. Visual Studio 11 offers a whole range of tools to debug similar bugs in code that uses DirectX. Among them, it is worth noting the means of capturing frames, getting the history of all commands sent by the GPU, viewing all the events that affected the rendering process of each individual pixel, etc.



You can learn more about these debugging tools from the Visual C ++ blog .







As a conclusion, we can say that Visual Studio 11 offers the game developer a decent amount of new useful tools and they are worth taking a look at.

Source: https://habr.com/ru/post/137515/



All Articles