Skip to content

Winteradio/Game-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

1

Win API ๊ธฐ๋ณธ ํ”„๋ ˆ์ž„ ์›Œํฌ ๊ตฌ์„ฑ -> main.cpp -> System Class : Window ์ƒ์„ฑ ๋ฐ Main Loop -> Input Class : ์‚ฌ์šฉ์ž ์ž…์ถœ๋ ฅ -> DXEngine Class : Directx ์‚ฌ์šฉ

2

DirectX ์ดˆ๊ธฐํ™” ๊ด€๋ จ Class ์ถ”๊ฐ€ -> main.cpp -> System Class -> Input Class -> DXEngine Class -> DXD3D : DirectX 11 ์ดˆ๊ธฐํ™”

3

2์ฐจ์›์ƒ์˜ ์‚ผ๊ฐํ˜• ๊ทธ๋ฆฌ๊ธฐ / Model, Camera, Shader Class ์ถ”๊ฐ€ -> main.cpp -> System Class -> Input Class -> DXEngine Class -> DXD3D Class : DirectX ์ดˆ๊ธฐํ™” ๊ด€๋ จ -> DXCamera Class : Camera ๊ด€๋ จ -> DXModel Class : Model ์ƒ์„ฑ ( Vertex, Index ) -> DXShader Class : Shader ๊ด€๋ จ

4

2์ฐจ์›์ƒ์˜ ์‚ผ๊ฐํ˜• ์ƒ‰๊น” ๋ฐ”๊พธ๊ธฐ - ๋™์  ๋ฆฌ์†Œ์Šค ์‚ฌ์šฉ / MDParticle, DXPhysics ์ถ”๊ฐ€ ์˜ˆ์ • -> main.cpp -> System Class -> Input Class -> DXEngine Class -> DXD3D Class : DirectX ์ดˆ๊ธฐํ™” ๊ด€๋ จ -> DXCamera Class : Camera ๊ด€๋ จ -> DXModel Class : Model ์ƒ์„ฑ ( Vertex, Index ) -> MDParticle Class : ์ž…์ž ๊ด€๋ จ ๊ตฌ์กฐ์ฒด -> DXShader Class : Shader ๊ด€๋ จ -> DXPhysics Class : ๋ฌผ๋ฆฌ ์—ฐ์‚ฐ ๊ด€๋ จ

5

๊ฐ„๋‹จํ•œ ์กฐ๋ช… ๋งŒ๋“ค๊ธฐ - ๋™์  ๋ฆฌ์†Œ์Šค ์‚ฌ์šฉ / MDParticle, DXPhysics ์ถ”๊ฐ€ ์˜ˆ์ • -> main.cpp -> System Class -> Input Class -> DXEngine Class -> DXD3D Class : DirectX ์ดˆ๊ธฐํ™” ๊ด€๋ จ -> DXCamera Class : Camera ๊ด€๋ จ -> DXModel Class : Model ์ƒ์„ฑ ( Vertex, Index ) -> MDParticle Class : ์ž…์ž ๊ด€๋ จ ๊ตฌ์กฐ์ฒด -> DXShader Class : Shader ๊ด€๋ จ -> Light ์ ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋ณ€๊ฒฝ -> DXPhysics Class : ๋ฌผ๋ฆฌ ์—ฐ์‚ฐ ๊ด€๋ จ -> DXLight Class : Diffuse Light, Light Position ์„ค์ • ๊ด€๋ จ

-> ์กฐ๋ช… ๊ด€๋ จ

Normal Vector : ์ฃผ์–ด์ง„ Object์—์„œ ๋‚˜์˜ค๋Š” ๋ฐฉํ–ฅ Light Vector : ๋น› ๋ฒกํ„ฐ Light Intensity : ์ฑ„๋„ -> Light Intensity = dot( Normal Vector * ( -1.0f ) , Light Vector ) -> ์ฃผ์–ด์ง„ Object์— ๋น›์ด ๊ฐ€ํ•ด์ง€๋Š” ์ •๋„ ( 0 ~ 1 )

Diffuse Light : ๋ถ„์‚ฐ๊ด‘ -> ๋ฌผ์ฒด์˜ ํ‘œ๋ฉด์—์„œ ๋ถ„์‚ฐ๋˜์–ด ๋ˆˆ์œผ๋กœ ๋ฐ”๋กœ ๋“ค์–ด์˜ค๋Š” ๋น› -> ๊ฐ๋„์— ๋”ฐ๋ผ ๋ฐ๊ธฐ๊ฐ€ ๋‹ค๋ฆ„ -> Light Intensity -> Color = material Color * ( Light color * Light Intensity ) Ambient Light : ์ฃผ๋ณ€๊ด‘ -> ์ˆ˜๋งŽ์€ ๋ฐ˜์‚ฌ๋ฅผ ๊ฑฐ์ณ์„œ ๊ด‘์›์ด ๋ถˆ๋ถ„๋ช…ํ•œ ๋น› -> ๋ฌผ์ฒด๋ฅผ ๋ฎ๊ณ  ์žˆ๋Š” ๋น›์ด๋ฉฐ, ์ผ์ •ํ•œ ๋ฐ๊ธฐ์™€ ์ƒ‰์„ ํ‘œํ˜„ -> Color = material Color * Ambient Light Color Specular Light : ๋ฐ˜์‚ฌ๊ด‘ -> ๋ถ„์‚ฐ๊ด‘๊ณผ ๋‹ฌ๋ฆฌ ํ•œ๋ฐฉํ–ฅ์œผ๋กœ ์™„์ „ํžˆ ๋ฐ˜์‚ฌ๋˜๋Š” ๋น› -> ๋ฐ˜์‚ฌ๋˜๋Š” ๋ถ€๋ถ„์€ ํฐ์ƒ‰์˜ ๊ด‘์œผ๋กœ ๋ณด์ž„ Total Light : ์‹ค์งˆ์ ์ธ Object์˜ ๋น›์˜ ๋ฐ๊ธฐ

6

3์ฐจ์› ๋ฐ•์Šค ๋งŒ๋“ค๊ธฐ / MDParticle, DXPhysics ์ถ”๊ฐ€ ์˜ˆ์ • -> main.cpp -> System Class -> Input Class -> DXEngine Class -> DXD3D Class : DirectX ์ดˆ๊ธฐํ™” ๊ด€๋ จ -> DXCamera Class : Camera ๊ด€๋ จ -> DXModel Class : Model ์ƒ์„ฑ ( Vertex, Index ) -> MDParticle Class : ์ž…์ž ๊ด€๋ จ ๊ตฌ์กฐ์ฒด -> DXShader Class : Shader ๊ด€๋ จ -> Light ์ ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ๋ณ€๊ฒฝ -> DXPhysics Class : ๋ฌผ๋ฆฌ ์—ฐ์‚ฐ ๊ด€๋ จ -> DXLight Class : Diffuse Light, Light Position ์„ค์ • ๊ด€๋ จ

-> Normal Vector -> final Normal Vector = World Matrix * Normal Vector -> World๊ฐ€ ์ด๋™ ํ˜น์€ ํšŒ์ „ํ•จ์— ๋”ฐ๋ผ ์ตœ์ข… Normal Vector๊ฐ€ ๋‹ฌ๋ผ์ง -> ์ด๋Ÿฌํ•œ Normal Vector๋Š” Light๋กœ ํ‘œํ˜„๋˜๋Š” Color์—๋„ ์˜ํ–ฅ์„ ๋ผ์นจ

7

๋ชฉ๋ก -> ํ”„๋ ˆ์ž„์›Œํฌ ์žฌ์ •์˜ -> ์ •๋ฐ˜์‚ฌ๊ด‘ ์ถ”๊ฐ€ -> ์ง„์งœ ๊ฐ„๋‹จํ•œ ๋น› ๊ตฌํ˜„ -> ์›€์ง์ด๋Š” 3์ฐจ์› ๋ฐ•์Šค ๊ตฌํ˜„ -> ๊ฐ„๋‹จํ•œ ๊ธ€์ž ํ™”๋ฉด์— ์ถœ๋ ฅ -> ์‚ฌ์šฉ์ž์˜ ๋งˆ์šฐ์Šค ์ž…๋ ฅ ๊ด€๋ จ ๊ตฌํ˜„

๊ตฌ์„ฑ -> main.cpp -> SYSTEM -> DXENGINE -> DXD3D -> DXCAMERA -> DXMODEL -> DXLIGHT -> DXTEXT -> DXTEXTURE -> SUB -> SUBCPU -> SUBFPS -> SUBINPUT -> SUBLOG -> SUBTIMER

๋‚ด์šฉ -> main.cpp -> System - Window ์ดˆ๊ธฐํ™” - MainLoop - DX, SUB ๊ด€๋ฆฌ

	-> DXENGINE
		-> DXD3D
			- DirectX ์ดˆ๊ธฐํ™”
			- Device, DeviceContext ๊ด€๋ จ
			- SwapChain, RenderTarget, DepthStencil, Blending ๊ด€๋ จ
			- World, Ortho, Projection Matrix & ViewPort ๊ด€๋ จ

		-> DXCAMERA
			- Camera ์ดˆ๊ธฐํ™”
			- Camera Position, Rotation ๊ด€๋ จ
			- Camera View Matrix ๊ด€๋ จ

		-> DXMODEL
			- Model ์ดˆ๊ธฐํ™”
				- Model Vertex, Index txt ํŒŒ์ผ ์ฝ๊ธฐ ๊ด€๋ จ
					- Load Model
				- Image(texture) ๊ด€๋ จ
					- Load Texture
			- Vertex, Index ๊ด€๋ จ
				- Update, Init

		-> DXLIGHT
			- Light ์ดˆ๊ธฐํ™”
				- Light ๋ฐฉํ–ฅ ๋ฐ ๊ฐ ์„ฑ์งˆ๋“ค ์„ค์ •
					- Set ... & Get ...
			-> DXL_SHADER
				- Light Shader ์ดˆ๊ธฐํ™”
					- Light VS, PS hlsl ํŒŒ์ผ ์ฝ๊ธฐ ๊ด€๋ จ
						- Init ...
				- Layout, SampleState, Buffer ๊ด€๋ฆฌ
				- Light Render ๊ด€๋ฆฌ

		-> DXTEXT
			-> DXT_FONT
				- Font ์ดˆ๊ธฐํ™”
					- Font DDS(texture), txt ํŒŒ์ผ ์ฝ๊ธฐ ๊ด€๋ จ
						- Load DDS & txt
				- ์ฃผ์–ด์ง„ Text์˜ Vertex, Index ํ˜•์„ฑ ๊ด€๋ จ
					- BuildVertexArray
			-> DXT_SHADER
				- Font Shader ์ดˆ๊ธฐํ™”
					- Font VS, PS hlsl ํŒŒ์ผ ์ฝ๊ธฐ ๊ด€๋ จ
						- Init ...
				- Layout, SampleState, Buffer ๊ด€๋ฆฌ
				- Font Render ๊ด€๋ฆฌ

		-> DXTEXTURE
			- Texture ํŒŒ์ผ ์ฝ๊ธฐ
			- Texture ํŒŒ์ผ ๋‚ด์šฉ ์ „ํ•ด์ฃผ๊ธฐ

	-> SUB
		-> SUBCPU - CPU ์‚ฌ์šฉ๋Ÿ‰ ๊ณ„์‚ฐ
		-> SUBFPS - FPS ๊ณ„์‚ฐ
		-> SUBINPUT - User Input ๊ด€๋ฆฌ
		-> SUBLOG - Log ์ถœ๋ ฅ ๋„์šฐ๋ฏธ
		-> SUBTIMER - Time ๊ณ„์‚ฐ

8

--> DXTEXT์—์„œ Sentence ์ƒ์„ฑ & Update ๊ด€๋ จํ•˜์—ฌ ๋ฐ‘์˜ ๋‚ด์šฉ ๊ณต๋ถ€ํ•˜์ž ๋งค๊ฐœ๋ณ€์ˆ˜(parameter)์™€ ์ธ์ž(argument) -> ํ•จ์ˆ˜ -> ์ธ์ž(argument)๊ฐ€ ๋งค๊ฐœ๋ณ€์ˆ˜(parameter)์— ์ „๋‹ฌ๋˜๋Š” ํ˜•ํƒœ๋กœ ๋™์ž‘

	ex)
	void func( int a, int b )
	{
		...
	}

	int main()
	{
		func( 1, 2);
		...
	}

	ํ•จ์ˆ˜๊ฐ€ ํ˜ธ์ถœ๋˜๊ฒŒ ๋˜๋ฉด,
		int x = 1;
		int y = 2;
	์™€ ๊ฐ™์ด ์ธ์ž๊ฐ€ ๋งค๊ฐœ๋ณ€์ˆ˜์— ์ „ํ•ด์ง

์ธ์ˆ˜ ์ „๋‹ฌ
	-> ๊ฐ’์— ์˜ํ•œ ์ „๋‹ฌ
		-> ํ•จ์ˆ˜์˜ ์ง€์—ญ๋ณ€์ˆ˜์ด๋‚˜ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์ธ์ž์˜ ๊ฐ’ ๋ณต์‚ฌ
		-> ํ•จ์ˆ˜ ํ˜ธ์ถœ์ด ๋๋‚˜๋ฉด ์ธ์ž์˜ ๊ฐ’ ๋ณ€ํ™” X
		-> call by value ๋ผ๊ณ  ๋ถ€๋ฆ„

	-> ์ฐธ์กฐ์— ์˜ํ•œ ์ „๋‹ฌ
		-> ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์ „ํ•ด์ง€๋Š” ์ธ์ž์˜ ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ๊ณต์œ 
			-> ๋งค๊ฐœ๋ณ€์ˆ˜์™€ ์ธ์ž์˜ ์ฃผ์†Œ ๋™์ผ
		-> ํ•จ์ˆ˜ ํ˜ธ์ถœ์ด ๋๋‚˜๋ฉด ์ธ์ž์˜ ๊ฐ’ ๋ณ€ํ™” O
		-> C/C++์€ return์ด ํ•˜๋‚˜๋งŒ ๊ฐ€๋Šฅํ•˜๊ธฐ์—, ์ด์˜ ๋ฐฉ๋ฒ•์„ ์ฃผ๋กœ ์‚ฌ์šฉ
		-> ์ฐธ์กฐ ๋ฐฉ์‹
			-> ์ผ๋ฐ˜ & : L-value( ๋ฉ”๋ชจ๋ฆฌ ๊ณต๊ฐ„ O )
			-> const & : L-value, R-value( ๋ฉ”๋ชจ๋ฆฌ ๊ณต๊ฐ„ X )

	-> ์ฃผ์†Œ์— ์˜ํ•œ ์ „๋‹ฌ
		-> ๊ฐ’์ด ์ฃผ์†Œ๊ฐ’์œผ๋กœ ๋ฐ›๋Š”๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋ฉด ๋œ๋‹ค
		-> ๊ฐ„์ ‘ ์ฐธ์กฐ๋ฅผ ํ†ตํ•˜์—ฌ ์ธ์ž์˜ ๊ฐ’ ๋ณ€๊ฒฝ ๊ฐ€๋Šฅ
			-> ์ธ์ž์˜ ์ฃผ์†Œ๊ฐ’์„ ๋งค๊ฐœ๋ณ€์ˆ˜๊ฐ€ ์ง€๋‹ˆ๊ณ  ์žˆ๊ณ 
			-> ๋งค๊ฐœ๋ณ€์ˆ˜์˜ ์—ญ์ฐธ์กฐ๋ฅผ ํ†ตํ•˜์—ฌ ์ธ์ž๋กœ ์ ‘๊ทผํ•˜์—ฌ ๊ฐ’ ๋ณ€๊ฒฝ ๊ฐ€๋Šฅ

9

FPS, CPU ํ™”๋ฉด์— ์ถœ๋ ฅ

๊ตฌ์„ฑ -> main.cpp -> SYSTEM -> DXENGINE -> DXD3D -> DXCAMERA -> DXMODEL -> DXLIGHT -> DXTEXT -> DXTEXTURE -> SUB -> SUBCPU -> SUBFPS -> SUBINPUT -> SUBLOG -> SUBTIMER

10

์ง€๋ฉด๊ณผ์˜ ์ถฉ๋Œ ๊ตฌํ˜„ -> 3์ฐจ์›์ƒ์˜ ๊ฐ•์ฒด ์ถฉ๋Œ ๊ตฌํ˜„ -> CCW(Counter Clockwise) ์•Œ๊ณ ๋ฆฌ์ฆ˜ -> Object - Normal Vector์— ๋”ฐ๋ผ Plane์˜ ๊ฐœ์ˆ˜ ์„ค์ • - ์ด Plane * Plane์˜ ์„ ๋ถ„ ๊ฐœ์ˆ˜ - ex) ์ง์œก๋ฉด์ฒด 2๊ฐœ ์ถฉ๋Œ ๋น„๊ต ๊ฐ๊ฐ์˜ Plane์˜ ๊ฐœ์ˆ˜ : 6๊ฐœ ๊ฐ Plane์˜ ์„ ๋ถ„์˜ ๊ฐœ์ˆ˜ : 4๊ฐœ ์ด ๊ณ„์‚ฐ๋Ÿ‰ : 646*4 -> ๋งค์šฐ ๋งŽ์•„์ง„๋‹ค

		- ์„œ๋กœ ๋‹ค๋ฅธ Object๋ผ๋ฆฌ Normal Vector์˜ ๋‚ด์ ์ด ์Œ์ˆ˜์ธ ๊ฒฝ์šฐ๋ผ๋ฆฌ ์ถฉ๋Œ ๊ฐ€๋Šฅ
			> ์Œ์ˆ˜, 0, ์–‘์ˆ˜ ์…‹ ๋‹ค ๊ณ„์‚ฐํ•˜๊ฒŒ ๋  ์‹œ, ๊ณ„์‚ฐ๋Ÿ‰์ด ๋„ˆ๋ฌด ๋งŽ์•„์ง
			> ์ถฉ๋Œ ์‹œ, Normal Vector๋ฅผ ์ •ํ•˜๋Š” ๊ธฐ์ค€์€?

-> mappedResource๋ฅผ ๋ถˆ๋Ÿฌ์™€์„œ, Vertex์™€ Index์— memcpy๋ฅผ ์‹œํ‚จ๋‹ค.
	-> Output Buffer๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ์„œ Input Buffer๋ฅผ ํ†ตํ•ด์„œ ์ตœ์ข… ์ƒ์„ฑ๋œ Output Buffer๋ฅผ ์–ป๋Š”๋‹ค
	ex memcpy( List, mappedResource.pData , sizeof( Type ) * Count )
	 ๋™์  ๋ฆฌ์†Œ์Šค๋ฅผ ์ง„ํ–‰ํ–ˆ๋˜ ํ˜•์‹์˜ ๋ฐ˜๋Œ€๋ผ๊ณ  ์ƒ๊ฐํ•˜๋ฉด ๋œ๋‹ค.
	 ๋ฆฌ์†Œ์Šค์— ๋Œ€ํ•œ ๋ณ€ํ™˜์€ ์—†๋‹ค

-> ๊ฐ•์ฒด์˜ ์ด๋™
	-> Vertex์˜ ๋ณ€ํ™˜
		-> Particle์ด ์•„๋‹Œ ์ด์ƒ, ํ•˜๋‚˜์˜ Object์—” ์ˆ˜๋งŽ์€ Vertex์™€ Index๊ฐ€ ์กด์žฌ
	-> World์˜ ๋ณ€ํ™˜
		-> World์˜ ๋ณ€ํ™˜์„ ์‚ฌ์šฉํ•ด์•ผ
		-> ํ•˜๋‚˜์˜ Model์— ๋Œ€ํ•œ ๋‹ค์–‘ํ•œ ๋ฌผ์ฒด๋“ค์„ ๋‹จ์ˆœํžˆ World๋ฅผ ์ถ”๊ฐ€ํ•จ์œผ๋กœ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ์Œ

-> ์ถ”ํ›„์— Model List ํ•„์š”
	-> Model List์—์„œ ์ž์‹ ์œผ๋กœ๋ถ€ํ„ฐ Hit Box ๋ฒ”์œ„ ์•ˆ์— ์žˆ๋Š” Model๋“ค๋งŒ ์ถฉ๋Œ ํ…Œ์ŠคํŠธํ•  ์ˆ˜ ์žˆ๋„๋ก ์•Œ๊ณ ๋ฆฌ์ฆ˜ ๊ตฌํ˜„ ํ•„์š”

-> Vertex Shader์˜ Output Vertex ๊ฐ€์ ธ์˜ค -> D3D11_BIND_FLAG -> D3D11_BIND_VERTEX_BUFFER IA ๋‹จ๊ณ„์—์„œ Binding -> D3D11_BIND_INDEX_BUFFER IA ๋‹จ๊ณ„์—์„œ Binding -> D3D11_BIND_CONSTANT_BUFFER Shader ๋‹จ๊ณ„์—์„œ Binding -> D3D11_BIND_SHADER_RESOURCE Shader ๋‹จ๊ณ„์—์„œ Binding -> D3D11_BIND_STREAM_OUTPUT Stream Output ๋‹จ๊ณ„์—์„œ ์ถœ๋ ฅ ๋ฒ„ํผ ๋ฐ”์ธ๋”ฉ -> D3D11_BIND_RENDER_TARGET Output Merge ๋‹จ๊ณ„์—์„œ ๋ Œ๋”๋ง ๋Œ€์ƒ ๋ฐ”์ธ๋”ฉ -> D3D11_BIND_DEPTH_STENCIL Output Merge ๋‹จ๊ณ„์—์„œ ๊นŠ์ด ์Šคํ…์‹ค ๋ฐ”์ธ๋”ฉ -> D3D11_BIND_UNORDERED_ACCESS ์ˆœ์„œ๊ฐ€ ์ง€์ •๋˜์ง€ ์•Š์€ ์•ก์„ธ์Šค ๋ฆฌ์†Œ์Šค -> D3D11_BIND_DECORDER ๋””์ฝ”๋” API -> D3D11_BIND_VIDEO_ENCODER ๋น„๋””์˜ค API

[ 2023-03-18 ]

template< class T >

#include

class ResourceManager {

template< class T >
static void CreateMap()
{
	m_ResourceData[ &typeid( T ) ] = std::map< std::string, IResource* >();
}

template< class T >
static void CreateResource( std::string Name )
{
	UUID Id;
	IResource* Temp = new T( Name, ID );
	m_ResourceData[ typeid(T).name() ][ ID ] = Temp;
}

template< class T >
static T* GetResource( std::string ID )
{
	return (T*)m_ResourceData[ typeid(T).name()][ ID ];
}

template< class T >
static std::map< std::string, IResource* > > GetMap()
{
	return m_ResourceData[ typeid(T).name() ];
}

std::map< std::string, std::map< std::string, IResource* > > m_ResourceData;	

std::map< const type_info&, std::map

};

class ResourceGuiLayer { template< class T > void RenderTree() { if ( ImGui::TreeNode( typeid(T).name().c_str() ); for ( auto itr = ResourceManager::GetMap().begin(); itr != ResourceManager::GetMap().end(); itr++ ) { if ( ImGui::Selectable( itr->GetName().c_str() ) ) { m_PropertyGuiLayer->Render( (T*)itr ); } } ImGui::PopNode(); } }

class PropertyGuiLayer { void RenderCommon( IResource* Resource ) { ImGui::Text( Resource->GetName().c_str() ); ImGui::Text( Resource->GetID().c_str() ); ImGui::Text( Resource->GetType().c_str() ); }

void RenderProperty( Scene* Resource )
{
	...
}

void RenderProperty( Component* Resource )
{
	...
}
	...

template< class T >
void Render( T* Resource )
{
	RenderCommon();
	RenderProperty( Resource );
}

->> SettingGuiLayer, FileSystemGuiLayer์ฒ˜๋Ÿผ Begin๊ณผ End๋กœ ๊ตฌํ˜„ํ•˜๊ธฐ

}

  • Done

class IResource { std::string m_Name; std::string m_UUID; };

[ 2023-03-21 ]

  • Input New Object GuiLayer ->(Change) IGuiLayer

IBrowserGuiLayer <-(Inheritance) IGuiLayer

MenuBrowserGuiLayer <-(Inheritance) IBrowserGuiLayer ->> MainGuiLayer

PropertyBrowserGuiLayer <-(Inheritance) IBrowserGuiLayer ->> PropertyGuiLayer

FileBrowserGuiLayer <-(Inheritance) IBrowserGuiLayer ->> FileSystemGuiLayer

ProjectManager ->> Manager Yaml File

  • File Browser system -> IBrowserGuiLayer ->> Menu ... ( MenuBrowserGuiLayer ) ->> Property ... ( PropertyBrowserGuiLayer )

      Click selectable for button like "File Load",
      then, Begin FileBrowserGuiLayer
    

    -> FileBrowserGuiLayer Render files and user select path ... As result, user click "Done" button, then call IBrowserGuiLayer end

    -> MenuBrowserGuiLayer if it is called by FileBrowserGuiLayer, Call ProjectManager

    -> PropertyBrowserGuiLayer if it is called by FileBrowserGuiLayer, Call Resource's Compile( FS::path Path ) function

  • Change Resource System -> ResourceManager - Resource must be accessed by ResourceManager, because, the other method is existed that access to resource, the other method must copy resource's pointer data and the other method must overlap ResourceManager

    -> Scene - It has map data structure that has typeinfo and UUID vector

    -> Component - It has map data structure that has typeinfo and UUId vector

[ 2023-04-01 ] class SceneManager { private : SceneManager() {}; ~SceneManager() {};

public : void Init() {}; void Destroy() {};

static std::vector< Scene >& GetScenes()
{
	return m_SceneManager.m_SceneData;
}

static void SetScene( Scene Other )
{
	m_SceneManager.m_SceneData.push_back( Other );
}

private : static SceneManager m_SceneManager; std::vector< Scene > m_SceneData; };

class RenderSystem; class CollisionCheckSystem;

class Scene { public : Scene() {}; ~Scene() {};

public :
	void Init()
	{
		R
	}

	void RegitserEntity( Entity& OtherEntity )
	{

	}

	void RegisterComponent( Component& OtherComponent )
	{

	}

	void RegisterSystem( System& OtherSystem )
	{

	}

	void OnUpdate()
	{

	}

};

class Entity { public : Entity() {}; virtual ~Entity(){};

public :
	virtual void Update() = 0;

};

struct Component {

};

class System { public : System() {}; virtual ~System() {};

public :
	virtual void Init() = 0;
	virtual void Update() = 0;

};

struct Transformation { XMFLOAT3 Position; XMFLOAT3 Rotation; XMFLOAT3 Scale; };

struct FilePath { FS::path Path; };

struct Mesh { VertexBuffer; IndexBuffer; };

struct Renderable { Trnasformation* m_Transform; Mesh* m_Mesh; };

[ 2023-04-07 ]

// Component๋“ค struct IDComponent { MyUUID ID; };

struct TagComponent { std::string Name; };

struct TransformComponent {

};

// Entity ๊ฐ์ฒด class Entity { public :

public :
	void AddComponent();

};

// Node๋“ค struct RenderableNode {

};

struct CameraNode {

};

struct LightNode {

};

// System๋“ค class RenderingSystem {

};

[ 2023-04-09 ]

Entity -> Component์— ๋Œ€ํ•œ ์ฃผ์†Œ๋“ค์„ ์ง€๋‹ˆ๊ณ  ์žˆ์Œ -> ๋‹จ์ˆœํžˆ, Component๋“ค์„ ๋“ฑ๋ก ๋ฐ ํ•ด์ œํ•  ์ˆ˜ ์žˆ์Œ

Component -> ํŠน์„ฑ๋“ค์„ ์ง€๋‹ˆ๊ณ  ์žˆ์Œ

Node -> Archtype์ด๋ผ๊ณ  ์ƒ๊ฐํ•˜๋ฉด ๋  ๋“ฏ -> System์œผ๋กœ ๋„˜๊ฒจ์•ผ ๋˜๋Š”, ๊ฐ Entity์— ๋”ฐ๋ฅธ Component๋“ค์˜ ๋ฌถ์Œ์ด๋ผ๊ณ  ์ƒ๊ฐ -> Component์— ๋Œ€ํ•œ ์ฃผ์†Œ๋“ค์„ ์ง€๋‹ˆ๊ณ  ์žˆ์Œ -> Entity์— ์†ํ•œ ์ž‘์€ Entity๋ผ๊ณ  ์ƒ๊ฐํ•˜๋ฉด ๋  ๋“ฏ

Scene ( Entity Manager ) -> Entity๋“ค์„ ๊ด€๋ฆฌ -> Entity ์ƒ์„ฑ ๋ฐ ์‚ญ์ œ

Component Manager -> Component๋“ค์˜ ์‹ค์ œ ์ธ์Šคํ„ด์Šค๋“ค์„ ์ €์žฅ -> Component๋“ค์„ ์ƒ์„ฑ ๋ฐ ์‚ญ์ œ

Node Manager -> Node๋“ค์˜ ์‹ค์ œ ์ธ์Šคํ„ด์Šค๋“ค์„ ์ €์žฅ -> Node๋“ค์—๊ฒŒ ํ•ด๋‹น Entity๋“ค์„ ๋„˜๊ฒจ์ฃผ๋Š” ์—ญํ• ( Scene์—์„œ ๋ฐ›์•„์˜ด )

์˜๋ฌธ์  1. Entity๋“ค์€ ์–ด๋–ป๊ฒŒ ํ•ด์„œ ์ž์‹ ์ด ๊ฐ€์ ธ์•ผ ํ•  Node๋“ค์˜ ์ •๋ณด๋ฅผ ์•Œ ์ˆ˜ ์žˆ์ง€? 1.1 ์‚ฌ์šฉ์ž๊ฐ€ ์„ค์ •ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด์•ผํ•œ๋‹ค. 1.2 ํ•ด๋‹น Entity๊ฐ€ ์–ด๋–ค Node๋“ค์„ ๊ฐ€์ง€๊ณ  System์— ์—ฐ๊ฒฐํ•  ์ง€ ์–ด๋–ป๊ฒŒ ํ•  ๊ฒƒ์ธ๊ฐ€? 1.3 Proj ํŒŒ์ผ ์•ˆ์—์„œ ํ•ด๋‹น Entity๋“ค์ด ์–ด๋–ค Node๋“ค์— ์—ฐ๊ฒฐ์ด ๋  ์ง€ ๋‚˜ํƒ€๋‚ผ ์ˆ˜ ์žˆ๋‹ค. 2. ํ•ด๋‹น Node๋“ค๊ณผ System๋“ค์€ ๋ณดํ†ต์€ 1๋Œ€1๋กœ ๋งค์นญ์‹œํ‚ค์ž

3. Blue Print์ฒ˜๋Ÿผ Node๋“ค์„ ์—ฐ๊ฒฐ์‹œํ‚ฌ ์ˆ˜ ์žˆ๋Š” Visual Graph๋ฅผ ๊ตฌํ˜„ํ•˜๋Š” ๊ฒƒ์ด ์ข‹์„๊นŒ?
	3.1 ์—ฐ๊ฒฐ์— ๋Œ€ํ•œ ์ •๋ณด๋Š” Proj ํŒŒ์ผ์— ๋“ค์–ด๊ฐ€ ์žˆ๋„๋ก ๊ตฌํ˜„์„ ํ•ด๋ณด์ž
	3.2 ๋งŒ์•ฝ์— ์—ฐ๊ฒฐ์„ ์ง์ ‘ ํ•ด์•ผํ•œ๋‹ค๋ฉด ์–ด๋–ป๊ฒŒ ํ•ด์•ผํ• ๊นŒ?
	3.3 Visual Graph๊ฐ€ ์—†์„ ๋•Œ๋Š” ์–ด๋–ค์‹์œผ๋กœ ๊ตฌํ˜„ํ• ์ง€ ์ƒ๊ฐ์„ ํ•ด๋ณด์ž.

[ 2023-04-10 ]

  1. ์ฐจ์„ธ๋Œ€ Unit์˜ ๊ธฐ๋ฐ˜ ๊ธฐ์ˆ 
  2. Data Oriented Design( DOD ) ์œผ๋กœ์˜ ์ „ํ™˜
  3. ECS, Job System. Burst Compiler ์„ธ๊ฐ€์ง€ ์š”์†Œ์˜ ํ•ฉ
  4. ๋ณต์žกํ•œ ์ฝ”๋“œ์—†์ด ๊ฐ„๋‹จํ•˜๊ฒŒ Multi-Threading์ด ๊ฐ€๋Šฅ
  5. ๋นŒ๋“œ ์˜ต์…˜ ํ•˜๋‚˜๋กœ ํผ๋ชจ๋จผ์Šค ํ–ฅ์ƒ

Entity, Component, System

-> DOD๋ฅผ ์œ„ํ•ด ์ œ๊ณต๋˜๋Š” ์•„ํ‚คํ…์ณ
-> Entity๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€๋ฆฌํ‚ค๋Š” ์ธ๋ฑ์Šค
-> Component๋Š” ์ฝ๊ณ  ์“ฐ๊ธฐ ์œ„ํ•œ ๋ฐ์ดํ„ฐ
-> System์—์„œ Entity์™€ Component๋ฅผ ๊ฐ€์ง€๊ณ  ๋กœ์ง์„ ๊ตฌํ˜„
-> Entity์™€ Component๋งŒ ์žˆ๋‹ค๋ฉด ์•„๋ฌด ์ผ๋„ ์ผ์–ด๋‚˜์ง€ ์•Š์Œ

Job System

-> Multi-Threading์„ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•˜๋Š” ์‹œ์Šคํ…œ
-> Race Condition ๊ฑฑ์ •์—†์ด Threading ๊ตฌํ˜„์ด ๊ฐ€๋Šฅ
-> ์ฝ”๋“œ์ƒ์˜ ์ด๋ฆ„์€ Job Component System
-> Job๋“ค์„ ์ƒ์„ฑํ•˜๊ณ  ์˜์กด์„ฑ์— ๋Œ€ํ•œ Handle์„ ๋ฐ˜ํ™˜
-> ์ž‘์—… ๋ฐฉ์‹์— ๋”ฐ๋ผ ์—ฌ๋Ÿฌ ํ˜•ํƒœ์˜ Job์„ ์ œ๊ณต

#1. Entity -> ID๋“ค์„ ์ง€๋‹ˆ๊ณ  ์žˆ๋‹ค. -> Component๋“ค์— ๋Œ€ํ•œ ํฌ์ธํ„ฐ๋ฅผ ์ง€๋‹ˆ๊ณ  ์žˆ๋‹ค.

#2. Component -> ์‹ค์ œ์˜ Attribute๋“ค์„ ์ง€๋‹ˆ๊ณ  ์žˆ๋‹ค.

#3. Node -> ํ•ด๋‹น๋œ Entity์˜ ID๋ฅผ ๋“ฑ๋กํ•œ๋‹ค -> Component๋“ค์˜ ํฌ์ธํ„ฐ๋ฅผ ์ง€๋‹ˆ๊ณ  ์žˆ๋‹ค. -> Node๋“ค์„ ์–ด๋–ป๊ฒŒ ํ•ด์„œ Caching Hit๋ฅผ ๋†’์ผ์ง€๋Š” ๋‚˜์ค‘์— ์ƒ๊ฐ์„ ํ•ด๋ณด์ž.

#4. System -> ํ•„์š”๋กœ ํ•˜๋Š” Node๋“ค์„ ๊ฐ€์ง€๊ณ  Update๋ฅผ ์ง„ํ–‰ํ•œ๋‹ค.

struct Component { // attribute for entities };

class Entity { // Register Component; // Make Entity ID; };

struct Node { // This is component collection };

[ 2023-04-11 ]

#1. Map ๊ตฌ์กฐ -> Component Manager Key : Component Type ์ •๋ณด Value : std::any -> std::vector< Type > -> std::any_cast ๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๊ตฌํ˜„์„ ํ•ด๋ณด์ž.

	or C++17 ์ดํ•˜์™€์˜ ํ˜ธํ™˜์„ฑ์„ ์œ„ํ•ด์„œ
	Value : void*
		-> std::vector< Type >

-> Entity
	Key : Component Type ์ •๋ณด
	Value : void*

-> Scene
	Key : MyUUID
	Value : Entity

-> Scene Manager
	Key : MyUUID
	Value : Scene

-> Node Manager
	Key : Node Type ์ •๋ณด
	Value : std::any
		-> std::vector< Type >

	or C++17 ์ดํ•˜์™€์˜ ํ˜ธํ™˜์„ฑ์„ ์œ„ํ•ด์„œ
	Value : void*
		-> std::vector< Type >

	ํ•˜์ง€๋งŒ ์ด๋ฏธ typeinfo๋ฅผ ์‚ฌ์šฉํ•ด์„œ C++17 ์ด์ƒ๋งŒ ์‚ฌ์šฉ๊ฐ€๋Šฅํ•œ ๊ฒƒ ์•„๋‹Œ๊ฐ€?

-> void* reinterpret_cast vs std::any
	-> reinterpret_cast ํฌ์ธํ„ฐ ๊ฐ„์˜ ํ˜•๋ณ€ํ™˜
		-> ์ž˜๋ชป๋œ ๋ณ€ํ™”์ผ ๋•Œ์˜ ๊ฒฝ์šฐ, ๋ง‰์•„์ฃผ๋Š” ๊ฒƒ์ด ์—†๋‹ค.

	-> std::any
		-> ์ž˜๋ชป๋œ ๋ณ€ํ™˜์ผ ๋•Œ, ๋ง‰์•„์ค„ ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ค€๋‹ค.

-> map ์ž์ฒด๋Š” ๊ทธ๋ƒฅ 48 ๋ฐ”์ดํŠธ์˜ ํฌ๊ธฐ๋ฅผ ์ง€๋‹Œ๋‹ค.
	์‹ค์ œ map ๊ฐ์ฒด ์ „์ฒด์˜ ๋ฐ์ดํ„ฐ์˜ ํฌ๊ธฐ๋Š”
	Key + Value * map pair ๊ฐœ์ˆ˜ + map instance ์‚ฌ์ด์ฆˆ์ด๋‹ค.

	pair ๋ฐ์ดํ„ฐ์˜ ๊ฒฝ์šฐ์—๋Š” Heap์— ์ €์žฅ๋˜๊ณ ( ๋™์  )
	map ๊ฐ์ฒด ์ž์ฒด์ด ๊ฒฝ์šฐ์—๋Š” Stack์— ์ €์žฅ( ์ •์  )
	์ต ๋Œ€๋ฌธ์—, map ๊ฐ์ฒด ์ž์ฒด์— ๋Œ€ํ•œ ์‚ฌ์ด์ฆˆ๋Š” 48๋กœ ์ผ์ •ํ•  ์ˆ˜ ๋ฐ–์— ์—†๋‹ค.

-> Layer๋“ค์˜ ๊ฒฝ์šฐ์—๋Š” Component์— ๋”ฐ๋ผ์„œ Rendering ํ•ด์ฃผ๋Š” Property Layer๊ฐ€ ์กด์žฌํ•˜๊ณ 
-> Scene๋“ค์„ ๋‹ค๋ฃจ๋Š” Scene Layer
-> Log๋“ค๋งŒ์„ ์ฃผ๋กœ ๋‹ค๋ฃจ๋Š” Log Layer
-> Main Menu Layer๊ฐ€ ์กด์žฌํ•˜๊ฒŒ ๋œ๋‹ค.

Entity -> ID -> Component's Pointer

Node -> Id -> Component's Pointer

Componen Manager -> Type Component Instance

Node Manager -> Type Node Instance

Scene -> ID -> Entity Instance

[ 2023-04-12 ]

Entity

-> ID
-> Components' Pointer

Node

-> ID
-> Components' Pointer

Component Manager

-> Each Type of Component Instance
-> std::any or void* : std::vector

Node Manager

-> Each Type of Node Instance
-> std::any or void* : std::vector

Scene

-> ID
-> Entities' Instance

Scene

-> Scenes' Instance

System

-> The Function uses some type of Node
-> The System Needs very complex, and 
each system cannot contact each other,
just connect through node

System Manager

-> Systems' Instance
-> Register System
-> Systems must be inheritance ISystem that has init,set and frame function's interface
-> System Manager set sequence of System on frame

# ISystem
	-> That is the interface of system
	-> This Object has some pointer of prev, next ISystem.
	-> Cause, System must have seqeunce during frame animation
	-> For example, Collision Animation has first collision System,
	Second CalculatePhysicsSystem, lastly RenderSystem.
	-> So, if this sequence is linked list, the User using this engine,
	more easily edit sequence, some system input or delete ... 
	and, user can see thie sequence on game engine ui.
	So, the User drag some system for inputting this sequence, 
	just, connect prev system and next system.

[ 2023-05-10 ]

Category

0. Global Variable ( static variable )
	-> This Object is static variable
	-> This Object is global variable

1. Handler	
	-> Manage without Entity, Component, Node, System, Scene
	-> Manage Asset, Files ... etc

2. Manager
	-> Manage Entity, Component, Node, System, Scene

3. ECS( Entity Component System )
	-> Entity
		-> Connection of Components
		-> This object must have unique number that is called as UUID
	-> Component
		-> This object is actial data
	-> System
		-> This object is acting
		-> This object run using Node or Component

	-> Node
		-> This object is unrealitic data's or data's connection by entity
	-> Scene	
		-> This object is connection of Entities.

RelationShip

0. Global Variable ( static variable )
	0.1 Core
		0.1.1 Core
		0.1.2 Log
		0.1.3 Timer
	0.2 API
		0.2.1 WinAPI
		0.2.2 DirectXAPI
		0.2.3 ImGuiAPI
	0.3 Handler
	0.4 Manager

1. Handler
	1.1 AssetHandler
	1.2 FileHandler

2. Manager
	2.1 SceneManager
	2.2 Scene( EntityManager )
	2.3 ComponentManager
	2.4 NodeManager
	2.5 SystemManager

3. ECS ( Entity Component System )
	3.1 Entity
	3.2 Component
	3.3 System
	3.4 Node
	3.5 Scene ( Entity Manager )

[ 2023-05-11 ]

Scene's work

1. Make Entity
2. Add Entity
3. Remove Entity

ComponentManager's work

1. Make Component
2. Add Component
3. Remove Component

NodeManager's work

1. Make Node through Entity's ID
2. Add Node through Entity's ID
3. Remove Node through Entity's ID

Entity's work

1. Add Component -> Through ComponentManager
2. Make Component -> Through ComponentManager
3. Give Entity's ID
4. Give Entity's Name

Property UI's work

1. Render Entity's Component -> Through NodeManager;
2. Edit Entity's Component -> Through NodeManager;
3. Render Array of Entity's Node -> Through NodeManager;
4. Edit Entity's Node -> Through NodeManager;

5. Render Scene's System -> Through SystemManager;
6. Edit Scene's System Sequence -> Through SystemManager;

Main UI's work

1. Open Project File -> Through FileHandler + YAML
2. Save Project File -> Through FileHandler + YAML
3. Make Scene, Component, Node -> Through Scene, Component, Node Manager
4. Register System -> Through SystemManager

Scene Array UI's work

1. Select Scene -> Through SceneManager
2. Make Scene -> Through SceneManager
3. Remove Scene -> Through SceneManager
4. Select Entity -> Through Scene
	4.1. Send Entity's ID to Property UI
5. Make Entity -> Through Scene
6. Remove Entity -> Through Scene

Log UI's work

1. Print Log -> Through Log
2. Save Log File -> Through AssetHandler

[ 2023 - 05 - 13 ]

Critical Problem

1. The entity, node have some components that they need
2. The Component Manager has each type of Component's Vector
3. These Vector reallocate when user input Component
4. Then, entity and node would miss pointer of their Component

Solution

1. Using Index of Component Vector, instead Pointer
	1.1 Entity and Node just have index for each Component
	1.2 Through ComponentManager, Node gives information of index's Component Vector to each System.
	1.3 Node get information of index's Component through entity's Instance.

[ 2023 - 05 -18 ]

Placement New

1. Using Interface, user easily make Instance.
2. The origin method is just making instance using std::any with vector.
	So, the program must change type of std::any using std::any_cast.
3. This is very useful in advanced game engine's memory manager.

Memory Pool

1. Each type of object vector or list just have memory pool address or register memory pool.
2. Then, user can access each type of memory pool, get continuously data in memory.
3. But, if the vector's data count of allocating data is over then  memory pool size.
4. the program must allocate new memory pool and connect the origin pool.

Using RTTI with typeid

1. The inheritance relationship using interface and instance, can access through interface's pointer to instance
2. The Manager like System, Node, Component have the method function
	like, Create, Get, Delete.
3. The original method functions only access through template typename T each type's vector.
4. But, this needs the program is created by hard coding for suitable each type.
5. So, this needs the user input new type of system or node or component, 
	change the original code.
6. The changine the original core code is so difficult.
7. I want to just use the Outter code in my game engine.
8. So, the Managers of System, Component, Node have two type of eacy method functions for typeid and template
9. But, template method function is constructed by typeid method function.

ECS that was made by other user

## WebSite : https://github.com/talhacali/ECS
	1. Using Memory Manager, this object allocate memory.
	2. This object has memory's pointer by each type.
	3. The ECS manager create their object through memory manager.
	4. The ECS manager just have pointer of each object.
		So, just use vector or map.

About

Using Directx, Make Game Engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published