当前位置:网站首页>Cherno_ Game engine series tutorial (5): 101~
Cherno_ Game engine series tutorial (5): 101~
2022-04-23 02:58:00 【Kiss your wife】
List of articles
- Engine development plan :
- 101. Content Browser/Asset Panel
- 102. Content Browser Panel - ImGui Drag Drop
- 103. Textures for Entities!
- 105. PLAY BUTTON!
- 106. 2D PHYSICS!
- 107. Universally Unique Identifiers (UUID/GUID)
- 108. Playing and Stopping Scenes (and Resetting)
- 109. Rendering Circles in a Game Engine
- 110. Rendering Lines in a Game Engine
- 111. Circle Physics Colliders
- 112. Visualizing Physics Colliders
Engine development plan :
shader Compiling system (cache)
hlsl -> glsl
Reference resources :
https://zhuanlan.zhihu.com/p/462659745
https://zhuanlan.zhihu.com/p/56510874
Then learn from the unreal engine source code :
You can use ShaderConductor, It can be relied on :SPIRV-Cross、DirectXShaderCompiler(DXC)、cxxopts etc. .
Current plan : I hope I can only write one in the future hlsl, Each compilation is compiled and applicable to all graphics api The circumstances of , Deposit in cache in .
About shader reflections , about spir-v, Yes SPIRV-Reflect:
dx I don't know effect Or something dx12 The official shader reflection .
Code reflection system ( You can refer to games104 and The realization of Unreal Engine ).
101. Content Browser/Asset Panel
We obviously want to use the standard library filesystem
here stem and filename The difference is whether there is a file suffix , such as :
102. Content Browser Panel - ImGui Drag Drop
We have to be the only one here id identification , Otherwise, you should use ImageButtonEx And so on. .
Content Browser Panel - ImGui Drag Drop
Otherwise, it will lead to the fact that dragging into the scene is always one bug.
Another thing to note is that here :
ImGui::SetDragDropPayload("CONTENT_BROWSER_ITEM", itemPath, (wcslen(itemPath) + 1) * sizeof(wchar_t), ImGuiCond_Once);
We write the size of the pathname :(wcslen(itemPath) + 1) * sizeof(wchar_t)
, Add 1 Because null terminal Something ( It's actually that \0 ?)
103. Textures for Entities!
105. PLAY BUTTON!
106. 2D PHYSICS!
Generally, our update order is script -> physics -> render
It can be seen in Scene::OnUpdateRuntime
107. Universally Unique Identifiers (UUID/GUID)
here uuid We always make a value at random , Not simply ++, such as 0123456 representative 7 individual entity, The reason is that, for example, there are multiple people to build a game , Then it's possible for both people to create one entity And the labels become 5 + 1 = 6 Such a situation .
Of course, you can also make one server Every time from server Where to get a specific id
We can simply use an example unordered_set To detect conflicts .
Want to make unordered_map Can use our UUID As key, Write the following template specialization :
namespace std
{
template<>
struct hash<HEngine::UUID>
{
std::size_t operator()(const HEngine::UUID& uuid) const
{
return hash<uint64_t>()((uint64_t)uuid);
}
};
}
Some people suggest using a unordeed_set Or something , as follows :
however cherno This is not recommended , Two reasons :
- The risk of conflict is actually very low , And doing so reduces performance
- This is a local Of , It means that if you change a computer, it will be completely useless for others to do this project .
108. Playing and Stopping Scenes (and Resetting)
109. Rendering Circles in a Game Engine
110. Rendering Lines in a Game Engine
111. Circle Physics Colliders
Here I find there is something wrong , That is, the radius equivalence of the physical system is in Scene.cpp Of OnRuntimeStart Preset in function , But rely on those component The initial value of the , Like here CircleCollider2DComponent, If the radius is not equal to the radius of the actual rendered object, there is a problem . So I think we should actually assign values to each frame .
112. Visualizing Physics Colliders
版权声明
本文为[Kiss your wife]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220644190343.html
边栏推荐
- Guangcheng cloud service can fill in a daily report regularly every day
- Step principle of logical regression in machine learning
- 学习正则表达式选项、断言
- Error installing Mongo service 'mongodb server' on win10 failed to start
- BLDC double closed loop (speed PI + current PI) Simulink simulation model
- Shell script learning notes -- shell operation on files sed
- Six very 6 computer driver managers: what software is good for driver upgrade? Recommended by the best computer driver management software abroad
- Airtrack cracking wireless network password (Dictionary running method)
- Interim summary (Introduction + application layer + transportation layer)
- Flink learning (XI) watermark
猜你喜欢
解决win7 中powershell挖矿占用CPU100%
Actual combat of industrial defect detection project (IV) -- ceramic defect detection based on hrnet
Fashion MNIST dataset classification training
Practice of industrial defect detection project (III) -- Based on FPN_ PCB defect detection of tensorflow
AC & A2C & A3C
Sonic cloud real machine tutorial
windows MySQL8 zip安装
ROP Emporium x86_ 64 7 ~ 8 questions
基于ele封装下拉菜单等组件
Practical combat of industrial defect detection project (II) -- steel surface defect detection based on deep learning framework yolov5
随机推荐
Actual combat of industrial defect detection project (IV) -- ceramic defect detection based on hrnet
Sonic cloud real machine tutorial
What is the difference between varchar and char?
Basic workflow of CPU
Kubernetes - detailed explanation of pod
Log4j knowledge point record
JDBC JDBC
Configuring Apache Web services for servers such as Tianyi cloud
Encapsulate components such as pull-down menu based on ele
Classification of technology selection (2022)
Modify the content of MySQL + PHP drop-down box
Redis data server / database / cache (2022)
Kubernetes study notes
Machine learning (Zhou Zhihua) Chapter 14 probability graph model
windows MySQL8 zip安装
Chapter V project quality management of information system project manager summary
基于ele封装下拉菜单等组件
国产轻量级看板式Scrum敏捷项目管理工具
Decision tree principle of machine learning
tf. keras. layers. Timedistributed function