Experiences in VR Game Development

Source: Internet
Author: User
Tags pixel coloring

I have been studying VC ++, OpenGL, and DirectX programming for some time (about two years). I have been thinking about it. I hope to summarize it, make a systematic summary of this aspect. Find the problems you still have to learn more clearly.
I always like my summary, but don't write it down. I think there is nothing to write, and I don't know how to write it. But in this way, but I think there are too many concepts that are not very clear.
If you don't talk nonsense, let's take a look at the differences between OpenGL and DirectX. Here are some of the analyses I have found online. I feel that the differences are basically included, so I will put them here, if it starts:
1. direct3d (d3d)
 
Direct 3D is a 3D image API based on Microsoft's Common Object Mode COM (Common Object Mode. It is a 3D API specification established by Microsoft. Microsoft owns the copyright of this library, all its syntax definitions are included in the Help file and source code of the program development component provided by Microsoft. Direct3d is an important part of Microsoft's DirectX SDK Integrated Development Kit. It is suitable for multimedia, entertainment, real-time 3D animation, and other extensive and practical 3D graphics computing. Since its release in 1996, direct3d has been widely recognized for its good hardware compatibility and friendly programming methods, currently, almost all mainstream display cards with 3D graphics acceleration provide good support for direct3d. However, it is also flawed because it is provided in the form of a COM interface, so it is complicated and has poor stability. In addition, it is currently only available on Windows platforms.
 
As one of the components of Microsoft's DirectX technology, Direct 3D is constantly updated with the upgrade of DirectX. At the same time, with the full support of Microsoft, the development of Direct 3D technology is extremely fast. DirectX 7: official support for hardware T & L and DirectX 8: Support for pixel shader vertex shader, DirectX 9: with the programmable vertices and pixel coloring modes of Version 2.0, graphics card hardware vendors are selling points for the latest d3d special effects hardware. Unfortunately, due to platform limitations and other reasons, d3d applications are still mainly concentrated on games and multimedia. In terms of professional and high-end graphics applications, the old 3D API-OpenGL is still the main character.
Of course, DirectX is now available in versions 9 and 10, with improved functionality.
 
OpenGL
The full name of OpenGL is "Open graphics library", that is, "Open graphics program interface", which is a standard application interface of computer industry and is mainly used to define two-dimensional 3D graphics.
OpenGL is a set of underlying 3D graphics APIs. It is called the underlying APIs because it does not provide geometric entities and cannot be used directly to describe the scenario. However, through some conversion programs, you can easily convert the DFX and 3DS model files created by graphic design software such as AutoCAD and 3DS into OpenGL vertex data.
 
OpenGL is a hardware-independent software interface. The graphics software manufacturer no longer needs to develop different software for different models, as long as the operating system uses the OpenGL adapter to achieve the same effect, it is an open graphics library, currently, it can be used in windows, MacOS, OS/2, UNIX/X-Windows, and other systems, and is slightly different only in the window-related sections (system-related, therefore, it has good portability, simple and clear calling methods, and is well received and widely used. OpenGL can work in the Client/Server mode in the network environment and give full play to the power of cluster operations. It is a standard graphics library for professional graphics processing, scientific computing, and other high-end application fields.
 
OpenGL, called SGI, has never been used. It originated from Iris GL developed by SGI for its graphics workstation and developed into OpenGL during cross-platform transplantation. SGI released version July 1992 in 1.0 and became an industrial standard. It was controlled by OpenGL architecture Review Board (ARB), an independent Consortium established in 1992. ARB members such as SGI generate standards by voting and publish the standards in the standard documentation (specification). Software and Hardware vendors develop their own system implementations accordingly. OpenGL can be called only when all tests of ARB specifications are passed. Currently, ARB voting members include SGI, Intel, IBM, NVIDIA, ATI, Microsoft, apple, and other industry groups.
OpenGL has an updated version.
  
Ii. VC ++: C ++ is a programming language (such as C, Java, C #, and so on)
VC ++ is a programming tool and development environment. VC and BCB combine various development tools and provide integrated development environments that are convenient for users;
Many languages are used for virtual 3D development. VC ++ is one of the most popular tools.
There are also VB, C #, vs.net, and so on;
Now let's take a look at the differences between VC ++ 6.0 and vc.net:
1. For Single Programming, VC. NET is much easier than vc6, because the libraries in. NET are rich and there are fewer opportunities to access the underlying layer;
2. VC. Net is a hosting C, hosting C, and hosting programs. There are some differences in the syntax between VC and VC. net .. NET introduces a mechanism, called the standard component language, which is intended to allow any language that supports this mechanism to make completely universal components, that is, they can be used universally. That is to say, the only difference between these languages is just the difference in syntax. For example, C # And VC can also be conveniently used by VB;
3. C # and VB in. Net automatically support the SCL, and you cannot change it. VC is supported by default, but you can change it. In. net, only VC can be programmed in a way that does not support SCL.
4. in. net Framework, we can develop cross-language code based on web or applications. For example, we used MFC, VB, J ++ in VC, there are no general standards between them, and the situation is different now. net Framework.
5. VC ++. the C ++ compiler in. NET is much better than that in VC ++ 6, and is more compliant with the standard, and VC ++. the C ++ standard library in. NET is also rewritten, which is closer to the standard.
6. vc6.0 = C ++ & MFC; and. net is a system platform that provides the common language architecture (CLI) and. net Framework, C ++. net is C ++ based on.. Net class library C ++, the program or DLL made by it can be C #. net, VB. net and so on.. NET language calls each other;
7. c ++. net support. NET development, which is no different from C # at this time, but C ++. net supports mfc7.0, And the VC is mfc6.0, which is later than the VC's MFC version (I am not very clear about these differences, but I just collected and sorted them out.
One more point: in fact, virtual reality simulation is now in progress, and game development will not use the MFC library support in VC ++, because the developed virtual system will not use the functional modules provided by MFC at all.
In addition, the addition of MFC will lead to redundant code.

The general introduction of these aspects is completed, and the features and relationships of these tools and languages are also clear.
Now I will summarize my learning process:
Some things need to be well organized. Therefore, some things mentioned here may be a language description:
III. in principle, learning OpenGL and d3d programming should only use Win32 APIs. However, it is still very promising to use VC ++ (MFC) to write software programs, I think. net is not widely used, so we decided to use the MFC library to write OpenGL and d3d programs. On the one hand, we can learn VC ++ (essentially the learning of the MFC Library) and synchronously learn Win32 APIs;
Using MFC to write OpenGL, d3d program references are much less than using WIN32API to write programs, because many developers do not use the functions provided by MFC and the above problems, but there are still references in this regard. The following are some references I know: (based on the MFC dialog box, single document, multi-document OpenGL drawing environment ):
1. OpenGL advanced programming and Visual System Development-advanced development, OpenGL advanced programming and Visual System Development-system development;
2. VC ++ game development technology and instances;
In addition to the MFC dialog box, single document, and multi-document environments, the OpenGL rendering environment can also be created in the Win32 console application (console application environment) and Win32 application (application environment) so far, the establishment of an OpenGL rendering environment under Win32 application alone has three common setting modes.
Of course, you do not need to master all of them. You only need to master the settings in the most common environment.
Creating a rendering environment based on the MFC Library is essentially changing the rendering mode of the display window.
 
4. after selecting and setting the rendering environment of OpenGL, you can start programming. It is obviously not very interesting to blindly compile several lines of code. Imagine what kind of effect you can achieve.
I saw a lot of demonstration results at the time, so the first idea was to implement a very large scenario where I could swim in it. At that time, I checked the collision detection, mobile control, and so on in the scenario, however, the idea was not clear. Later, I found many wrong ideas during the learning process. For example, the sense of separation of scenes was rather vague and I felt that there was really no idea. Not to mention the role of pickup.
Here we will talk about common game algorithms:
In fact, there are a complete list in many game books, but there are a lot of algorithms that only give theoretical analysis. To design a virtual system, we need to innovate in the game, the specific requirements may be caused by specific applications, and different structural algorithms may be required. This depends on the specific requirements of the project.
I feel that programming requires a good understanding of algorithms and the ability to design algorithms, especially virtual and game design.
Mastering the usage of common function libraries is the foundation. You must be able to design algorithms that meet the requirements of the system.
For example, many of the current engines have completed this requirement, and all you need to do is to use the Scenario Editing Software to edit the required scenario information, after the scenario is imported into the program, the system runs based on the engine segmentation algorithm, detection rules, and mobile rotation settings of the camera.
I have written an OpenGL-based REE segmentation algorithm, which is modeled after the octree version in d3d in dxsdk. I feel that I have cut the space and made it easier to manage it, however, there is still a certain distance from real application detection.
Generally, you need to develop games. pay more attention to the universal design. In this scenario, you need to design an editing operation software (this software can be written in various languages). After the software is converted, it becomes a resource package suitable for the engine and is imported and displayed when the program is opened and running.
In the programming of d3d and OpenGL, there are many similarities, not to say a language, but an idea. Of course, the program running is essentially different.
D3d can also be used in VC ++ (based on the MFC dialog box, single document, multi-document to create a d3d drawing environment ):
Similar to OpenGL and MFC, d3d does not need the function modules provided by the MFC library, so it mainly writes applications under Win32 application.
 
5. For OpenGL and d3d, there are mature encapsulated sdks, which can be implemented by directly calling ready-made SDK functions. Of course, the premise is to include the support of this SDK.
Support for d3d and dxsdk, and instructions and help on msdn;
For OpenGL, the following sdks are available: Vega
Vega is actually based on scene graph, and the scene graph management system is built on a standard graphics library such as OpenGL. On the SGI platform, the scene graph management system attached to Vega is the timer, while on the Windows platform, vega is attached to a scene graph management system called jolt (jolt is actually implemented by timer on the PC ).

I have studied some engines, such as quake3, half-lived, and so on,
If a friend needs octree or Q3 code, you can contact me (firedragon7031@126.com)
QQ: 420579621
If you write these things, you may have many vulnerabilities. We hope that we can communicate with people who share common interests and make progress together.
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.