How do engines like Unreal relate to OpenGL or D3D?
来源:互联网 发布:招聘文案 知乎 编辑:程序博客网 时间:2024/05/14 11:31
TL;DR: An engine is just a collection of reusable components.
Wall of text:Games store a representation of the world, e.g. you'd have an entity like a house, which has a mesh that defines what its geometry looks like and a position.
Now, you probably have more than one entity. Let's say we've got a player controlled character and some boxes. When the player wants to move, you'd move the character and check if he collides with any boxes. That's where physics come into play. Depending on how physics are modelled, the character might just walk through the boxes, stop in front of the boxes or push the boxes.
Mind you, this only changes the internal state of the game world.
Then, after calculating movement and physics, you'd render a frame, e.g. draw the current state of the world on the screen.
OpenGL and DirectX are graphics APIs, they are only used to render stuff (e.g. the character) to the screen.
So, you're basically telling OpenGL/DirectX 'I want to draw the character at position1 and a box at position2, and ...'.
Of course, this is a gross oversimplification.
Anyway, since we don't want to walk through that procedure step by step all the time, we put that stuff into functions and classes. So, we might have a class physics which holds all the functions needed for the physics simulation, or a graphics class which interfaces with the graphics api and draws our entities. Et voila, we've got an engine.
转载链接:http://gamedev.stackexchange.com/questions/20706/how-do-engines-like-unreal-relate-to-opengl-or-d3d
TL;DR: An engine is just a collection of reusable components.
Wall of text:Games store a representation of the world, e.g. you'd have an entity like a house, which has a mesh that defines what its geometry looks like and a position.
Now, you probably have more than one entity. Let's say we've got a player controlled character and some boxes. When the player wants to move, you'd move the character and check if he collides with any boxes. That's where physics come into play. Depending on how physics are modelled, the character might just walk through the boxes, stop in front of the boxes or push the boxes.
Mind you, this only changes the internal state of the game world.
Then, after calculating movement and physics, you'd render a frame, e.g. draw the current state of the world on the screen.
OpenGL and DirectX are graphics APIs, they are only used to render stuff (e.g. the character) to the screen.
So, you're basically telling OpenGL/DirectX 'I want to draw the character at position1 and a box at position2, and ...'.
Of course, this is a gross oversimplification.
Anyway, since we don't want to walk through that procedure step by step all the time, we put that stuff into functions and classes. So, we might have a class physics which holds all the functions needed for the physics simulation, or a graphics class which interfaces with the graphics api and draws our entities. Et voila, we've got an engine.
转载链接:http://gamedev.stackexchange.com/questions/20706/how-do-engines-like-unreal-relate-to-opengl-or-d3d
- How do engines like Unreal relate to OpenGL or D3D?
- How Do Story Points Relate to Hours?
- How Do Search Engines Work?
- How to do Photoshop-like effects in SVG
- How to Make a Gesture-Driven To-Do List App Like Clear: Part 1/3
- How does HDR relate to color space and bit depth?
- How do I get my program to act like a daemon?
- How to do Reseach
- How to do research
- How to do research!
- How to do research
- How to do research?
- How to do research?
- how to do research
- How To Do Research
- How to do research?
- How to do research?
- Using IP Instances with VLANs or How to Make a Few NICs Look Like Many
- 改掉坏习惯
- cmake自学
- Lombok 安装、入门 - 消除冗长的 java 代码
- 命令行CUI库
- 整理下之前的js代码 moogens.js 记录下
- How do engines like Unreal relate to OpenGL or D3D?
- Android adb截图命令
- 命名实体识别
- mop有才人
- golang 调用redis
- Flink流计算编程--流处理引擎的选型
- 支付宝接口 - 即时到账交易接口 对接 整理 2
- apache2.2+svn1.6+TortoiseSVN在windows环境搭建
- 2014年湖北省成人学士学位外语考试报名须知