diff --git a/.gitattributes b/.gitattributes index 8e253bc81..929316c6f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -44,4 +44,7 @@ *.PDF diff=astextplain *.rtf diff=astextplain *.RTF diff=astextplain + *.fbx filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.dds filter=lfs diff=lfs merge=lfs -text \ No newline at end of file diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/Box.bin b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/Box.bin new file mode 100644 index 000000000..81cc493b0 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/Box.bin differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/Box.fbx b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/Box.fbx new file mode 100644 index 000000000..5aaa7259d --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/Box.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:080a0a3ed020c28e328279970ea89819fb309033b535f1b0bd7b61a6b055b1bc +size 18300 diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile - 복사본.dds b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile - 복사본.dds new file mode 100644 index 000000000..381cd3a32 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile - 복사본.dds differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile - 복사본.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile - 복사본.png new file mode 100644 index 000000000..744e67150 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile - 복사본.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile.dds b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile.dds new file mode 100644 index 000000000..bbc1e6aae Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile.dds differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile.png new file mode 100644 index 000000000..18d3a6683 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/SkyTile.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/assimp-vc143-mt.dll b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/assimp-vc143-mt.dll new file mode 100644 index 000000000..2366a0910 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/assimp-vc143-mt.dll differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/block_Masking - 복사본.dds b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/block_Masking - 복사본.dds new file mode 100644 index 000000000..995411b24 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/block_Masking - 복사본.dds differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Box/block_Masking - 복사본.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/block_Masking - 복사본.png new file mode 100644 index 000000000..a06c63c7f Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Box/block_Masking - 복사본.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Effect/Splesh_Mesh/Splesh_Mesh1.fbx b/Jusin154_Team3D/Client/Bin/Resources/Models/Effect/Splesh_Mesh/Splesh_Mesh1.fbx new file mode 100644 index 000000000..cb603fa99 --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/Models/Effect/Splesh_Mesh/Splesh_Mesh1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f42fdff2eb45676f0e587c1e41bf2dbf9672443ef79c1557cd5962b00a887392 +size 72988 diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/Fox.fbx b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/Fox.fbx new file mode 100644 index 000000000..59df87b62 --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/Fox.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91033ee9cf3c1af4c44a2ef730e0800e137294f7f3810876d560a040f59eb7b1 +size 26270032 diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/Scavenger emit.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/Scavenger emit.png new file mode 100644 index 000000000..9db79aacf Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/Scavenger emit.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/Scavenger spec.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/Scavenger spec.png new file mode 100644 index 000000000..8eba8035d Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/Scavenger spec.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/Scavenger.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/Scavenger.png new file mode 100644 index 000000000..7b557185d Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/Scavenger.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/black.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/black.png new file mode 100644 index 000000000..894f241a8 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/black.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/bow.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/bow.png new file mode 100644 index 000000000..0c2607b43 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/bow.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/cathedral flame noise.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/cathedral flame noise.png new file mode 100644 index 000000000..8a7a8f5d2 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/cathedral flame noise.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/caustic.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/caustic.png new file mode 100644 index 000000000..65f6d0a33 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/caustic.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/clouds_normal.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/clouds_normal.png new file mode 100644 index 000000000..0ab37efa2 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/clouds_normal.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/detail texture noise.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/detail texture noise.png new file mode 100644 index 000000000..f835c27d6 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/detail texture noise.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/distorted particle ramp.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/distorted particle ramp.png new file mode 100644 index 000000000..39e8c5611 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/distorted particle ramp.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/door matcap 1.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/door matcap 1.png new file mode 100644 index 000000000..0066c80e4 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/door matcap 1.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/fox palette - runtime.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/fox palette - runtime.png new file mode 100644 index 000000000..816c9e9c6 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/fox palette - runtime.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/fox palette - runtime1.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/fox palette - runtime1.png new file mode 100644 index 000000000..fb1a3e070 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/fox palette - runtime1.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/hexagon plinth matcap.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/hexagon plinth matcap.png new file mode 100644 index 000000000..02536fa65 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/hexagon plinth matcap.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/ice detail tex.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/ice detail tex.png new file mode 100644 index 000000000..9a18dbe14 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/ice detail tex.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/icedagger_aura.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/icedagger_aura.png new file mode 100644 index 000000000..35a0022bb Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/icedagger_aura.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/icedagger_ring.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/icedagger_ring.png new file mode 100644 index 000000000..68d61a314 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/icedagger_ring.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/icedagger_ring_spikes.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/icedagger_ring_spikes.png new file mode 100644 index 000000000..736e03e06 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/icedagger_ring_spikes.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/icedagger_traces.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/icedagger_traces.png new file mode 100644 index 000000000..d0b43a9bd Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/icedagger_traces.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/key.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/key.png new file mode 100644 index 000000000..a9c238579 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/key.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/lantern arc.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/lantern arc.png new file mode 100644 index 000000000..e5976229e Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/lantern arc.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/lanterndagger albedo.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/lanterndagger albedo.png new file mode 100644 index 000000000..0d675d873 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/lanterndagger albedo.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/lanterndagger emit.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/lanterndagger emit.png new file mode 100644 index 000000000..379863b6d Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/lanterndagger emit.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/lanterndagger spec.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/lanterndagger spec.png new file mode 100644 index 000000000..a0d663f41 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/lanterndagger spec.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/potion spec.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/potion spec.png new file mode 100644 index 000000000..769e3bd0a Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/potion spec.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/potion.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/potion.png new file mode 100644 index 000000000..0ab9f8893 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/potion.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/prayersmoke textures.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/prayersmoke textures.png new file mode 100644 index 000000000..3db7d1441 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/prayersmoke textures.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/shield redux spec.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/shield redux spec.png new file mode 100644 index 000000000..b24c241c5 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/shield redux spec.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/shield redux.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/shield redux.png new file mode 100644 index 000000000..a4e95832b Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/shield redux.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/shockwave effect.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/shockwave effect.png new file mode 100644 index 000000000..2420d8491 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/shockwave effect.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/spearbeam.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/spearbeam.png new file mode 100644 index 000000000..7e1f50d4b Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/spearbeam.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/stick.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/stick.png new file mode 100644 index 000000000..c69e8d3b4 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/stick.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/sword spec.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/sword spec.png new file mode 100644 index 000000000..74d6b8aa9 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/sword spec.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/sword.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/sword.png new file mode 100644 index 000000000..77fb39756 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/sword.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/wand tentacle noise.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/wand tentacle noise.png new file mode 100644 index 000000000..430702fd7 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Fox/wand tentacle noise.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/GoblinBody.fbx b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/GoblinBody.fbx new file mode 100644 index 000000000..97a31fa83 --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/GoblinBody.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a49d1ffea2e4743cdb6f6520d4cf6103ee1aeccd4e1da6fbd39eb75aacdeeb18 +size 2030252 diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/GoblinHead.fbx b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/GoblinHead.fbx new file mode 100644 index 000000000..68c14b84f --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/GoblinHead.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b28b1bd940c28a2f562c18e52de5ef01914d588ab221194374105513fa90f62c +size 1054604 diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOB_M_Sniper_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOB_M_Sniper_D.png new file mode 100644 index 000000000..f0c80df1e Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOB_M_Sniper_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_D.png new file mode 100644 index 000000000..6ed2c9ebf Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_E.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_E.png new file mode 100644 index 000000000..4669b020d Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_E.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_MROA.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_MROA.png new file mode 100644 index 000000000..de2e4abf6 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_MROA.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_N.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_N.png new file mode 100644 index 000000000..c89e83d64 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector01_Upper_N.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_E.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_E.png new file mode 100644 index 000000000..5dbbe2dc7 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_E.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_MRO.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_MRO.png new file mode 100644 index 000000000..035ceb7c3 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_MRO.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_N.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_N.png new file mode 100644 index 000000000..d3112d6e0 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1001_N.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_E.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_E.png new file mode 100644 index 000000000..34ddde4a1 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_E.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_MRO.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_MRO.png new file mode 100644 index 000000000..42132cafe Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_MRO.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_N.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_N.png new file mode 100644 index 000000000..855cefc69 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1002_N.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1_D.png new file mode 100644 index 000000000..39b18306d Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_1_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_2_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_2_D.png new file mode 100644 index 000000000..5ff7e66a6 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_GOL_TombProtector_2_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_Spline_clouds_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_Spline_clouds_D.png new file mode 100644 index 000000000..9f9c0704f Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_Spline_clouds_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_TombProtector_DistortionPattern_A_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_TombProtector_DistortionPattern_A_D.png new file mode 100644 index 000000000..b8c7a6e9e Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_TombProtector_DistortionPattern_A_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_TombProtector_DistortionPattern_B_D.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_TombProtector_DistortionPattern_B_D.png new file mode 100644 index 000000000..73a27fef9 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/T_TombProtector_DistortionPattern_B_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/TombProtector.fbx b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/TombProtector.fbx new file mode 100644 index 000000000..28a4cecb1 --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/Models/Goblin/TombProtector.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e8ab9ac98cc040e967bfae8c42e2d57be4957844399b245973f08c7eda6c82d +size 48326476 diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/Steve.fbx b/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/Steve.fbx new file mode 100644 index 000000000..d00c20189 --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/Steve.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cef2bb7918a4bcc6f5b1ac4208b564dfb86bd79d1c1ef01f0cf7369afa8e0141 +size 5354012 diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/T_Amethyst_Scout_S.dds b/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/T_Amethyst_Scout_S.dds new file mode 100644 index 000000000..c3ca7655c Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/T_Amethyst_Scout_S.dds differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/T_Amethyst_Scout_S.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/T_Amethyst_Scout_S.png new file mode 100644 index 000000000..fcd9a483b Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/T_Amethyst_Scout_S.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/T_Amethyst_Scout_Skin.dds b/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/T_Amethyst_Scout_Skin.dds new file mode 100644 index 000000000..5a0bcedbc Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/T_Amethyst_Scout_Skin.dds differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/T_Amethyst_Scout_Skin.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/T_Amethyst_Scout_Skin.png new file mode 100644 index 000000000..003e894a1 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Steve/T_Amethyst_Scout_Skin.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Sword/Sword.fbx b/Jusin154_Team3D/Client/Bin/Resources/Models/Sword/Sword.fbx new file mode 100644 index 000000000..01f7eb9bb --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/Models/Sword/Sword.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:51f2fbdcd11d1d456b0d790b055890bff8c304f11cf18b7550ca77d25011b229 +size 30732 diff --git a/Jusin154_Team3D/Client/Bin/Resources/Models/Sword/sword.png b/Jusin154_Team3D/Client/Bin/Resources/Models/Sword/sword.png new file mode 100644 index 000000000..77fb39756 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Models/Sword/sword.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl new file mode 100644 index 000000000..d49417481 --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -0,0 +1,64 @@ + +struct Particle +{ + float4 vRight; + float4 vUp; + float4 vLook; + float4 vTranslation; + + float2 vLifeTime; +}; + +struct ParticleValue +{ + float fSpeed; + float fRotaionSpeed; + + float4 vOriginRight; + float4 vOriginUp; + float4 vOriginLook; + float4 vOriginTranslation; + + float2 fPadding; +}; + + +StructuredBuffer g_ParticleBufferInput : register(t0); +StructuredBuffer g_ParticleValueBufferInput : register(t1); + +RWStructuredBuffer g_ParticleBufferOutput : register(u0); + +cbuffer g_ConstantBuffer : register(b0) // b0 << ì�´ 숫ìž�와 컨스턴트 ì‰�ì�´ë�” ë°”ì�¸ë”©í• ë•Œ ì�¸ë�±ìŠ¤ê°€ ë�™ì�¼í•´ì•¼í•¨ +{ + float fTimeDelta; + + float fPadding; // 반드시 ìƒ�수버í�¼ëŠ” 16ë°”ì�´íЏ 배수로 만들어져야 한다. + float fPadding2; + float fPadding3; +} + +//ë‚´ê°€ 몇개ì�˜ 스레드를 사용할 것ì�¸ì§€ 지정하는ë�° +//GPU 칩ì�˜ 개수를 X * Y * Zì�˜ 개수 ë§Œí�¼ 사용하겠다는 ì�˜ë¯¸ì�´ë‹¤. +[numthreads(256, 1, 1)] +void CS_MAIN( + uint3 DispatchThreadID : SV_DispatchThreadID) +{ + int iIndex = DispatchThreadID.x; // ë°°ì—´ ì�¸ë�±ìФ + + Particle particle = g_ParticleBufferInput[iIndex]; + + ParticleValue particleValue = g_ParticleValueBufferInput[iIndex]; + + particle.vTranslation.y -= particleValue.fSpeed * fTimeDelta; + + particle.vLifeTime.x += fTimeDelta; + + if (particle.vLifeTime.x >= particle.vLifeTime.y) + { + particle.vLifeTime.x = 0.f; + particle.vTranslation.y = 0.f; + } + + g_ParticleBufferOutput[iIndex] = particle; + +} diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl new file mode 100644 index 000000000..a12d937b3 --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -0,0 +1,316 @@ + +#include "Engine_Shader_Defines.hlsli" + +matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; + +bool g_bRimLight; +bool g_bUseNormalMap; + +float g_fFar; +float g_LifeRatio; +float g_fRimStrength; +float g_fRimPower; +float3 g_vRimColor; +vector g_vCamPosition; + +Texture2D g_DiffuseTexture; +Texture2D g_NormalTexture; + +matrix g_BoneMatrices[512]; + + +struct VS_IN +{ + float3 vPosition : POSITION; + float3 vNormal : NORMAL; + float3 vTangent : TANGENT; + float3 vBinormal : BINORMAL; + float2 vTexcoord : TEXCOORD0; + + uint4 vBlendIndex : BLENDINDEX; + float4 vBlendWeight : BLENDWEIGHT; +}; + +struct VS_OUT +{ + float4 vPosition : SV_Position; + float3 vNormal : NORMAL; + float3 vTangent : TANGENT; + float3 vBinormal : BINORMAL; + float2 vTexcoord : TEXCOORD0; + float4 vWorldPos : TEXCOORD1; + float4 vProjPos : TEXCOORD2; +}; + +VS_OUT VS_MAIN(VS_IN In) +{ + VS_OUT Out; + + float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z); + + matrix BoneMatrix = + mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x) + + mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y) + + mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z) + + mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW); + + vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); + vector vNormal = mul(vector(In.vNormal, 0.f), BoneMatrix); + vector vBinormal = mul(vector(In.vBinormal, 0.f), BoneMatrix); + vector vTangent = mul(vector(In.vTangent, 0.f), BoneMatrix); + + + matrix matWV, matWVP; + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vPosition, matWVP); + Out.vNormal = normalize(mul(vNormal, g_WorldMatrix)).xyz; + Out.vBinormal = normalize(mul(vBinormal, g_WorldMatrix)).xyz; + Out.vTangent = normalize(mul(vTangent, g_WorldMatrix)).xyz; + Out.vTexcoord = In.vTexcoord; + Out.vWorldPos = mul(vPosition, g_WorldMatrix); + Out.vProjPos = Out.vPosition; + return Out; +} + +struct VS_OUT_CAPTUREDMODEL +{ + float4 vPosition : SV_Position; + float2 vTexcoord : TEXCOORD0; +}; + +struct VS_OUT_BLUR +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; +}; + +VS_OUT_CAPTUREDMODEL VS_CAPTUREDMODEL(VS_IN In) +{ + VS_OUT_CAPTUREDMODEL Out; + + float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z); + + matrix BoneMatrix = + mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x ) + + mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y ) + + mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z ) + + mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW); + + vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); + + matrix matWV, matWVP; + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vPosition, matWVP); + Out.vTexcoord = In.vTexcoord; + return Out; +} + +VS_OUT_BLUR VS_MAIN_BLUR(VS_IN In) +{ + VS_OUT_BLUR Out; + + float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z); + + matrix BoneMatrix = + mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x) + + mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y) + + mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z) + + mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW); + + vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); + + matrix matWV, matWVP; + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vPosition, matWVP); + Out.vTexcoord = In.vTexcoord; + + return Out; +} + +struct VS_OUT_SHADOW +{ + float4 vPosition : SV_POSITION; + float4 vProjPos : TEXCOORD0; +}; + +VS_OUT_SHADOW VS_MAIN_SHADOW(VS_IN In) +{ + VS_OUT_SHADOW Out; + + float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z); + + matrix BoneMatrix = g_BoneMatrices[In.vBlendIndex.x] * In.vBlendWeight.x + + g_BoneMatrices[In.vBlendIndex.y] * In.vBlendWeight.y + + g_BoneMatrices[In.vBlendIndex.z] * In.vBlendWeight.z + + g_BoneMatrices[In.vBlendIndex.w] * fWeightW; + + /* 스키ë‹� */ + vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix); + + matrix matWV, matWVP; + + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vPosition, matWVP); + Out.vProjPos = Out.vPosition; + + return Out; +} + +struct PS_IN +{ + float4 vPosition : SV_Position; + float3 vNormal : NORMAL; + float3 vTangent : TANGENT; + float3 vBinormal : BINORMAL; + float2 vTexcoord : TEXCOORD0; + float4 vWorldPos : TEXCOORD1; + float4 vProjPos : TEXCOORD2; +}; + +struct PS_OUT +{ + float4 vDiffuse : SV_TARGET0; + float4 vNormal : SV_TARGET1; + float4 vDepth : SV_TARGET2; +}; + +PS_OUT PS_MAIN(PS_IN In) +{ + PS_OUT Out; + + vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + if (vMtrlDiffuse.a < 0.4f) + { + discard; + } + + vector vNormalDesc = g_NormalTexture.Sample(MirrorSampler, In.vTexcoord); + float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal); + + float3 vNormal = mul(vNormalDesc.xyz * 2.f - 1.f, WorldMatrix); + + if (true == g_bRimLight) + { + float fRimLight = GetRimLight(g_vCamPosition.xyz, In.vWorldPos.xyz, vNormal, g_fRimPower, g_fRimStrength); + vMtrlDiffuse.xyz = (vMtrlDiffuse.xyz * (1 - fRimLight)) + g_vRimColor * fRimLight; + } + + + Out.vDiffuse = vMtrlDiffuse; + Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f); + Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 1.f); + + + return Out; +} + +struct PS_IN_SHADOW +{ + float4 vPosition : SV_POSITION; + float4 vProjPos : TEXCOORD0; +}; + +struct PS_OUT_SHADOW +{ + float4 vShadowLightDepth : SV_TARGET0; +}; + +PS_OUT_SHADOW PS_MAIN_SHADOW(PS_IN_SHADOW In) +{ + PS_OUT_SHADOW Out = (PS_OUT_SHADOW) 0; + + Out.vShadowLightDepth.x = In.vProjPos.z; + + return Out; +} + +struct PS_IN_CAPTUREDMODEL +{ + float4 vPosition : SV_Position; + float2 vTexcoord : TEXCOORD0; +}; +struct PS_OUT_CAPTUREDMODEL +{ + float4 vColor : SV_TARGET0; +}; + +PS_OUT_CAPTUREDMODEL PS_CAPTUREDMODEL(PS_IN_CAPTUREDMODEL In) +{ + PS_OUT_CAPTUREDMODEL Out = (PS_OUT_CAPTUREDMODEL) 0; + + Out.vColor = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + Out.vColor.a = saturate(1 - g_LifeRatio) * 0.5f; + return Out; +} + +struct PS_IN_BLUR +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; +}; +struct PS_OUT_BLUR +{ + float4 vDiffuse : SV_TARGET0; +}; + +PS_OUT_BLUR PS_MAIN_BLUR(PS_IN_BLUR In) +{ + PS_OUT_BLUR Out = (PS_OUT_BLUR) 0; + + vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + + Out.vDiffuse = saturate(vMtrlDiffuse); + + return Out; +} + + +technique11 DefaultTechnique +{ + pass Default + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN(); + } + + pass ShadowPass + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN_SHADOW(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN_SHADOW(); + } + + pass CAPTUREDMODELPASS + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_Effect, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_CAPTUREDMODEL(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_CAPTUREDMODEL(); + } + pass BlurPass // 9 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN_BLUR(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN_BLUR(); + } +} diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl new file mode 100644 index 000000000..a998225a8 --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl @@ -0,0 +1,420 @@ + +#include "Engine_Shader_Defines.hlsli" + +matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; + +bool g_bUVTargetDiffuse; +bool g_bAdditiveDisolve; +float g_LifeRatio; +float g_fFar; +float g_fTime; +float g_fDeltaU; +float g_fDeltaV; +uint g_iIndexU; +uint g_iIndexV; + +float g_fDisolveRatio; + +float2 g_vClipBoxSize; +float2 g_vClipBoxLTPos; + +Texture2D g_DiffuseTexture; +Texture2D g_MaskingTexture; +Texture2D g_ClippingTexture; +Texture2D g_DisolveTexture; +Texture2D g_NormalTexture; + +struct VS_IN +{ + float3 vPosition : POSITION; + float3 vNormal : NORMAL; + float3 vTangent : TANGENT; + float3 vBinormal : BINORMAL; + float2 vTexcoord : TEXCOORD0; +}; + +struct VS_OUT +{ + float4 vPosition : SV_POSITION; + float3 vNormal : NORMAL; + float3 vTangent : TANGENT; + float3 vBinormal : BINORMAL; + float2 vTexcoord : TEXCOORD0; + float4 vWorldPos : TEXCOORD1; + float4 vProjPos : TEXCOORD2; +}; + +struct VS_OUT_BLUR +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; +}; + +struct VS_OUT_SHADOW +{ + float4 vPosition : SV_POSITION; + float4 vProjPos : TEXCOORD0; +}; + + +VS_OUT_BLUR VS_MAIN_BLUR(VS_IN In) +{ + VS_OUT_BLUR Out; + + matrix matWV, matWVP; + + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP); + Out.vTexcoord = In.vTexcoord; + + return Out; +} + +VS_OUT_SHADOW VS_MAIN_SHADOW(VS_IN In) +{ + VS_OUT_SHADOW Out; + + matrix matWV, matWVP; + + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP); + Out.vProjPos = Out.vPosition; + + return Out; +} +VS_OUT VS_MAIN(VS_IN In) +{ + VS_OUT Out; + + matrix matWV, matWVP; + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP); + Out.vNormal = normalize(mul(vector(In.vNormal, 0.f), g_WorldMatrix)).xyz; + Out.vTangent = normalize(mul(vector(In.vTangent, 0.f), g_WorldMatrix)).xyz; + Out.vBinormal = normalize(mul(vector(In.vBinormal, 0.f), g_WorldMatrix)).xyz; + Out.vTexcoord = In.vTexcoord; + Out.vWorldPos = mul(vector(In.vPosition, 1.f), g_WorldMatrix); + Out.vProjPos = Out.vPosition; + return Out; +} + +struct VS_OUT_EFFECT +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; +}; +VS_OUT_EFFECT VS_EFFECT(VS_IN In) +{ + VS_OUT_EFFECT Out; + + matrix matWV, matWVP; + + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP); + Out.vTexcoord = In.vTexcoord; + + return Out; +} +struct VS_OUT_CAPTUREDMODEL +{ + float4 vPosition : SV_Position; + float2 vTexcoord : TEXCOORD0; +}; + +VS_OUT_CAPTUREDMODEL VS_CAPTUREDMODEL(VS_IN In) +{ + VS_OUT_CAPTUREDMODEL Out; + + matrix matWV, matWVP; + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP); + Out.vTexcoord = In.vTexcoord; + return Out; +} +struct PS_IN +{ + float4 vPosition : SV_POSITION; + float3 vNormal : NORMAL; + float3 vTangent : TANGENT; + float3 vBinormal : BINORMAL; + float2 vTexcoord : TEXCOORD0; + float4 vWorldPos : TEXCOORD1; + float4 vProjPos : TEXCOORD2; +}; + +struct PS_OUT +{ + float4 vDiffuse : SV_TARGET0; + float4 vNormal : SV_TARGET1; + float4 vDepth : SV_TARGET2; +}; +PS_OUT PS_MAIN(PS_IN In) +{ + PS_OUT Out; + + vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + if (vMtrlDiffuse.a < 0.4f) + { + discard; + } + + vector vNormalDesc = g_NormalTexture.Sample(MirrorSampler, In.vTexcoord); + float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal); + + float3 vNormal = mul(vNormalDesc.xyz * 2.f - 1.f, WorldMatrix); + + Out.vDiffuse = vMtrlDiffuse; + Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f); + Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 1.f); + return Out; +} + +struct PS_IN_SHADOW +{ + float4 vPosition : SV_POSITION; + float4 vProjPos : TEXCOORD0; +}; + +struct PS_OUT_SHADOW +{ + float4 vShadowLightDepth : SV_TARGET0; +}; + +struct PS_IN_BLUR +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; +}; +struct PS_OUT_BLUR +{ + float4 vDiffuse : SV_TARGET0; +}; + + +PS_OUT_BLUR PS_MAIN_BLUR(PS_IN_BLUR In) +{ + PS_OUT_BLUR Out = (PS_OUT_BLUR) 0; + + vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + + Out.vDiffuse = saturate(vMtrlDiffuse); + + return Out; +} + +PS_OUT_SHADOW PS_MAIN_SHADOW(PS_IN_SHADOW In) +{ + PS_OUT_SHADOW Out = (PS_OUT_SHADOW) 0; + + Out.vShadowLightDepth.x = In.vProjPos.z; + + return Out; +} + +struct PS_IN_EFFECT +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; +}; +struct PS_OUT_EFFECT +{ + float4 vColor : SV_TARGET0; +}; + + +PS_OUT_EFFECT PS_EFFECT_UVMOVE(PS_IN_EFFECT In) +{ + PS_OUT_EFFECT Out; + + float2 vMovedUV = Get_MovedUV(In.vTexcoord, g_fDeltaU, g_fDeltaV, g_iIndexU, g_iIndexV); + + vector vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, vMovedUV); + + if (vDiffuse.a < 0.01f) + { + discard; + } + + Out.vColor = vDiffuse; + + return Out; +} + +PS_OUT_EFFECT PS_EFFECT(PS_IN_EFFECT In) +{ + PS_OUT_EFFECT Out; + + float2 uv = In.vTexcoord; + float2 vClipBoxUV = g_vClipBoxLTPos + g_vClipBoxSize * In.vTexcoord; + uv.x += g_fDeltaU * g_fTime; + uv.y += g_fDeltaV * g_fTime; + + vector vDiffuse; + vector vMasking; + vector vClipCell = g_ClippingTexture.Sample(DefaultSampler, vClipBoxUV); + vector vDisolveCell = g_DisolveTexture.Sample(DefaultSampler, In.vTexcoord); + if (true == g_bUVTargetDiffuse) + { + vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, uv); + vMasking = g_MaskingTexture.Sample(DefaultSampler, In.vTexcoord); + } + else + { + vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + vMasking = g_MaskingTexture.Sample(DefaultSampler, uv); + } + if (true == g_bAdditiveDisolve) + { + vDiffuse.a = saturate(vDiffuse.a * vMasking.r * vClipCell.r + vDisolveCell.r * g_fDisolveRatio); + } + else + { + vDiffuse.a = saturate(vDiffuse.a * vMasking.r * vClipCell.r - vDisolveCell.r * g_fDisolveRatio); + } + + if (vDiffuse.a < 0.01f) + { + discard; + } + + Out.vColor = vDiffuse; + + return Out; +} + +struct PS_IN_CAPTUREDMODEL +{ + float4 vPosition : SV_Position; + float2 vTexcoord : TEXCOORD0; +}; +struct PS_OUT_CAPTUREDMODEL +{ + float4 vColor : SV_TARGET0; +}; + +PS_OUT_CAPTUREDMODEL PS_CAPTUREDMODEL(PS_IN_CAPTUREDMODEL In) +{ + PS_OUT_CAPTUREDMODEL Out = (PS_OUT_CAPTUREDMODEL) 0; + + Out.vColor = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + Out.vColor.a = saturate(1 - g_LifeRatio) * 0.5f; + return Out; +} +technique11 MeshTechnique11 +{ + pass MeshPass // 0 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN(); + } + + pass ShadowPass + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN_SHADOW(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN_SHADOW(); + } + + pass SkyBoxPass // 2 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN(); + } + + pass ALPHABlendPass // 3 + { + SetRasterizerState(RS_Nocull_Wireframe); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN(); + } + + + + pass EffectPass_AlphaBlend // 4 + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_Effect, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_EFFECT(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_EFFECT(); + } + pass EffectPass_Blend // 5 + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_Effect, 0); + SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_EFFECT(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_EFFECT(); + } + pass EffectPass_AlphaBlend_Cull // 6 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Effect, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_EFFECT(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_EFFECT(); + } + pass EffectPass_Blend_Cull // 7 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Effect, 0); + SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_EFFECT(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_EFFECT(); + } + pass CAPTUREDMODELPASS // 8 + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_Effect, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_CAPTUREDMODEL(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_CAPTUREDMODEL(); + } + pass BlurPass // 9 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN_BLUR(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN_BLUR(); + } + pass UVMovePass + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_Effect, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_EFFECT(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_EFFECT_UVMOVE(); + } +} diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl new file mode 100644 index 000000000..8ad3f4123 --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl @@ -0,0 +1,166 @@ +#include "Engine_Shader_Defines.hlsli" + +matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; + +Texture2D g_DiffuseTexture; +Texture2D g_NormalTexture; +Texture2D g_MaskingTexture; +Texture2D g_DissolveTexture; + +float4 g_vCamPosition; +vector g_vColor; +float2 g_vUVGain; + +float g_fFar; + +struct VS_IN +{ + float3 vPosition : POSITION; + float3 vNormal : NORMAL; + float3 vTangent : TANGENT; + float3 vBinormal : BINORMAL; + float2 vTexcoord : TEXCOORD0; + + float4 vRight : TEXCOORD1; + float4 vUp : TEXCOORD2; + float4 vLook : TEXCOORD3; + float4 vTranslation : TEXCOORD4; + float2 vLifeTime : TEXCOORD5; +}; + +struct VS_OUT +{ + float4 vPosition : SV_POSITION; + float4 vNormal : NORMAL; + float3 vTangent : TANGENT; + float3 vBinormal : BINORMAL; + float2 vTexcoord : TEXCOORD0; + float2 vLifeTime : TEXCOORD1; + float4 vWorldPos : TEXCOORD2; + float4 vProjPos : TEXCOORD3; +}; + +VS_OUT VS_MAIN(VS_IN In) +{ + VS_OUT Out = (VS_OUT) 0; + + matrix matWV, matWVP; + + matWV = mul(g_WorldMatrix, g_ViewMatrix); + + float4 vProjPos = vector(In.vPosition, 1.f); + + Out.vPosition = mul(vProjPos, matWVP); + Out.vProjPos = vProjPos; + + matWVP = mul(matWV, g_ProjMatrix); + + matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation); + + vector vPosition = mul(vector(In.vPosition, 1.f), TransformMatrix); + + Out.vPosition = mul(vPosition, matWVP); + Out.vNormal = normalize(mul(vector(In.vNormal, 0.f), TransformMatrix)); + Out.vTangent = normalize(mul(vector(In.vTangent, 0.f), TransformMatrix)).xyz; + Out.vBinormal = normalize(mul(vector(In.vBinormal, 0.f), TransformMatrix)).xyz; + Out.vTexcoord = In.vTexcoord; + Out.vLifeTime = In.vLifeTime; + Out.vWorldPos = mul(vector(In.vPosition, 1.f), g_WorldMatrix); + + + return Out; +} + +struct PS_IN +{ + float4 vPosition : SV_POSITION; + float4 vNormal : NORMAL; + float3 vTangent : TANGENT; + float3 vBinormal : BINORMAL; + float2 vTexcoord : TEXCOORD0; + float2 vLifeTime : TEXCOORD1; + float4 vWorldPos : TEXCOORD2; + float4 vProjPos : TEXCOORD3; +}; + +struct PS_OUT +{ + float4 vDiffuse : SV_TARGET0; + float4 vNormal : SV_TARGET1; + float4 vDepth : SV_TARGET2; +}; + +PS_OUT PS_MAIN(PS_IN In) +{ + + PS_OUT Out; + vector vMtrlDiffuse; + + vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + + vector vMtrlNormal = g_NormalTexture.Sample(DefaultSampler, In.vTexcoord); + + float3x3 NormalMap_WorldMatrix = float3x3(In.vTangent, In.vBinormal, In.vNormal.xyz); + + float3 vNormal = mul(vMtrlNormal.xyz * 2.f - 1.f, NormalMap_WorldMatrix); + + + Out.vNormal = float4(vNormal.xyz * 0.5f + 0.5f, 0.f); + Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f); + + if (vMtrlDiffuse.a < 0.3f) + discard; + + Out.vDiffuse.a = saturate(In.vLifeTime.y - In.vLifeTime.x); + Out.vDiffuse = vMtrlDiffuse; + + return Out; +} + +PS_OUT PS_NON_NORMALMAP(PS_IN In) +{ + + PS_OUT Out; + + vector vMtrlDiffuse; + + vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + + if (vMtrlDiffuse.a < 0.3f) + discard; + + Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f); + Out.vNormal = In.vNormal; + + Out.vDiffuse.a = saturate(In.vLifeTime.y - In.vLifeTime.x); + Out.vDiffuse = vMtrlDiffuse; + + return Out; +} + + + + +technique11 DefaultTechnique +{ + pass Model + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN(); + } + + pass NON_NOMALMAP + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_NON_NORMALMAP(); + } + +} diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl new file mode 100644 index 000000000..8e8ba0f5d --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl @@ -0,0 +1,96 @@ + +#include "Engine_Shader_Defines.hlsli" + +matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; + +float g_fFar; + +Texture2D g_DiffuseTexture; + +struct VS_IN +{ + float3 vPosition : POSITION; + float3 vNormal : NORMAL; + float2 vTexcoord : TEXCOORD0; +}; + +struct VS_OUT +{ + float4 vPosition : SV_POSITION; + float4 vNormal : NORMAL; + float2 vTexcoord : TEXCOORD0; + float4 vWorldPos : TEXCOORD1; + float4 vProjPos : TEXCOORD2; +}; + +VS_OUT VS_MAIN(VS_IN In) +{ + VS_OUT Out; + + + matrix matWV, matWVP; + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP); + Out.vTexcoord = In.vTexcoord; + Out.vNormal = normalize(mul(vector(In.vNormal, 0.f), g_WorldMatrix)); + Out.vWorldPos = mul(vector(In.vPosition, 1.f), g_WorldMatrix); + Out.vProjPos = Out.vPosition; + return Out; +} + +struct PS_IN +{ + float4 vPosition : SV_POSITION; + float4 vNormal : NORMAL; + float2 vTexcoord : TEXCOORD0; + float4 vWorldPos : TEXCOORD1; + float4 vProjPos : TEXCOORD2; +}; + +struct PS_OUT +{ + float4 vDiffuse : SV_TARGET0; + float4 vNormal : SV_TARGET1; + float4 vDepth : SV_TARGET2; +}; + +PS_OUT PS_MAIN(PS_IN In) +{ + PS_OUT Out; + + vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord * 30.f); + if (vMtrlDiffuse.a < 0.4f) + { + discard; + } + Out.vDiffuse = vMtrlDiffuse; + + Out.vNormal = float4(In.vNormal.xyz * 0.5f + 0.5f, 0.f); + Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 1.0f); + return Out; +} + +technique11 NorTexTechnique11 +{ + pass NorTexPass + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN(); + } + pass TerrainPass + { + SetRasterizerState(RS_Nocull_Wireframe); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN(); + } + +} diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxPointParticle.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxPointParticle.hlsl new file mode 100644 index 000000000..fa437b1a4 --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxPointParticle.hlsl @@ -0,0 +1,148 @@ +#include "Engine_Shader_Defines.hlsli" + +matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; + +float g_fDeltaU; +float g_fDeltaV; +uint g_iIndexU; +uint g_iIndexV; + +Texture2D g_DiffuseTexture; +Texture2D g_MaskingTexture; +Texture2D g_DisolveTexture; +vector g_vCamPosition; + + +struct VS_IN +{ + float3 vPosition : POSITION; + + row_major float4x4 TransformMatrix : WORLD; + + float2 vLifeTime : TEXCOORD0; +}; + +struct VS_OUT +{ + float4 vPosition : POSITION; + float fSize : PSIZE; + float2 vLifeTime : TEXCOORD0; +}; + +VS_OUT VS_MAIN(VS_IN In) +{ + VS_OUT Out; + + vector vPosition = mul(vector(In.vPosition, 1.f), In.TransformMatrix); + + Out.vPosition = mul(vPosition, g_WorldMatrix); + Out.fSize = length(In.TransformMatrix._11_12_13); + Out.vLifeTime = In.vLifeTime; + + return Out; +} + +struct GS_IN +{ + float4 vPosition : POSITION; + float fSize : PSIZE; + float2 vLifeTime : TEXCOORD0; +}; + +struct GS_OUT +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; + float2 vLifeTime : TEXCOORD1; +}; + +//GS_MAIN(triangle GS_INIn[3]) +//GS_MAIN(line GS_IN In[2]) + +[maxvertexcount(6)] +void GS_MAIN(point GS_IN In[1], inout TriangleStream OutStream) +{ + GS_OUT Out[4]; + + float3 vLook = (g_vCamPosition - In[0].vPosition).xyz; + float3 vRight = normalize(cross(float3(0.f, 1.f, 0.f), vLook)) * In[0].fSize * 0.5f; + float3 vUp = normalize(cross(vLook, vRight)) * In[0].fSize * 0.5f; + + + matrix matVP = mul(g_ViewMatrix, g_ProjMatrix); + + Out[0].vPosition = mul(float4(In[0].vPosition.xyz + vRight + vUp, 1.f), matVP); + Out[0].vTexcoord = float2(0.f, 0.f); + Out[0].vLifeTime = In[0].vLifeTime; + + Out[1].vPosition = mul(float4(In[0].vPosition.xyz - vRight + vUp, 1.f), matVP); + Out[1].vTexcoord = float2(1.f, 0.f); + Out[1].vLifeTime = In[0].vLifeTime; + + Out[2].vPosition = mul(float4(In[0].vPosition.xyz - vRight - vUp, 1.f), matVP); + Out[2].vTexcoord = float2(1.f, 1.f); + Out[2].vLifeTime = In[0].vLifeTime; + + Out[3].vPosition = mul(float4(In[0].vPosition.xyz + vRight - vUp, 1.f), matVP); + Out[3].vTexcoord = float2(0.f, 1.f); + Out[3].vLifeTime = In[0].vLifeTime; + + + OutStream.Append(Out[0]); + OutStream.Append(Out[1]); + OutStream.Append(Out[2]); + OutStream.RestartStrip(); + + OutStream.Append(Out[0]); + OutStream.Append(Out[2]); + OutStream.Append(Out[3]); + OutStream.RestartStrip(); +} + +/* 출력ë�œ ì •ì � 위치벡터ì�˜ w값으로 모든 성분ì�„ 나눈다 -> 투ì˜�스페ì�´ìŠ¤ë¡œ 변환 */ +/* ì •ì �ì�˜ 위치ì—� 대해서 ë·°í�¬íЏ 변환ì�„ 수행한다 */ +/* ì •ì �ì�˜ 모든 정보를 보간하여 픽셀ì�„ 만든다. -> 래스터ë�¼ì�´ì¦ˆ */ + +struct PS_IN +{ + float4 vPosition : SV_POSITION; + float2 vTexcoord : TEXCOORD0; + float2 vLifeTime : TEXCOORD1; +}; + +struct PS_OUT +{ + float4 vColor : SV_TARGET0; +}; + + + +/* 픽셀 ì‰�ì�´ë�” : 픽셀ì�˜ 최종ì �ì�¸ 색ì�„ 결정하낟. */ +PS_OUT PS_MAIN(PS_IN In) +{ + PS_OUT Out; + + float2 vMovedUV = Get_MovedUV(In.vTexcoord, g_fDeltaU, g_fDeltaV, g_iIndexU, g_iIndexV); + + vector vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, vMovedUV); + vector vMask = g_MaskingTexture.Sample(DefaultSampler, In.vTexcoord); + vector vDisolve = g_DisolveTexture.Sample(DefaultSampler, In.vTexcoord); + + vDiffuse.a = saturate(vDiffuse.a * vMask.r - vDisolve.r * (2.f * In.vLifeTime.x / In.vLifeTime.y)); + Out.vColor = vDiffuse; + return Out; +} + +technique11 DefaultTechnique +{ + pass Explosion + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_Effect, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = compile gs_5_0 GS_MAIN(); + PixelShader = compile ps_5_0 PS_MAIN(); + } + +} diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl new file mode 100644 index 000000000..784af5a0e --- /dev/null +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl @@ -0,0 +1,137 @@ + +#include "Engine_Shader_Defines.hlsli" + +matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; +Texture2D g_DepthTexture; + +float g_fFar; +float g_fDeltaU; +float g_fDeltaV; +uint g_iIndexU; +uint g_iIndexV; + +Texture2D g_Texture; +Texture2D g_DiffuseTexture; +Texture2D g_MaskingTexture; + + +struct VS_IN +{ + float3 vPosition : POSITION; + float2 vTexcoord : TEXCOORD0; +}; + +struct VS_OUT +{ + float4 vPosition : SV_Position; + float2 vTexcoord : TEXCOORD0; +}; + +VS_OUT VS_MAIN(VS_IN In) +{ + VS_OUT Out; + + + matrix matWV, matWVP; + matWV = mul(g_WorldMatrix, g_ViewMatrix); + matWVP = mul(matWV, g_ProjMatrix); + + Out.vPosition = mul(vector(In.vPosition, 1.f), matWVP); + Out.vTexcoord = In.vTexcoord; + + return Out; +} + +struct PS_IN +{ + float4 vPosition : SV_Position; + float2 vTexcoord : TEXCOORD0; +}; + +struct PS_OUT +{ + float4 vColor : SV_Target0; +}; + +PS_OUT PS_MAIN(PS_IN In) +{ + PS_OUT Out; + + Out.vColor = g_Texture.Sample(DefaultSampler, In.vTexcoord); + + return Out; +} +PS_OUT PS_UVMove(PS_IN In) +{ + PS_OUT Out; + + float2 vMovedUV = Get_MovedUV(In.vTexcoord, g_fDeltaU, g_fDeltaV, g_iIndexU, g_iIndexV); + + Out.vColor = g_Texture.Sample(DefaultSampler, vMovedUV); + clip(Out.vColor.a - 0.01f); + + return Out; +} +PS_OUT PS_Trail(PS_IN In) +{ + PS_OUT Out; + + vector vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + vector vMasking = g_MaskingTexture.Sample(DefaultSampler, In.vTexcoord); + + vDiffuse.a = vDiffuse.a * vMasking.r; + Out.vColor = vDiffuse; + Out.vColor.a *= In.vTexcoord.x; + clip(Out.vColor.a - 0.01f); + return Out; +} + + +technique11 PosTexTechnique11 +{ + pass PosTexPass + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN(); + } + pass ScissorPass + { + SetRasterizerState(RS_Scissor); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN(); + } + pass UIPass + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_UIBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN(); + } + pass UVMovePass + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_UVMove(); + } + pass TrailPass + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_Trail(); + } +} diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_CursorRings.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_CursorRings.png new file mode 100644 index 000000000..2da94a709 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_CursorRings.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_Cursor_Inner_Circles.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_Cursor_Inner_Circles.png new file mode 100644 index 000000000..3c82057c7 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_Cursor_Inner_Circles.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_MenuCursor.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_MenuCursor.png new file mode 100644 index 000000000..86443929a Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_MenuCursor.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_menuCursor_Map.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_menuCursor_Map.png new file mode 100644 index 000000000..5f45ada72 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_menuCursor_Map.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_menuCursor_inner.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_menuCursor_inner.png new file mode 100644 index 000000000..c9e1b2bb4 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_menuCursor_inner.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_menuCursor_innerDots.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_menuCursor_innerDots.png new file mode 100644 index 000000000..e6f2cc3d1 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Cursor/UI_T_menuCursor_innerDots.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/DororongDoro.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/DororongDoro.png new file mode 100644 index 000000000..0d4a2a2cf Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/DororongDoro.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Test/VFX_T_Noise08_D.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Test/VFX_T_Noise08_D.png new file mode 100644 index 000000000..7c1ae0e40 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Effect/Test/VFX_T_Noise08_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_0.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_0.png new file mode 100644 index 000000000..305e052f0 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_0.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_1.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_1.png new file mode 100644 index 000000000..c071cbdf7 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_1.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_2.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_2.png new file mode 100644 index 000000000..c1a0cb9de Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_2.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_3.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_3.png new file mode 100644 index 000000000..c367675c1 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_3.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_4.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_4.png new file mode 100644 index 000000000..4fbc9d801 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_4.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_5.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_5.png new file mode 100644 index 000000000..0ee235101 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_5.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_6.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_6.png new file mode 100644 index 000000000..5789148ca Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_6.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_7.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_7.png new file mode 100644 index 000000000..f472a4159 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_7.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_8.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_8.png new file mode 100644 index 000000000..60ab386b6 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_8.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_9.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_9.png new file mode 100644 index 000000000..aa9fb8e18 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_9.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_A.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_A.png new file mode 100644 index 000000000..469c9c486 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_A.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Alt.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Alt.png new file mode 100644 index 000000000..c57e4c1f6 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Alt.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Alt_L.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Alt_L.png new file mode 100644 index 000000000..4c8c2ef9a Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Alt_L.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Alt_R.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Alt_R.png new file mode 100644 index 000000000..c57473f75 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Alt_R.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_B.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_B.png new file mode 100644 index 000000000..11cff9696 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_B.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Backspace.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Backspace.png new file mode 100644 index 000000000..1c7574030 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Backspace.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_C.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_C.png new file mode 100644 index 000000000..e7ddca263 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_C.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Control.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Control.png new file mode 100644 index 000000000..6dceace52 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Control.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Control_L.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Control_L.png new file mode 100644 index 000000000..6d9f8ee5c Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Control_L.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Control_R.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Control_R.png new file mode 100644 index 000000000..d9138ef5f Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Control_R.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_D.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_D.png new file mode 100644 index 000000000..cd4f5acb3 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_D.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_E.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_E.png new file mode 100644 index 000000000..a8ab21dfc Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_E.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Enter.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Enter.png new file mode 100644 index 000000000..6be4e6bae Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Enter.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Esc.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Esc.png new file mode 100644 index 000000000..656348a89 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Esc.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F.png new file mode 100644 index 000000000..6dd64fe76 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F1.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F1.png new file mode 100644 index 000000000..abc4511f9 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F1.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F10.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F10.png new file mode 100644 index 000000000..2809f6939 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F10.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F11.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F11.png new file mode 100644 index 000000000..22e7139cb Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F11.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F12.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F12.png new file mode 100644 index 000000000..583aea4d6 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F12.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F2.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F2.png new file mode 100644 index 000000000..9d92761f3 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F2.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F3.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F3.png new file mode 100644 index 000000000..cb0bd6abe Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F3.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F4.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F4.png new file mode 100644 index 000000000..e541065ce Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F4.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F5.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F5.png new file mode 100644 index 000000000..e0fa3e4ba Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F5.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F6.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F6.png new file mode 100644 index 000000000..b76c9c0ac Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F6.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F7.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F7.png new file mode 100644 index 000000000..79ebc9ec6 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F7.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F8.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F8.png new file mode 100644 index 000000000..346a1b525 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F8.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F9.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F9.png new file mode 100644 index 000000000..d08c1321c Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_F9.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_G.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_G.png new file mode 100644 index 000000000..75207f7d6 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_G.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_H.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_H.png new file mode 100644 index 000000000..a49dfe78f Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_H.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_I.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_I.png new file mode 100644 index 000000000..b05b733e4 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_I.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_J.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_J.png new file mode 100644 index 000000000..f5da4556d Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_J.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_K.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_K.png new file mode 100644 index 000000000..3891e4c47 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_K.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_L.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_L.png new file mode 100644 index 000000000..2fbb9b04d Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_L.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Left.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Left.png new file mode 100644 index 000000000..1d0beaa75 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Left.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_M.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_M.png new file mode 100644 index 000000000..e889e6250 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_M.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_N.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_N.png new file mode 100644 index 000000000..dfc6db30c Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_N.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_O.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_O.png new file mode 100644 index 000000000..be98fca22 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_O.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_P.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_P.png new file mode 100644 index 000000000..eea392902 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_P.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Q.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Q.png new file mode 100644 index 000000000..963813ba0 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Q.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_R.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_R.png new file mode 100644 index 000000000..29b4c96e1 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_R.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Right.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Right.png new file mode 100644 index 000000000..296b051f8 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Right.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_RightShift.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_RightShift.png new file mode 100644 index 000000000..d419517d3 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_RightShift.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_S.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_S.png new file mode 100644 index 000000000..47a62daa4 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_S.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Shift.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Shift.png new file mode 100644 index 000000000..740dfa9fc Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Shift.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Shift_L.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Shift_L.png new file mode 100644 index 000000000..005260fde Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Shift_L.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Shift_R.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Shift_R.png new file mode 100644 index 000000000..097cc6e78 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Shift_R.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Space.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Space.png new file mode 100644 index 000000000..fa60c6d9a Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Space.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_T.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_T.png new file mode 100644 index 000000000..6b34eb61b Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_T.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Tab.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Tab.png new file mode 100644 index 000000000..9e7391a58 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Tab.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_U.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_U.png new file mode 100644 index 000000000..4bc7ecf7a Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_U.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Up.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Up.png new file mode 100644 index 000000000..a80909ada Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Up.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_V.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_V.png new file mode 100644 index 000000000..1cbda7ed2 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_V.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_W.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_W.png new file mode 100644 index 000000000..450c1da14 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_W.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_X.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_X.png new file mode 100644 index 000000000..f453b99ef Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_X.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Y.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Y.png new file mode 100644 index 000000000..7f2544579 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Y.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Z.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Z.png new file mode 100644 index 000000000..b0a8e4bb2 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Keyboard_Z.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse.png new file mode 100644 index 000000000..f4e9beeac Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse_LeftClick.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse_LeftClick.png new file mode 100644 index 000000000..9b898e103 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse_LeftClick.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse_RightClick.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse_RightClick.png new file mode 100644 index 000000000..0158ec8b8 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse_RightClick.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse_Wheel.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse_Wheel.png new file mode 100644 index 000000000..945ca32c9 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse_Wheel.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse_Wheel_Down.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse_Wheel_Down.png new file mode 100644 index 000000000..fd908b3f3 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse_Wheel_Down.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse_Wheel_Up.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse_Wheel_Up.png new file mode 100644 index 000000000..7c637f9a5 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Keyboard/Mouse_Wheel_Up.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Loading/LoadingWidget.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Loading/LoadingWidget.png new file mode 100644 index 000000000..fde088756 Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Loading/LoadingWidget.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Loading/UI_T_LoadingGradient.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Loading/UI_T_LoadingGradient.png new file mode 100644 index 000000000..5fa62efda Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Loading/UI_T_LoadingGradient.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Loading/UI_T_LoadingGradient_Flame.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Loading/UI_T_LoadingGradient_Flame.png new file mode 100644 index 000000000..bf948379f Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Loading/UI_T_LoadingGradient_Flame.png differ diff --git a/Jusin154_Team3D/Client/Bin/Resources/Textures/Loading/UI_T_LoadingWidget_Flame.png b/Jusin154_Team3D/Client/Bin/Resources/Textures/Loading/UI_T_LoadingWidget_Flame.png new file mode 100644 index 000000000..83779c3aa Binary files /dev/null and b/Jusin154_Team3D/Client/Bin/Resources/Textures/Loading/UI_T_LoadingWidget_Flame.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/Splesh_Mesh/Splesh_Mesh1.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/Splesh_Mesh/Splesh_Mesh1.fbx new file mode 100644 index 000000000..cb603fa99 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Effect/Splesh_Mesh/Splesh_Mesh1.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f42fdff2eb45676f0e587c1e41bf2dbf9672443ef79c1557cd5962b00a887392 +size 72988 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Axe/T_WPN_TombProtector_Axe_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Axe/T_WPN_TombProtector_Axe_D.png new file mode 100644 index 000000000..21f37933b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Axe/T_WPN_TombProtector_Axe_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Axe/T_WPN_TombProtector_Axe_E.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Axe/T_WPN_TombProtector_Axe_E.png new file mode 100644 index 000000000..c2cefb93f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Axe/T_WPN_TombProtector_Axe_E.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Axe/T_WPN_TombProtector_Axe_MRO.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Axe/T_WPN_TombProtector_Axe_MRO.png new file mode 100644 index 000000000..2dd395869 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Axe/T_WPN_TombProtector_Axe_MRO.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Axe/T_WPN_TombProtector_Axe_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Axe/T_WPN_TombProtector_Axe_N.png new file mode 100644 index 000000000..35cb5db87 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Axe/T_WPN_TombProtector_Axe_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Axe/TombProtector_Axe.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Axe/TombProtector_Axe.fbx new file mode 100644 index 000000000..23cb9ce13 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Axe/TombProtector_Axe.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad2af72637b47daf2d6a4b3a132414054d7f7d4e059bea47257b1ccc2e880a2f +size 91468 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Mace/T_WPN_TombProtector_Mace_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Mace/T_WPN_TombProtector_Mace_D.png new file mode 100644 index 000000000..316e8589e Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Mace/T_WPN_TombProtector_Mace_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Mace/T_WPN_TombProtector_Mace_E.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Mace/T_WPN_TombProtector_Mace_E.png new file mode 100644 index 000000000..67c8b5447 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Mace/T_WPN_TombProtector_Mace_E.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Mace/T_WPN_TombProtector_Mace_MRO.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Mace/T_WPN_TombProtector_Mace_MRO.png new file mode 100644 index 000000000..dc470c25e Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Mace/T_WPN_TombProtector_Mace_MRO.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Mace/T_WPN_TombProtector_Mace_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Mace/T_WPN_TombProtector_Mace_N.png new file mode 100644 index 000000000..d0c1f6f51 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Mace/T_WPN_TombProtector_Mace_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Mace/TombProtector_Mace.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Mace/TombProtector_Mace.fbx new file mode 100644 index 000000000..75e5c1155 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/Mace/TombProtector_Mace.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b726eb9e224d98be73a9089bdc3375c962c79d909af1154bb2d0614499a3034 +size 95900 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector01_Upper_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector01_Upper_D.png new file mode 100644 index 000000000..6ed2c9ebf Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector01_Upper_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector01_Upper_E.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector01_Upper_E.png new file mode 100644 index 000000000..4669b020d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector01_Upper_E.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector01_Upper_MROA.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector01_Upper_MROA.png new file mode 100644 index 000000000..de2e4abf6 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector01_Upper_MROA.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector01_Upper_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector01_Upper_N.png new file mode 100644 index 000000000..c89e83d64 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector01_Upper_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1001_E.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1001_E.png new file mode 100644 index 000000000..5dbbe2dc7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1001_E.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1001_MRO.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1001_MRO.png new file mode 100644 index 000000000..035ceb7c3 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1001_MRO.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1001_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1001_N.png new file mode 100644 index 000000000..d3112d6e0 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1001_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1002_E.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1002_E.png new file mode 100644 index 000000000..34ddde4a1 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1002_E.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1002_MRO.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1002_MRO.png new file mode 100644 index 000000000..42132cafe Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1002_MRO.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1002_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1002_N.png new file mode 100644 index 000000000..855cefc69 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1002_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1_D.png new file mode 100644 index 000000000..39b18306d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_1_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_2_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_2_D.png new file mode 100644 index 000000000..5ff7e66a6 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_GOL_TombProtector_2_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_Spline_clouds_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_Spline_clouds_D.png new file mode 100644 index 000000000..9f9c0704f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_Spline_clouds_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_TombProtector_DistortionPattern_A_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_TombProtector_DistortionPattern_A_D.png new file mode 100644 index 000000000..b8c7a6e9e Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_TombProtector_DistortionPattern_A_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_TombProtector_DistortionPattern_B_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_TombProtector_DistortionPattern_B_D.png new file mode 100644 index 000000000..73a27fef9 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/T_TombProtector_DistortionPattern_B_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/TombProtector.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/TombProtector.fbx new file mode 100644 index 000000000..28a4cecb1 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/TombProtector.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e8ab9ac98cc040e967bfae8c42e2d57be4957844399b245973f08c7eda6c82d +size 48326476 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/Box b/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/Box new file mode 100644 index 000000000..076b14c9d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/Box differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/GoblinBody b/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/GoblinBody new file mode 100644 index 000000000..d0c63a25f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/GoblinBody differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/GoblinHead b/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/GoblinHead new file mode 100644 index 000000000..53267f9a0 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/GoblinHead differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/Steve b/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/Steve new file mode 100644 index 000000000..4cd475871 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/Steve differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/TombProtector b/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/TombProtector new file mode 100644 index 000000000..6662964a2 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/TombProtector differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl new file mode 100644 index 000000000..d49417481 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -0,0 +1,64 @@ + +struct Particle +{ + float4 vRight; + float4 vUp; + float4 vLook; + float4 vTranslation; + + float2 vLifeTime; +}; + +struct ParticleValue +{ + float fSpeed; + float fRotaionSpeed; + + float4 vOriginRight; + float4 vOriginUp; + float4 vOriginLook; + float4 vOriginTranslation; + + float2 fPadding; +}; + + +StructuredBuffer g_ParticleBufferInput : register(t0); +StructuredBuffer g_ParticleValueBufferInput : register(t1); + +RWStructuredBuffer g_ParticleBufferOutput : register(u0); + +cbuffer g_ConstantBuffer : register(b0) // b0 << ì�´ 숫ìž�와 컨스턴트 ì‰�ì�´ë�” ë°”ì�¸ë”©í• ë•Œ ì�¸ë�±ìŠ¤ê°€ ë�™ì�¼í•´ì•¼í•¨ +{ + float fTimeDelta; + + float fPadding; // 반드시 ìƒ�수버í�¼ëŠ” 16ë°”ì�´íЏ 배수로 만들어져야 한다. + float fPadding2; + float fPadding3; +} + +//ë‚´ê°€ 몇개ì�˜ 스레드를 사용할 것ì�¸ì§€ 지정하는ë�° +//GPU 칩ì�˜ 개수를 X * Y * Zì�˜ 개수 ë§Œí�¼ 사용하겠다는 ì�˜ë¯¸ì�´ë‹¤. +[numthreads(256, 1, 1)] +void CS_MAIN( + uint3 DispatchThreadID : SV_DispatchThreadID) +{ + int iIndex = DispatchThreadID.x; // ë°°ì—´ ì�¸ë�±ìФ + + Particle particle = g_ParticleBufferInput[iIndex]; + + ParticleValue particleValue = g_ParticleValueBufferInput[iIndex]; + + particle.vTranslation.y -= particleValue.fSpeed * fTimeDelta; + + particle.vLifeTime.x += fTimeDelta; + + if (particle.vLifeTime.x >= particle.vLifeTime.y) + { + particle.vLifeTime.x = 0.f; + particle.vTranslation.y = 0.f; + } + + g_ParticleBufferOutput[iIndex] = particle; + +} diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl new file mode 100644 index 000000000..8ad3f4123 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl @@ -0,0 +1,166 @@ +#include "Engine_Shader_Defines.hlsli" + +matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; + +Texture2D g_DiffuseTexture; +Texture2D g_NormalTexture; +Texture2D g_MaskingTexture; +Texture2D g_DissolveTexture; + +float4 g_vCamPosition; +vector g_vColor; +float2 g_vUVGain; + +float g_fFar; + +struct VS_IN +{ + float3 vPosition : POSITION; + float3 vNormal : NORMAL; + float3 vTangent : TANGENT; + float3 vBinormal : BINORMAL; + float2 vTexcoord : TEXCOORD0; + + float4 vRight : TEXCOORD1; + float4 vUp : TEXCOORD2; + float4 vLook : TEXCOORD3; + float4 vTranslation : TEXCOORD4; + float2 vLifeTime : TEXCOORD5; +}; + +struct VS_OUT +{ + float4 vPosition : SV_POSITION; + float4 vNormal : NORMAL; + float3 vTangent : TANGENT; + float3 vBinormal : BINORMAL; + float2 vTexcoord : TEXCOORD0; + float2 vLifeTime : TEXCOORD1; + float4 vWorldPos : TEXCOORD2; + float4 vProjPos : TEXCOORD3; +}; + +VS_OUT VS_MAIN(VS_IN In) +{ + VS_OUT Out = (VS_OUT) 0; + + matrix matWV, matWVP; + + matWV = mul(g_WorldMatrix, g_ViewMatrix); + + float4 vProjPos = vector(In.vPosition, 1.f); + + Out.vPosition = mul(vProjPos, matWVP); + Out.vProjPos = vProjPos; + + matWVP = mul(matWV, g_ProjMatrix); + + matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation); + + vector vPosition = mul(vector(In.vPosition, 1.f), TransformMatrix); + + Out.vPosition = mul(vPosition, matWVP); + Out.vNormal = normalize(mul(vector(In.vNormal, 0.f), TransformMatrix)); + Out.vTangent = normalize(mul(vector(In.vTangent, 0.f), TransformMatrix)).xyz; + Out.vBinormal = normalize(mul(vector(In.vBinormal, 0.f), TransformMatrix)).xyz; + Out.vTexcoord = In.vTexcoord; + Out.vLifeTime = In.vLifeTime; + Out.vWorldPos = mul(vector(In.vPosition, 1.f), g_WorldMatrix); + + + return Out; +} + +struct PS_IN +{ + float4 vPosition : SV_POSITION; + float4 vNormal : NORMAL; + float3 vTangent : TANGENT; + float3 vBinormal : BINORMAL; + float2 vTexcoord : TEXCOORD0; + float2 vLifeTime : TEXCOORD1; + float4 vWorldPos : TEXCOORD2; + float4 vProjPos : TEXCOORD3; +}; + +struct PS_OUT +{ + float4 vDiffuse : SV_TARGET0; + float4 vNormal : SV_TARGET1; + float4 vDepth : SV_TARGET2; +}; + +PS_OUT PS_MAIN(PS_IN In) +{ + + PS_OUT Out; + vector vMtrlDiffuse; + + vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + + vector vMtrlNormal = g_NormalTexture.Sample(DefaultSampler, In.vTexcoord); + + float3x3 NormalMap_WorldMatrix = float3x3(In.vTangent, In.vBinormal, In.vNormal.xyz); + + float3 vNormal = mul(vMtrlNormal.xyz * 2.f - 1.f, NormalMap_WorldMatrix); + + + Out.vNormal = float4(vNormal.xyz * 0.5f + 0.5f, 0.f); + Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f); + + if (vMtrlDiffuse.a < 0.3f) + discard; + + Out.vDiffuse.a = saturate(In.vLifeTime.y - In.vLifeTime.x); + Out.vDiffuse = vMtrlDiffuse; + + return Out; +} + +PS_OUT PS_NON_NORMALMAP(PS_IN In) +{ + + PS_OUT Out; + + vector vMtrlDiffuse; + + vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + + if (vMtrlDiffuse.a < 0.3f) + discard; + + Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f); + Out.vNormal = In.vNormal; + + Out.vDiffuse.a = saturate(In.vLifeTime.y - In.vLifeTime.x); + Out.vDiffuse = vMtrlDiffuse; + + return Out; +} + + + + +technique11 DefaultTechnique +{ + pass Model + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_MAIN(); + } + + pass NON_NOMALMAP + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_NON_NORMALMAP(); + } + +} diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Test/VFX_T_Noise08_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Test/VFX_T_Noise08_D.png new file mode 100644 index 000000000..7c1ae0e40 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Test/VFX_T_Noise08_D.png differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.aps b/Jusin154_Team3D/Editor/Default/Editor.aps index f728e28be..26022eeaa 100644 Binary files a/Jusin154_Team3D/Editor/Default/Editor.aps and b/Jusin154_Team3D/Editor/Default/Editor.aps differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index dda3ab542..b92354b91 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -149,23 +149,32 @@ + + + + + + + + + @@ -178,20 +187,29 @@ + + + + + + + + + - + @@ -228,6 +246,12 @@ Effect 5.0 + + 5.0 + Effect + Effect + 5.0 + Effect 5.0 diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index e84296692..ff87b94da 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -55,9 +55,6 @@ {1f58b759-0d65-4092-ad42-da21c974ea12} - - {a9a30c22-af8f-421a-8901-edfb8146f59d} - {130c848e-6ab6-4b45-b12c-56db07e2c2f4} @@ -76,6 +73,39 @@ {0ebb9c08-69b0-49b6-bac3-c827ca13319a} + + {69af10ea-e8f1-4455-9435-93857b7eb198} + + + {a04e88c3-dabb-4a91-8b9f-ce7f5562def6} + + + {a483f296-1312-4b29-8b8f-ce47654cd09e} + + + {763765ed-6960-4837-946e-20ff88d8e350} + + + {7ac7ca7b-7e52-498b-adfe-3a8e602b0904} + + + {32909f25-6113-4bd6-81a8-9415d993b221} + + + {a9a30c22-af8f-421a-8901-edfb8146f59d} + + + {8a5ffca8-725a-42ee-a3eb-3c79df09dec9} + + + {32718f84-d863-48d2-8611-90c40f2ba1c5} + + + {ba468252-bba3-46e4-bf61-e726a59060ad} + + + {5b31b993-b137-42d2-b737-000aeb27a675} + {167182ec-ed5f-46fc-9c27-a82e327fa1ac} @@ -165,6 +195,33 @@ 02.GameObjects\Dummys\DummyCube + + 02.GameObjects\Dummy_Goblin\Dummy_Goblin_Head + + + 02.GameObjects\ModelParts\Body + + + 02.GameObjects\ModelParts + + + 02.GameObjects\ModelParts\Head + + + 01.Level\40.EffectViewer + + + 02.GameObjects\Layer_Effect\Effect\00.EffectObject + + + 02.GameObjects\Layer_Effect\Effect\01.TestEffect + + + 02.GameObjects\Layer_Effect\Effect\02.EditEffect + + + 02.GameObjects\Layer_Effect\Effect_Editor + 50.UI\LodingWidget1 @@ -208,9 +265,6 @@ 01.Level\00.Loading - - 01.Level\00.Loading\Loader - 01.Level\01.Logo @@ -241,6 +295,36 @@ 02.GameObjects\Dummys\DummyCube + + 02.GameObjects\Dummy_Goblin\Dummy_Goblin_Head + + + 02.GameObjects\ModelParts\Body + + + 02.GameObjects\ModelParts + + + 02.GameObjects\ModelParts\Head + + + 01.Level\00.Loading\Loader + + + 01.Level\40.EffectViewer + + + 02.GameObjects\Layer_Effect\Effect\00.EffectObject + + + 02.GameObjects\Layer_Effect\Effect\01.TestEffect + + + 02.GameObjects\Layer_Effect\Effect\02.EditEffect + + + 02.GameObjects\Layer_Effect\Effect_Editor + 50.UI\LodingWidget1 @@ -287,6 +371,8 @@ 99.Define\SHADER + + 99.Define\SHADER diff --git a/Jusin154_Team3D/Editor/Private/Body.cpp b/Jusin154_Team3D/Editor/Private/Body.cpp new file mode 100644 index 000000000..eec5892e6 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Body.cpp @@ -0,0 +1,131 @@ +#include "pch.h" +#include "Body.h" + +#include "GameInstance.h" + +CBody::CBody(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CModelParts(pDevice, pContext) +{ +} + +CBody::CBody(const CBody& Prototype) + : CModelParts(Prototype) +{ +} + +HRESULT CBody::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CBody::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + + if (FAILED(Ready_Components())) + return E_FAIL; + + m_pModelCom->Set_AnimationIndex(0); + + return S_OK; +} + +void CBody::Priority_Update(_float fTimeDelta) +{ + +} + +void CBody::Update(_float fTimeDelta) +{ + m_pModelCom->Play_Animation(fTimeDelta); +} + +void CBody::Late_Update(_float fTimeDelta) +{ + _float4 vPos; + XMStoreFloat4(&vPos, Get_WorldPostion()); + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this, vPos, 20.f); +} + +HRESULT CBody::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) { + return E_FAIL; + } + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + return S_OK; +} + +HRESULT CBody::Ready_Components() +{ + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Steve_Model"), + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; + + /*m_pModelCom->Change_AnimationIndex(0, true, 0.4f, true);*/ + + return S_OK; +} + +CBody* CBody::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CBody* pInstance = new CBody(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CBody"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CGameObject* CBody::Clone(void* pArg, CGameObject* pOwner) +{ + CBody* pInstance = new CBody(*this); + + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CBody"); + Safe_Release(pInstance); + } + + return pInstance; +} + +void CBody::Free() +{ + __super::Free(); + +} + +void CBody::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Dummy_Goblin.cpp b/Jusin154_Team3D/Editor/Private/Dummy_Goblin.cpp index 3738f4c1a..6e362e40d 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_Goblin.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_Goblin.cpp @@ -38,7 +38,7 @@ void CDummy_Goblin::Priority_Update(_float fTimeDelta) void CDummy_Goblin::Update(_float fTimeDelta) { - m_pModelCom->Play_Animation(fTimeDelta); + //m_pModelCom->Play_Animation(fTimeDelta); } void CDummy_Goblin::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Editor/Private/Dummy_Goblin_Head.cpp b/Jusin154_Team3D/Editor/Private/Dummy_Goblin_Head.cpp new file mode 100644 index 000000000..dc4ce5fcc --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Dummy_Goblin_Head.cpp @@ -0,0 +1,172 @@ +#include "pch.h" +#include "Dummy_Goblin_Head.h" + +#include "GameInstance.h" +#include "DebugCamera.h" + +CDummy_Goblin_Head::CDummy_Goblin_Head(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject(pDevice, pContext) +{ +} + +CDummy_Goblin_Head::CDummy_Goblin_Head(const CDummy_Goblin_Head& Prototype) + : CGameObject(Prototype) +{ +} + +HRESULT CDummy_Goblin_Head::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CDummy_Goblin_Head::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components())) + return E_FAIL; + + return S_OK; +} + +void CDummy_Goblin_Head::Priority_Update(_float fTimeDelta) +{ + +} + +void CDummy_Goblin_Head::Update(_float fTimeDelta) +{ + m_pOwner->Get_Component()->Play_Animation(fTimeDelta); + m_pModelCom->Play_Animation(fTimeDelta); +} + +void CDummy_Goblin_Head::Late_Update(_float fTimeDelta) +{ + _float4 vPos; + XMStoreFloat4(&vPos, Get_WorldPostion()); + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this, vPos, 20.f); +} + +HRESULT CDummy_Goblin_Head::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) { + return E_FAIL; + } + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + return S_OK; +} + +HRESULT CDummy_Goblin_Head::Ready_Components() +{ + __super::Ready_Components(nullptr); + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_GoblinHead_Model"), + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; + + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH, + reinterpret_cast(&m_pShaderCom)))) + return E_FAIL; + + m_pModelCom->Change_AnimationIndex(0, true, 0.4f, true); + + return S_OK; +} + +HRESULT CDummy_Goblin_Head::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + //if (FAILED(m_pShaderCom->Bind_RawValue("g_vCamPosition", m_pGameInstance->Get_CamPosition(), sizeof(_float4)))) { + // return E_FAIL; + //} + //if (FAILED(m_pShaderCom->Bind_RawValue("g_bRimLight", &m_bRimLight, sizeof(_bool)))) { + // return E_FAIL; + //} + //if (FAILED(m_pShaderCom->Bind_RawValue("g_fRimStrength", &m_fRimLightStrength, sizeof(_float)))) { + // return E_FAIL; + //} + //if (FAILED(m_pShaderCom->Bind_RawValue("g_fRimPower", &m_fRimLightPower, sizeof(_float)))) { + // return E_FAIL; + //} + //if (FAILED(m_pShaderCom->Bind_RawValue("g_vRimColor", &m_vRimLightColor, sizeof(_float3)))) { + // return E_FAIL; + //} + return S_OK; +} + +CDummy_Goblin_Head* CDummy_Goblin_Head::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CDummy_Goblin_Head* pInstance = new CDummy_Goblin_Head(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CDummy_Goblin_Head"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CGameObject* CDummy_Goblin_Head::Clone(void* pArg, CGameObject* pOwner) +{ + CDummy_Goblin_Head* pInstance = new CDummy_Goblin_Head(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CDummy_Goblin_Head"); + Safe_Release(pInstance); + } + + return pInstance; +} + +void CDummy_Goblin_Head::Free() +{ + __super::Free(); + + Safe_Release(m_pShaderCom); + Safe_Release(m_pModelCom); +} + +void CDummy_Goblin_Head::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/EditEffect.cpp b/Jusin154_Team3D/Editor/Private/EditEffect.cpp new file mode 100644 index 000000000..8188b6c77 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/EditEffect.cpp @@ -0,0 +1,127 @@ +#include "pch.h" +#include "EditEffect.h" + +#include "GameInstance.h" + + +CEditEffect::CEditEffect(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffectObject{ pDevice, pContext } +{ +} + +CEditEffect::CEditEffect(const CEditEffect& rhs) + : CEffectObject(rhs) +{ +} + +HRESULT CEditEffect::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CEditEffect::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + + return S_OK; +} + +void CEditEffect::Priority_Update(_float fTimeDelta) +{ + +} + +void CEditEffect::Update(_float fTimeDelta) +{ + +} + +void CEditEffect::Late_Update(_float fTimeDelta) +{ + + if (m_pInstance_ModelCom == nullptr) + return; + + if (m_pTextureCom == nullptr) + return; + + _float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]); + + m_pGameInstance->Add_RenderGroup(RENDER::NONLIGHT, this, *vPos, m_pTransformCom->Get_Radius()); +} + +HRESULT CEditEffect::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) + { + return E_FAIL; + } + + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_INSTANCE_MODEL, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + + +CEditEffect* CEditEffect::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CEditEffect* pInstance = new CEditEffect(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CEditEffect"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CEditEffect::Clone(void* pArg, CGameObject* pOwner) +{ + CEditEffect* pInstance = new CEditEffect(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CEditEffect"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CEditEffect::Free() +{ + __super::Free(); +} + +void CEditEffect::Describe_Entity() +{ + //¿©±â¼­ ¸ðµ¨, ÅØ½ºÃÄ, ¼±ÅÃÇÒ ¼ö ÀÖµµ·Ï ÇÔ + + CInstance_Model::INSTANCE_DESC InstanceDesc = {}; + + InstanceDesc.iNumInstance = 100; + InstanceDesc.vLifeTime = _float2(1.f, 10.f); + InstanceDesc.vRange = _float3(5.f, 0.f, 5.f); + InstanceDesc.vSizeMin = _float3(1.f, 1.f, 1.f); + InstanceDesc.vSizeMax = _float3(1.f, 1.f, 1.f); + InstanceDesc.vSpeed = _float2(0.f, 5.f); + + m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "INSTANCE_MODEL" , (CComponent**)&m_pInstance_ModelCom , &InstanceDesc , this); + + + if (m_pInstance_ModelCom != nullptr) + { + m_pInstance_ModelCom->Describe_Entity(); + } + + +} diff --git a/Jusin154_Team3D/Editor/Private/EffectObject.cpp b/Jusin154_Team3D/Editor/Private/EffectObject.cpp new file mode 100644 index 000000000..5ef8fef7c --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/EffectObject.cpp @@ -0,0 +1,110 @@ +#include "pch.h" +#include "EffectObject.h" +#include "GameInstance.h" + +CEffectObject::CEffectObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CGameObject(pDevice, pContext) +{ +} + +CEffectObject::CEffectObject(const CEffectObject& rhs) + :CGameObject(rhs) +{ +} + +void CEffectObject::Priority_Update(_float fTimeDelta) +{ +} + +void CEffectObject::Update(_float fTimeDelta) +{ +} + +void CEffectObject::Late_Update(_float fTimeDelta) +{ + +} + +HRESULT CEffectObject::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + + for (_uint i = 0; i < m_pInstance_ModelCom->Get_NumMeshes(); i++) + { + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::NON_NOMALMAP)))) { + return E_FAIL; + } + + if (FAILED(m_pInstance_ModelCom->Render(i))) + { + return E_FAIL; + } + + } + + return S_OK; +} + +HRESULT CEffectObject::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pTextureCom->Bind_ShaderResource(m_pShaderCom, "g_DiffuseTexture", 0))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + return S_OK; +} + +HRESULT CEffectObject::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CEffectObject::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CEffectObject::Initialize(void* pArg) +{ + + if (FAILED(__super::Initialize(pArg))) + { + return E_FAIL; + } + + return S_OK; +} + + + +void CEffectObject::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pTextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pInstance_ModelCom); +} + + diff --git a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp new file mode 100644 index 000000000..4a5dc82c0 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp @@ -0,0 +1,114 @@ +#include "pch.h" +#include "Effect_Editor.h" + +#include "GameInstance.h" +#include "EditEffect.h" + + +CEffect_Editor::CEffect_Editor(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffectObject{ pDevice, pContext } +{ +} + +CEffect_Editor::CEffect_Editor(const CEffect_Editor& rhs) + : CEffectObject(rhs) +{ +} + +HRESULT CEffect_Editor::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CEffect_Editor::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + if (FAILED(Ready_Child())) + return E_FAIL; + + + return S_OK; +} + +void CEffect_Editor::Priority_Update(_float fTimeDelta) +{ + +} + +void CEffect_Editor::Update(_float fTimeDelta) +{ + Describe_Entity(); +} + +void CEffect_Editor::Late_Update(_float fTimeDelta) +{ + +} + +HRESULT CEffect_Editor::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CEffect_Editor::Ready_Child() +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_EFFECT , nullptr ,this , &m_pEditEffect))) + return E_FAIL; + + return S_OK; +} + + +CEffect_Editor* CEffect_Editor::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CEffect_Editor* pInstance = new CEffect_Editor(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CEffect_Editor"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CEffect_Editor::Clone(void* pArg, CGameObject* pOwner) +{ + CEffect_Editor* pInstance = new CEffect_Editor(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CEffect_Editor"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CEffect_Editor::Free() +{ + __super::Free(); +} + +void CEffect_Editor::Describe_Entity() +{ + ImGui::Begin("Effect Editor"); + + + //if (m_pEditEffect != nullptr) + // m_pEditEffect->Describe_Entity(); + + + + + ImGui::End(); +} diff --git a/Jusin154_Team3D/Editor/Private/Head.cpp b/Jusin154_Team3D/Editor/Private/Head.cpp new file mode 100644 index 000000000..ac6ff763e --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Head.cpp @@ -0,0 +1,129 @@ +#include "pch.h" +#include "Head.h" + +#include "GameInstance.h" + +CHead::CHead(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CModelParts(pDevice, pContext) +{ +} + +CHead::CHead(const CHead& Prototype) + : CModelParts(Prototype) +{ +} + +HRESULT CHead::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CHead::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + + if (FAILED(Ready_Components())) + return E_FAIL; + + m_pModelCom->Set_AnimationIndex(0); + + return S_OK; +} + +void CHead::Priority_Update(_float fTimeDelta) +{ + +} + +void CHead::Update(_float fTimeDelta) +{ + m_pModelCom->Play_Animation(fTimeDelta); +} + +void CHead::Late_Update(_float fTimeDelta) +{ + _float4 vPos; + XMStoreFloat4(&vPos, Get_WorldPostion()); + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this, vPos, 20.f); +} + +HRESULT CHead::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) { + return E_FAIL; + } + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + return S_OK; +} + +HRESULT CHead::Ready_Components() +{ + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_GoblinBody_Model"), + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; + + return S_OK; +} + +CHead* CHead::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CHead* pInstance = new CHead(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CHead"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CGameObject* CHead::Clone(void* pArg, CGameObject* pOwner) +{ + CHead* pInstance = new CHead(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CHead"); + Safe_Release(pInstance); + } + + return pInstance; +} + +void CHead::Free() +{ + __super::Free(); + +} + +void CHead::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp new file mode 100644 index 000000000..e653d4399 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp @@ -0,0 +1,125 @@ +#include "pch.h" +#include "Level_EffectViewer.h" +#include "GameInstance.h" +#include "Level_Loading.h" +#include "DebugCamera.h" +#include "TestEffect.h" +#include "Effect_Editor.h" + +CLevel_EffectViewer::CLevel_EffectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) + : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } +{ + +} + +HRESULT CLevel_EffectViewer::Initialize() +{ + if (FAILED(Ready_Layer_Light())) { + return E_FAIL; + } + + if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera")))) + { + return E_FAIL; + } + + if (FAILED(Ready_Layer_Effect(TEXT("Layer_Effect")))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, TEXT("Layer_Editor")))) + return E_FAIL; + + + return S_OK; +} + +void CLevel_EffectViewer::Update(_float fTimeDelta) +{ + +} + +HRESULT CLevel_EffectViewer::Render() +{ + SetWindowText(g_hWnd, TEXT("ÀÌÆåÆ® ·¹º§ÀÔ´Ï´Ù")); + GUI::ShowDemoWindow(); + return S_OK; +} + + + +HRESULT CLevel_EffectViewer::Ready_Layer_Camera(const _wstring& strLayerTag) +{ + CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{}; + CameraDesc.fFovy = XMConvertToRadians(60.0f); + CameraDesc.fNear = 0.1f; + CameraDesc.fFar = 500.f; + CameraDesc.vEye = _float3(0.f, 10.f, -10.f); + CameraDesc.vAt = _float3(0.f, 0.f, 0.f); + CameraDesc.fSpeedPerSec = 5.f; + CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f); + CameraDesc.fMouseSensor = 0.1f; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, + strLayerTag, &CameraDesc))) + return E_FAIL; + + return S_OK; +} + +HRESULT CLevel_EffectViewer::Ready_Layer_Light() +{ + LIGHT_DESC LightDesc{}; + + LightDesc.eType = LIGHT::DIRECTIONAL; + LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); + LightDesc.vAmbient = _float4(0.2f, 0.2f, 0.2f, 0.f); + LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); + LightDesc.vDirection = _float4(1.f, -1.f, 1.f, 0.f); + + if (FAILED(m_pGameInstance->On_Light(NEXT_LEVEL, TEXT("Main_Light"), LightDesc, nullptr))) { + return E_FAIL; + } + return S_OK; +} + +HRESULT CLevel_EffectViewer::Ready_Layer_UI(const _wstring& strLayerTag) +{ + return S_OK; +} + + +HRESULT CLevel_EffectViewer::Ready_Layer_Effect(const _wstring& strLayerTag) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, strLayerTag))) + return E_FAIL; + + + + return S_OK; +} + + + +CLevel_EffectViewer* CLevel_EffectViewer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) +{ + CLevel_EffectViewer* pInstance = new CLevel_EffectViewer(pDevice, pContext, eLevelID); + + if (FAILED(pInstance->Initialize())) + { + MSG_BOX("Failed to Created : CLevel_EffectViewer"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + + +void CLevel_EffectViewer::Free() +{ + __super::Free(); + + +} diff --git a/Jusin154_Team3D/Editor/Private/Level_Loading.cpp b/Jusin154_Team3D/Editor/Private/Level_Loading.cpp index 6d94b3235..023c402fb 100644 --- a/Jusin154_Team3D/Editor/Private/Level_Loading.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_Loading.cpp @@ -6,6 +6,7 @@ #include "Level_Logo.h" #include "Level_UI.h" #include "Level_ObjectViewer.h" +#include "Level_EffectViewer.h" CLevel_Loading::CLevel_Loading(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -52,9 +53,9 @@ void CLevel_Loading::Update(_float fTimeDelta) //case LEVEL::COMBINED: // pNewLevel = CLevel_LevelViewer::Create(m_pDevice, m_pContext, m_eNextLevelID); // break; - //case LEVEL::EFFECT: - // pNewLevel = CLevel_EffectViewer::Create(m_pDevice, m_pContext, m_eNextLevelID); - // break; + case LEVEL::EFFECT: + pNewLevel = CLevel_EffectViewer::Create(m_pDevice, m_pContext, m_eNextLevelID); + break; //case LEVEL::SKIllSTUDIO: // pNewLevel = CLevel_SkillStudio::Create(m_pDevice, m_pContext, m_eNextLevelID); // break; diff --git a/Jusin154_Team3D/Editor/Private/Level_Logo.cpp b/Jusin154_Team3D/Editor/Private/Level_Logo.cpp index e8cbf6699..c05c34769 100644 --- a/Jusin154_Team3D/Editor/Private/Level_Logo.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_Logo.cpp @@ -34,10 +34,10 @@ void CLevel_Logo::Update(_float fTimeDelta) // if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::COMBINED)))) // return; //} - //else if (GUI::Button("Effect Editor", { 100, 100 })) { - // if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::EFFECT)))) - // return; - //} + else if (GUI::Button("Effect Editor", { 100, 100 })) { + if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::EFFECT)))) + return; + } //else if (GUI::Button("Skill Editor", { 100, 100 })) { // if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::SKIllSTUDIO)))) // return; diff --git a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp index 9fe225d5d..f42720072 100644 --- a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp @@ -2,9 +2,11 @@ #include "Level_ObjectViewer.h" #include "GameInstance.h" #include "Level_Loading.h" -#include "Dummy_Goblin.h" +#include "Body.h" +#include "Head.h" #include "Dummy_Cube.h" #include "DebugCamera.h" +#include "Layer.h" CLevel_ObjectViewer::CLevel_ObjectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -17,11 +19,11 @@ HRESULT CLevel_ObjectViewer::Initialize() if (FAILED(Ready_Layer_Light())) { return E_FAIL; } + if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera")))) { return E_FAIL; } - if (FAILED(Ready_Layer_Dummy(TEXT("Layer_Dummy")))) { @@ -34,17 +36,80 @@ HRESULT CLevel_ObjectViewer::Initialize() void CLevel_ObjectViewer::Update(_float fTimeDelta) { + Add_Object(); + Show_ModelFilePath(); } HRESULT CLevel_ObjectViewer::Render() { SetWindowText(g_hWnd, TEXT("¿ÀºêÁ§Æ® ·¹º§ÀÔ´Ï´Ù")); - GUI::ShowDemoWindow(); + //GUI::ShowDemoWindow(); return S_OK; } +void CLevel_ObjectViewer::Add_Object() +{ + GUI::Begin("Add Object"); + if (GUI::BeginTabBar("ObjectTabs")) + { + if (ImGui::BeginTabItem("Creatures")) + { + GUI::EndTabItem(); + } + if (ImGui::BeginTabItem("Human")) + { + if (GUI::CollapsingHeader("Body")) + { + if (GUI::Button("Add")) + { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, TEXT("Layer_Body")))) + return; + CBody* pBody = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_Body"))->Get_Object(); + } + if (GUI::Button("Delete")) + { + m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_Body"))->Clear_Layer(); + } + } + if (GUI::CollapsingHeader("Head")) + { + if (GUI::Button("Add")) + { + CGameObject* pOwner = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_Body"))->Get_Object(); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, TEXT("Layer_Head"), nullptr, pOwner))) + return; + } + } + if (GUI::CollapsingHeader("Hair")) + { + } + GUI::EndTabItem(); + } + + GUI::EndTabBar(); + + GUI::End(); + } +} + +void CLevel_ObjectViewer::Show_ModelFilePath() +{ + GUI::Begin("Model_List"); + for (_uint i = 0; i < m_pGameInstance->ModelFilePathCount(); i++) + { + /*GUI::Text(m_pGameInstance->Load_BinaryModelFilePath(i));*/ + GUI::SameLine(); + + std::string label = "Binary##" + std::to_string(i); + if (GUI::Button(label.c_str())) + { + m_pGameInstance->SaveAssimpModel(m_pGameInstance->Load_ModelFilePath(i)); + } + } + GUI::End(); +} HRESULT CLevel_ObjectViewer::Ready_Layer_Camera(const _wstring& strLayerTag) { @@ -88,11 +153,8 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_UI(const _wstring& strLayerTag) HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag) { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE))) - return E_FAIL; + /*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE))) + return E_FAIL;*/ return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 3a99a1d2c..b935ff362 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Loader.h" #include "DebugCamera.h" #include "GameInstance.h" @@ -17,6 +17,10 @@ #include "Mission_Key.h" #include "Mission_KeyHold.h" #include "Mouse_Cursor.h" +#include "Head.h" +#include "Body.h" +#include "Dummy_Goblin.h" +#include "Dummy_Cube.h" #include "LodingWidget1.h" #include "MiniMap_TrimBorder.h" #include "Active_Icon.h" @@ -24,6 +28,15 @@ #pragma endregion + +#pragma region EFFECT_HEADER + +#include "TestEffect.h" +#include "EditEffect.h" +#include "Effect_Editor.h" + +#pragma endregion + CLoader::CLoader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : m_pDevice{ pDevice } , m_pContext{ pContext } @@ -87,9 +100,9 @@ HRESULT CLoader::Loading() //case LEVEL::COMBINED: // hr = Loading_For_CombinedViewer(); // break; - //case LEVEL::EFFECT: - // hr = Loading_For_Effect(); - // break; + case LEVEL::EFFECT: + hr = Loading_For_Effect(); + break; //case LEVEL::SKIllSTUDIO: // hr = Loading_For_SkillStudio(); // break; @@ -116,16 +129,19 @@ void CLoader::Output() HRESULT CLoader::Loading_For_Logo() { - m_strMessage = TEXT("�ؽ��ĸ�(��) �ε� �� �Դϴ�."); + + m_strMessage = TEXT("í…�스ì³�를(ì�„) 로딩 중 입니다."); + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Dororong"), CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/DororongDoro.png"), TEXT("Dororong"), 0)))){ return E_FAIL; } - m_strMessage = TEXT("�𵨸�(��) �ε� �� �Դϴ�."); + m_strMessage = TEXT("모ë�¸ë¥¼(ì�„) 로딩 중 입니다."); - m_strMessage = TEXT("���̴���(��) �ε� �� �Դϴ�."); + + m_strMessage = TEXT("ì‰�ì�´ë�”를(ì�„) 로딩 중 입니다."); if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_POSTEX, CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl"), @@ -163,7 +179,8 @@ HRESULT CLoader::Loading_For_Logo() return E_FAIL; } - m_strMessage = TEXT("��ü������(��) �ε� �� �Դϴ�."); + + m_strMessage = TEXT("ê°�ì²´ì›�형를(ì�„) 로딩 중 입니다."); if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummyRect::Create(m_pDevice, m_pContext)))) { return E_FAIL; @@ -172,7 +189,7 @@ HRESULT CLoader::Loading_For_Logo() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDebugCamera::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - m_strMessage = TEXT("��� �Ϸ�Ǿ����ϴ�.."); + m_strMessage = TEXT("로딩ì�´ 완료ë�˜ì—ˆìŠµë‹ˆë‹¤.."); m_isFinished = true; @@ -255,7 +272,7 @@ HRESULT CLoader::Loading_For_UI() return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLodingWidget1::Create(m_pDevice, m_pContext)))) + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLodingWidget1::Create(m_pDevice, m_pContext)))) { return E_FAIL; } @@ -288,6 +305,61 @@ HRESULT CLoader::Loading_For_UI() { return E_FAIL; } + + m_strMessage = TEXT("��� �Ϸ�Ǿ����ϴ�.."); + + m_isFinished = true; + + return S_OK; +} + +HRESULT CLoader::Loading_For_Effect() +{ + m_strMessage = TEXT("í…�스ì³�를(ì�„) 로딩 중 입니다."); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::EFFECT), TEXT("Prototype_Texture_Test_Noise"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Effect/Test/VFX_T_Noise08_D.png"), TEXT("Effect_Test_Noise"), 0)))) { + return E_FAIL; + } + + + m_strMessage = TEXT("모ë�¸ë¥¼(ì�„) 로딩 중 입니다."); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::EFFECT), TEXT("Prototype_Component_GoblinBody_Instance_Model"), + CInstance_Model::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/Goblin/GoblinBody.fbx", MODEL::NONANIM, XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), 0)))) + return E_FAIL; + + m_strMessage = TEXT("ì‰�ì�´ë�”를(ì�„) 로딩 중 입니다."); + + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_INSTANCE_MODEL, + CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl"), + VTX_MODEL_INSTANCE_PARTICLE::Elements, VTX_MODEL_INSTANCE_PARTICLE::iNumElements)))) { + return E_FAIL; + } + + + m_strMessage = TEXT("ê°�ì²´ì›�형를(ì�„) 로딩 중 입니다."); + + + if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CDebugCamera::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CTestEffect::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CEffect_Editor::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CEditEffect::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + m_strMessage = TEXT("로딩ì�´ 완료ë�˜ì—ˆìŠµë‹ˆë‹¤.."); + m_strMessage = TEXT("��� �Ϸ�Ǿ����ϴ�.."); @@ -302,22 +374,53 @@ HRESULT CLoader::Loading_For_ObjectViewer() m_strMessage = TEXT("�𵨸�(��) �ε� �� �Դϴ�."); - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_GoblinBody_Model"), + /*if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinBody_Model"), CModel::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/Goblin/GoblinBody.fbx", MODEL::ANIM, XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity(), 0)))) return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Desc_Box"), + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinHead_Model"), + CModel::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/Goblin/GoblinHead.fbx", MODEL::ANIM, XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity(), 0)))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Desc_Box"), CModel::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/Box/Box.fbx", MODEL::NONANIM, XMMatrixIdentity(), 0)))) return E_FAIL; + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Steve_Model"), + CModel::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/Steve/Steve.fbx", MODEL::ANIM, XMMatrixIdentity(), 0)))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_TombProtector_Model"), + CModel::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/TombProtector/TombProtector.fbx", MODEL::ANIM,XMMatrixIdentity(), 0)))) + return E_FAIL;*/ + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinBody_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/SaveFile/GoblinBody", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + return E_FAIL; + + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Steve_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/SaveFile/Steve",XMMatrixScaling(0.01f,0.01f,0.01f)* XMMatrixIdentity())))) + return E_FAIL; + + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_TombProtector_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/SaveFile/TombProtector", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + return E_FAIL; + m_strMessage = TEXT("���̴���(��) �ε� �� �Դϴ�."); + m_strMessage = TEXT("����Ʈ��(��) �ε� �� �Դϴ�."); m_strMessage = TEXT("��ü������(��) �ε� �� �Դϴ�."); - /* For.Prototype_GameObject_Dummy_Goblin */ - if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_Goblin::Create(m_pDevice, m_pContext)))) + /* For.Prototype_GameObject_Body */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CBody::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_Head */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CHead::Create(m_pDevice, m_pContext)))) return E_FAIL; /* For.Prototype_GameObject_Dummy_Cube */ diff --git a/Jusin154_Team3D/Editor/Private/ModelParts.cpp b/Jusin154_Team3D/Editor/Private/ModelParts.cpp new file mode 100644 index 000000000..cc08eb155 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/ModelParts.cpp @@ -0,0 +1,90 @@ +#include "pch.h" +#include "Body.h" + +#include "GameInstance.h" + +CModelParts::CModelParts(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject(pDevice, pContext) +{ +} + +CModelParts::CModelParts(const CModelParts& Prototype) + : CGameObject(Prototype) +{ +} + +HRESULT CModelParts::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CModelParts::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + + if (FAILED(Ready_Components())) + return E_FAIL; + + return S_OK; +} + +void CModelParts::Priority_Update(_float fTimeDelta) +{ +} + +void CModelParts::Update(_float fTimeDelta) +{ +} + +void CModelParts::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CModelParts::Render() +{ + return S_OK; +} + +HRESULT CModelParts::Ready_Components() +{ + __super::Ready_Components(nullptr); + + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH, + reinterpret_cast(&m_pShaderCom)))) + return E_FAIL; + + return S_OK; +} + +HRESULT CModelParts::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + return S_OK; +} + +void CModelParts::Free() +{ + __super::Free(); + + Safe_Release(m_pShaderCom); + Safe_Release(m_pModelCom); +} + +void CModelParts::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/TestEffect.cpp b/Jusin154_Team3D/Editor/Private/TestEffect.cpp new file mode 100644 index 000000000..57b4a150f --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/TestEffect.cpp @@ -0,0 +1,120 @@ +#include "pch.h" +#include "TestEffect.h" + +#include "GameInstance.h" + + +CTestEffect::CTestEffect(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffectObject{ pDevice, pContext } +{ +} + +CTestEffect::CTestEffect(const CTestEffect& rhs) + : CEffectObject(rhs) +{ +} + +HRESULT CTestEffect::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CTestEffect::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + + return S_OK; +} + +void CTestEffect::Priority_Update(_float fTimeDelta) +{ + +} + +void CTestEffect::Update(_float fTimeDelta) +{ + m_pInstance_ModelCom->Drop(fTimeDelta); +} + +void CTestEffect::Late_Update(_float fTimeDelta) +{ + _float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]); + + m_pGameInstance->Add_RenderGroup(RENDER::NONLIGHT, this, *vPos, m_pTransformCom->Get_Radius()); +} + +HRESULT CTestEffect::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + + + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::EFFECT), TEXT("Prototype_Texture_Test_Noise"), reinterpret_cast(&m_pTextureCom), nullptr))) + { + return E_FAIL; + } + + CInstance_Model::INSTANCE_DESC InstanceDesc = {}; + + InstanceDesc.iNumInstance = 100; + InstanceDesc.vLifeTime = _float2(1.f, 10.f); + InstanceDesc.vRange = _float3(5.f, 0.f, 5.f); + InstanceDesc.vSizeMin = _float3(1.f, 1.f, 1.f); + InstanceDesc.vSizeMax = _float3(1.f, 1.f, 1.f); + InstanceDesc.vSpeed = _float2(0.f , 5.f); + + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::EFFECT), TEXT("Prototype_Component_GoblinBody_Instance_Model"), reinterpret_cast(&m_pInstance_ModelCom), &InstanceDesc))) + { + return E_FAIL; + } + + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_INSTANCE_MODEL, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + + +CTestEffect* CTestEffect::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CTestEffect* pInstance = new CTestEffect(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CTestEffect"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CTestEffect::Clone(void* pArg, CGameObject* pOwner) +{ + CTestEffect* pInstance = new CTestEffect(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CTestEffect"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CTestEffect::Free() +{ + __super::Free(); +} + +void CTestEffect::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Public/Body.h b/Jusin154_Team3D/Editor/Public/Body.h new file mode 100644 index 000000000..6ad832eee --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Body.h @@ -0,0 +1,33 @@ +#pragma once + +#include "Editor_Define.h" +#include "ModelParts.h" + +NS_BEGIN(Editor) + +class CBody final : public CModelParts +{ +private: + CBody(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CBody(const CBody& Prototype); + virtual ~CBody() = default; + +public: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + HRESULT Ready_Components(); + +public: + static CBody* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; + virtual void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/Dummy_Goblin_Head.h b/Jusin154_Team3D/Editor/Public/Dummy_Goblin_Head.h new file mode 100644 index 000000000..1be73f872 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Dummy_Goblin_Head.h @@ -0,0 +1,47 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CShader; +class CModel; +NS_END + +NS_BEGIN(Editor) + +class CDummy_Goblin_Head final : public CGameObject +{ +private: + CDummy_Goblin_Head(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CDummy_Goblin_Head(const CDummy_Goblin_Head& Prototype); + virtual ~CDummy_Goblin_Head() = default; + +public: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + CShader* m_pShaderCom = { nullptr }; + CModel* m_pModelCom = { nullptr }; + _bool m_bRimLight = { true }; + _float m_fRimLightPower = { 3.2f }; + _float m_fRimLightStrength = { 3.04f }; + _float3 m_vRimLightColor = { 69.f / 255.f, 5.f / 255.f, 10.f / 255.f }; + +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + static CDummy_Goblin_Head* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; + virtual void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/EditEffect.h b/Jusin154_Team3D/Editor/Public/EditEffect.h new file mode 100644 index 000000000..cc2b26770 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/EditEffect.h @@ -0,0 +1,39 @@ +#pragma once + +#include "Editor_Define.h" +#include "EffectObject.h" + +NS_BEGIN(Engine) +class CModel; +class CShader; +NS_END + +NS_BEGIN(Editor) + +class CEditEffect final : public CEffectObject +{ +private: + CEditEffect(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CEditEffect(const CEditEffect& rhs); + virtual ~CEditEffect() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + + +public: + static CEditEffect* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index d92b7b21e..9b1200c2a 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -11,7 +11,7 @@ namespace Editor const unsigned int g_iWinSizeX = 1920; const unsigned int g_iWinSizeY = 1080; - enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, OBJECT,UI,END }; + enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, OBJECT,UI, EFFECT, END }; enum class COLLIDABLEOBJECT { PLAYER, MONSTER, HOSTILE_HITBOX, ALLY_HITBOX, NEUTRAL_HITBOX, ENVIRIONMENT, NPC, ITEM, TRIGGERBOX, REGION, NOCOLLIDE, END }; enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, END }; @@ -20,6 +20,7 @@ namespace Editor enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, END }; enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, END }; + enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, END }; enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CURSOR, LODING, HOLD, END }; } diff --git a/Jusin154_Team3D/Editor/Public/Editor_Macro.h b/Jusin154_Team3D/Editor/Public/Editor_Macro.h index ac792cc44..e14d42a20 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Macro.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Macro.h @@ -17,6 +17,7 @@ namespace Editor { #define FX_CELL TEXT("FX_CELL") #define FX_DEFERRED TEXT("FX_DEFFERED") #define FX_PARTICLE TEXT("FX_PARTICLE") +#define FX_INSTANCE_MODEL TEXT("FX_INSTANCE_MODEL") #define FX_UIEDITOR TEXT("FX_UIEDITOR") #pragma endregion diff --git a/Jusin154_Team3D/Editor/Public/EffectObject.h b/Jusin154_Team3D/Editor/Public/EffectObject.h new file mode 100644 index 000000000..a38f25044 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/EffectObject.h @@ -0,0 +1,43 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CInstance_Model; +class CShader; +class CTexture; +NS_END + +NS_BEGIN(Editor) + +class CEffectObject abstract : public CGameObject +{ +protected: + CEffectObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CEffectObject(const CEffectObject& rhs); + virtual ~CEffectObject() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + +protected: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +protected: + CTexture* m_pTextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CInstance_Model* m_pInstance_ModelCom = { nullptr }; + + +public: + virtual void Free() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/Effect_Editor.h b/Jusin154_Team3D/Editor/Public/Effect_Editor.h new file mode 100644 index 000000000..491db8894 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Effect_Editor.h @@ -0,0 +1,40 @@ +#pragma once + +#include "Editor_Define.h" +#include "EffectObject.h" + +NS_BEGIN(Engine) +class CModel; +class CShader; +NS_END + +NS_BEGIN(Editor) + +class CEffect_Editor final : public CEffectObject +{ +private: + CEffect_Editor(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CEffect_Editor(const CEffect_Editor& rhs); + virtual ~CEffect_Editor() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); +private: + CGameObject* m_pEditEffect = { nullptr }; +public: + static CEffect_Editor* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/Head.h b/Jusin154_Team3D/Editor/Public/Head.h new file mode 100644 index 000000000..c4128d947 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Head.h @@ -0,0 +1,33 @@ +#pragma once + +#include "Editor_Define.h" +#include "ModelParts.h" + +NS_BEGIN(Editor) + +class CHead final : public CModelParts +{ +private: + CHead(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CHead(const CHead& Prototype); + virtual ~CHead() = default; + +public: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + HRESULT Ready_Components(); + +public: + static CHead* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; + virtual void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/Level_EffectViewer.h b/Jusin154_Team3D/Editor/Public/Level_EffectViewer.h new file mode 100644 index 000000000..fc83d6863 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Level_EffectViewer.h @@ -0,0 +1,31 @@ +#pragma once + +#include "Editor_Define.h" +#include "Level.h" + +NS_BEGIN(Editor) + +class CLevel_EffectViewer final : public CLevel +{ +private: + CLevel_EffectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID); + virtual ~CLevel_EffectViewer() = default; + +public: + virtual void Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + /* ÀÌ ·¹º§¿¡¼­ ¾²±âÀ§ÇÑ °´Ã¼µéÀ» »ý¼ºÇÑ´Ù. */ + virtual HRESULT Initialize() override; + HRESULT Ready_Layer_Camera(const _wstring& strLayerTag); + HRESULT Ready_Layer_Light(); + HRESULT Ready_Layer_UI(const _wstring& strLayerTag); + HRESULT Ready_Layer_Effect(const _wstring& strLayerTag); + +public: + static CLevel_EffectViewer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID); + virtual void Free() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/Level_ObjectViewer.h b/Jusin154_Team3D/Editor/Public/Level_ObjectViewer.h index f0477c497..4ace089a8 100644 --- a/Jusin154_Team3D/Editor/Public/Level_ObjectViewer.h +++ b/Jusin154_Team3D/Editor/Public/Level_ObjectViewer.h @@ -14,6 +14,8 @@ class CLevel_ObjectViewer final : public CLevel public: virtual void Update(_float fTimeDelta) override; virtual HRESULT Render() override; + void Add_Object(); + void Show_ModelFilePath(); private: /* ÀÌ ·¹º§¿¡¼­ ¾²±âÀ§ÇÑ °´Ã¼µéÀ» »ý¼ºÇÑ´Ù. */ @@ -23,6 +25,7 @@ class CLevel_ObjectViewer final : public CLevel HRESULT Ready_Layer_UI(const _wstring& strLayerTag); HRESULT Ready_Layer_Dummy(const _wstring& strLayerTag); + public: static CLevel_ObjectViewer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID); virtual void Free() override; diff --git a/Jusin154_Team3D/Editor/Public/Loader.h b/Jusin154_Team3D/Editor/Public/Loader.h index 47fbc66c6..62d487666 100644 --- a/Jusin154_Team3D/Editor/Public/Loader.h +++ b/Jusin154_Team3D/Editor/Public/Loader.h @@ -38,11 +38,14 @@ class CLoader final : public CBase CGameInstance* m_pGameInstance = { nullptr }; + //list m_SaveModel; + private: HRESULT Initialize(LEVEL eNextLevelID); HRESULT Loading_For_Logo(); HRESULT Loading_For_ObjectViewer(); HRESULT Loading_For_UI(); + HRESULT Loading_For_Effect(); public: static CLoader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID); diff --git a/Jusin154_Team3D/Editor/Public/ModelParts.h b/Jusin154_Team3D/Editor/Public/ModelParts.h new file mode 100644 index 000000000..6eecd83d4 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/ModelParts.h @@ -0,0 +1,46 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CShader; +class CModel; +NS_END + +NS_BEGIN(Editor) + +class CModelParts abstract : public CGameObject +{ +protected: + CModelParts(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CModelParts(const CModelParts& Prototype); + virtual ~CModelParts() = default; + +public: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +protected: + CShader* m_pShaderCom = { nullptr }; + CModel* m_pModelCom = { nullptr }; + _bool m_bRimLight = { true }; + _float m_fRimLightPower = { 3.2f }; + _float m_fRimLightStrength = { 3.04f }; + _float3 m_vRimLightColor = { 69.f / 255.f, 5.f / 255.f, 10.f / 255.f }; + +protected: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)PURE; + virtual void Free() override; + virtual void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/TestEffect.h b/Jusin154_Team3D/Editor/Public/TestEffect.h new file mode 100644 index 000000000..65d370251 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/TestEffect.h @@ -0,0 +1,38 @@ +#pragma once + +#include "Editor_Define.h" +#include "EffectObject.h" + +NS_BEGIN(Engine) +class CModel; +class CShader; +NS_END + +NS_BEGIN(Editor) + +class CTestEffect final : public CEffectObject +{ +private: + CTestEffect(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CTestEffect(const CTestEffect& rhs); + virtual ~CTestEffect() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + +public: + static CTestEffect* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl new file mode 100644 index 000000000..d49417481 --- /dev/null +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -0,0 +1,64 @@ + +struct Particle +{ + float4 vRight; + float4 vUp; + float4 vLook; + float4 vTranslation; + + float2 vLifeTime; +}; + +struct ParticleValue +{ + float fSpeed; + float fRotaionSpeed; + + float4 vOriginRight; + float4 vOriginUp; + float4 vOriginLook; + float4 vOriginTranslation; + + float2 fPadding; +}; + + +StructuredBuffer g_ParticleBufferInput : register(t0); +StructuredBuffer g_ParticleValueBufferInput : register(t1); + +RWStructuredBuffer g_ParticleBufferOutput : register(u0); + +cbuffer g_ConstantBuffer : register(b0) // b0 << ì�´ 숫ìž�와 컨스턴트 ì‰�ì�´ë�” ë°”ì�¸ë”©í• ë•Œ ì�¸ë�±ìŠ¤ê°€ ë�™ì�¼í•´ì•¼í•¨ +{ + float fTimeDelta; + + float fPadding; // 반드시 ìƒ�수버í�¼ëŠ” 16ë°”ì�´íЏ 배수로 만들어져야 한다. + float fPadding2; + float fPadding3; +} + +//ë‚´ê°€ 몇개ì�˜ 스레드를 사용할 것ì�¸ì§€ 지정하는ë�° +//GPU 칩ì�˜ 개수를 X * Y * Zì�˜ 개수 ë§Œí�¼ 사용하겠다는 ì�˜ë¯¸ì�´ë‹¤. +[numthreads(256, 1, 1)] +void CS_MAIN( + uint3 DispatchThreadID : SV_DispatchThreadID) +{ + int iIndex = DispatchThreadID.x; // ë°°ì—´ ì�¸ë�±ìФ + + Particle particle = g_ParticleBufferInput[iIndex]; + + ParticleValue particleValue = g_ParticleValueBufferInput[iIndex]; + + particle.vTranslation.y -= particleValue.fSpeed * fTimeDelta; + + particle.vLifeTime.x += fTimeDelta; + + if (particle.vLifeTime.x >= particle.vLifeTime.y) + { + particle.vLifeTime.x = 0.f; + particle.vTranslation.y = 0.f; + } + + g_ParticleBufferOutput[iIndex] = particle; + +} diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index 8760404f0..f6dab33b7 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -175,6 +175,7 @@ + @@ -266,6 +267,7 @@ + @@ -377,6 +379,7 @@ + @@ -466,6 +469,7 @@ + @@ -495,6 +499,10 @@ Effect 5.0 + + Effect + 5.0 + diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index 9f66022dc..8cddf7ba0 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -220,6 +220,12 @@ {32546fa5-8ee9-4c26-8d48-7ef2b2d023b0} + + {5d6c9918-c50d-4c5a-bbc6-56c50ae5985b} + + + {96600587-16b1-4627-914d-7fc413c501ba} + @@ -405,6 +411,12 @@ 02.Element\01.GameObject\50.UI + + 02.Element\02.Component\06.Model\Instance_Model + + + 01.Utility\06.ComputeShader + @@ -956,6 +968,12 @@ 02.Element\01.GameObject\50.UI + + 02.Element\02.Component\06.Model\Instance_Model + + + 01.Utility\06.ComputeShader + @@ -1014,5 +1032,8 @@ 99.Define\01.SHADER + + 99.Define\01.SHADER + \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Private/Animation.cpp b/Jusin154_Team3D/Engine/Private/Animation.cpp index abd3f545d..ab202e239 100644 --- a/Jusin154_Team3D/Engine/Private/Animation.cpp +++ b/Jusin154_Team3D/Engine/Private/Animation.cpp @@ -17,17 +17,21 @@ CAnimation::CAnimation(const CAnimation& rhs) , m_StartKeyFrames{ rhs.m_StartKeyFrames } , m_DestBones{ rhs.m_DestBones } , m_strName{ rhs.m_strName } + , m_fTickPerSecond{ rhs.m_fTickPerSecond } + , m_pSaveAnim{ rhs.m_pSaveAnim } { memcpy_s(m_TickPerSeconds, sizeof(_float) * 2, rhs.m_TickPerSeconds, sizeof(_float) * 2); + strcpy_s(m_szName, sizeof(m_szName), rhs.m_szName); + for (auto& pChannel : m_Channels) { SAFE_ADDREF(pChannel); } } _bool CAnimation::Update_TransformationMatrices(const vector& Bones, _bool bIsLoop, _float fTimeDelta) { - m_fCurrentTrackPosition += m_TickPerSeconds[m_bPause] * fTimeDelta; - + //m_fCurrentTrackPosition += m_TickPerSeconds[m_bPause] * fTimeDelta; + m_fCurrentTrackPosition += m_fTickPerSecond * fTimeDelta; if (m_fCurrentTrackPosition >= m_fDuration) { m_fCurrentTrackPosition = 0.f; // ·çÇÁ if (false == bIsLoop) { @@ -48,6 +52,7 @@ _bool CAnimation::Update_TransformationMatrices(const vector& Bone return false; } + void CAnimation::Depart_Animation() { m_fCurrentTrackPosition = 0.f; @@ -177,6 +182,30 @@ HRESULT CAnimation::Initialize(HANDLE hFile, DWORD& dwByte) return S_OK; } +HRESULT CAnimation::Initialize(const CModel* pModel, SaveAnimation* pSaveAnimation) +{ + m_pSaveAnim = pSaveAnimation; + + strcpy_s(m_szName, pSaveAnimation->Name); + m_fDuration = pSaveAnimation->mDuration; + m_fTickPerSecond = pSaveAnimation->mTicksPerSecond; + + m_iNumChannels = pSaveAnimation->ChannelCount; + + m_CurrentKeyFrameIndices.resize(m_iNumChannels); + + for (size_t i = 0; i < m_iNumChannels; i++) + { + CChannel* pChannel = CChannel::Create(pModel, &pSaveAnimation->Channels[i]); + if (nullptr == pChannel) + return E_FAIL; + + m_Channels.push_back(pChannel); + } + + return S_OK; +} + HRESULT CAnimation::Combined_Initialize() { m_StartKeyFrames.reserve(m_iNumChannels); @@ -205,6 +234,19 @@ CAnimation* CAnimation::Create(HANDLE hFile, DWORD& dwByte) return pInstance; } +CAnimation* CAnimation::Create(const CModel* pModel, SaveAnimation* pSaveAnimation) +{ + CAnimation* pInstance = new CAnimation(); + + if (FAILED(pInstance->Initialize(pModel, pSaveAnimation))) + { + MSG_BOX("Failed to Created : CAnimation"); + Safe_Release(pInstance); + } + + return pInstance; +} + CAnimation* CAnimation::Clone() { return new CAnimation(*this); diff --git a/Jusin154_Team3D/Engine/Private/Bone.cpp b/Jusin154_Team3D/Engine/Private/Bone.cpp index 44194ebf4..e8be931ca 100644 --- a/Jusin154_Team3D/Engine/Private/Bone.cpp +++ b/Jusin154_Team3D/Engine/Private/Bone.cpp @@ -69,6 +69,19 @@ CBone* CBone::Create(const aiNode* pAINode, _int iParentIndex) return pInstance; } +CBone* CBone::Create(const SaveNode& _SaveNode, _int iParentIndex) +{ + CBone* pInstance = new CBone(); + + if (FAILED(pInstance->Initialize(_SaveNode, iParentIndex))) + { + MSG_BOX("Failed to Created : CBone"); + Safe_Release(pInstance); + } + + return pInstance; +} + HRESULT CBone::Initialize(const aiNode* pAINode, _int iParentIndex) { strcpy_s(m_szName, pAINode->mName.data); @@ -109,6 +122,19 @@ HRESULT CBone::Initialize(HANDLE hFile, DWORD& dwByte) return S_OK; } +HRESULT CBone::Initialize(const SaveNode& _SaveNode, _int iParentIndex) +{ + strcpy_s(m_szName, _SaveNode.Name); + + m_iParentBoneIndex = iParentIndex; + + memcpy(&m_TransformationMatrix, &_SaveNode.Transformation, sizeof(_float4x4)); + + XMStoreFloat4x4(&m_CombinedTransformationMatrix, XMMatrixIdentity()); + + return S_OK; +} + CBone* CBone::Create(HANDLE hFile, DWORD& dwByte) { CBone* pInstance = new CBone(); diff --git a/Jusin154_Team3D/Engine/Private/Channel.cpp b/Jusin154_Team3D/Engine/Private/Channel.cpp index 0fa4baf5b..d1a7bbf2f 100644 --- a/Jusin154_Team3D/Engine/Private/Channel.cpp +++ b/Jusin154_Team3D/Engine/Private/Channel.cpp @@ -183,6 +183,56 @@ HRESULT CChannel::Initialize(HANDLE hFile, DWORD& dwByte) return S_OK; } +HRESULT CChannel::Initialize(const CModel* pModel, SaveChannel* pSaveChannel) +{ + strcpy_s(m_szName, pSaveChannel->Name); + + m_iBoneIndex = pModel->Get_BoneIndex(m_szName); + m_PreTransformMatrix = pModel->Get_PreTransformMatrix(); + + m_iNumKeyFrames = max(pSaveChannel->ScalingKeyCount, pSaveChannel->RotationKeyCount); + m_iNumKeyFrames = max(m_iNumKeyFrames, pSaveChannel->PositionKeyCount); + + _float3 vScale{}; + _float4 vRotation{}; + _float3 vTranslation{}; + + for (size_t i = 0; i < m_iNumKeyFrames; i++) + { + KEYFRAME KeyFrame{}; + + if (i < pSaveChannel->ScalingKeyCount) + { + memcpy(&vScale, &pSaveChannel->ScalingKeys[i].Value, sizeof(_float3)); + KeyFrame.fTrackPosition = pSaveChannel->ScalingKeys[i].Time; + } + + if (i < pSaveChannel->RotationKeyCount) + { + vRotation.x = pSaveChannel->RotationKeys[i].Value.x; + vRotation.y = pSaveChannel->RotationKeys[i].Value.y; + vRotation.z = pSaveChannel->RotationKeys[i].Value.z; + vRotation.w = pSaveChannel->RotationKeys[i].Value.w; + + KeyFrame.fTrackPosition = pSaveChannel->RotationKeys[i].Time; + } + + if (i < pSaveChannel->PositionKeyCount) + { + memcpy(&vTranslation, &pSaveChannel->PositionKeys[i].Value, sizeof(_float3)); + KeyFrame.fTrackPosition = pSaveChannel->PositionKeys[i].Time; + } + + KeyFrame.vScale = vScale; + KeyFrame.vRotation = vRotation; + KeyFrame.vTranslation = vTranslation; + + m_KeyFrames.push_back(KeyFrame); + } + + return S_OK; +} + CChannel* CChannel::Create(const vector& Bones, _uint iIndex) { CChannel* pInstance = new CChannel(); @@ -209,6 +259,19 @@ CChannel* CChannel::Create(HANDLE hFile, DWORD& dwByte) return pInstance; } +CChannel* CChannel::Create(const CModel* pModel, SaveChannel* pSaveChannel) +{ + CChannel* pInstance = new CChannel(); + + if (FAILED(pInstance->Initialize(pModel, pSaveChannel))) + { + MSG_BOX("Failed to Created : CChannel"); + Safe_Release(pInstance); + } + + return pInstance; +} + void CChannel::Free() { __super::Free(); diff --git a/Jusin154_Team3D/Engine/Private/ComputeShader.cpp b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp new file mode 100644 index 000000000..3dfcae11b --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp @@ -0,0 +1,283 @@ +#include "pch.h" +#include "ComputeShader.h" +#include "GameInstance.h" +#include "Instance_Model.h" + +CComputeShader::CComputeShader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : m_pDevice{ pDevice } + , m_pContext{ pContext } + , m_pGameInstance{ CGameInstance::GetInstance() } +{ + Safe_AddRef(m_pDevice); + Safe_AddRef(m_pContext); + Safe_AddRef(m_pGameInstance); +} + +HRESULT CComputeShader::Initialize(const _tchar* pShaderFilePath, const _char* pStartFunctionName, _uint iNumElement, _uint iNumInputBuffer, _uint iOutputStructStride, _uint iInputStructStride[]) +{ + m_iNumElement = iNumElement; + m_iNumInputBuffer = iNumInputBuffer; + m_iOutputStructStride = iOutputStructStride; + + if (FAILED(CreateComputeShader(pShaderFilePath, pStartFunctionName))) + return E_FAIL; + + if (FAILED(CreateBuffer(iNumElement, iNumInputBuffer, iInputStructStride))) + return E_FAIL; + + if (FAILED(CreateResurceViews(iNumElement, iNumInputBuffer))) + return E_FAIL; + + + + return S_OK; +} + +HRESULT CComputeShader::Dispatch(_uint iSRVIndex, _uint iUAVIndex, _float3 vGroupCount, ID3D11Buffer** ppBuffers, ID3D11Buffer* pConstantBuffer) +{ + //VBBuffer-> dynamic , pConstantBuffer-> dynamic , m_pInputBuffer, m_pOutputBuffer-> default , m_pStagingBuffer-> Staging + + //³» ½ÃÀÛ ¹öÆÛ °ªÀ» ä¿î´Ù. + + //´ÙÀ̳ª¹ÍÀ¸·Î »ý¼ºµÈ ¹öÆÛ¸¦ ¹Ù·Î µðÆúÆ® ¹öÆÛ·Î ¶§·Á¹ÚÀ» ¼ö ¾øÀ½ + //µû¶ó¼­ ½ºÅ×ÀÌ¡ ¹öÆÛ¸¦ µû·Î ¼±¾ðÇÏ¿© °ªÀ» º¹»ç¹Þ´Â´Ù. + + + + for (_uint i = 0; i < m_iNumInputBuffer; i++) + { + D3D11_MAPPED_SUBRESOURCE PreSubResource = {}; + + m_pContext->CopyResource(m_pStagingBuffer[i], ppBuffers[i]); + + + if (SUCCEEDED(m_pContext->Map(m_pStagingBuffer[i], 0, D3D11_MAP_READ, 0, &PreSubResource))) + { + // µðÆúÆ® ¹öÆÛ´Â UpdateSubresource ÇÔ¼ö¸¦ ÅëÇØ¼­¸¸ ³»ºÎ °ª¿¡ Á¢±ÙÀÌ °¡´ÉÇÏ´Ù. + + m_pContext->UpdateSubresource(m_pInputBuffer[i], 0, nullptr, PreSubResource.pData, 0, 0); + m_pContext->Unmap(m_pStagingBuffer[i], 0); + + } + } + + + + //ÄÄǻƮ ½¦ÀÌ´õ ¹ÙÀεù + m_pContext->CSSetShader(m_pComputeShader, nullptr, 0); + m_pContext->CSSetConstantBuffers(0, 1, &pConstantBuffer); + + //SRV, UAV ¹ÙÀεù + Bind_SRV(iSRVIndex); + Bind_UAV(iUAVIndex); + + //ÄÄǻƮ ½¦ÀÌ´õ ½ÇÇà + + //³» ¹öÆÛÀÇ Â÷¿ø(1,2,3Â÷¿ø ¹è¿­)¿¡ µû¸¥ ±×·ì Ä«¿îÆ®¸¦ ¼³Á¤ << Á¤È®È÷ ¸ð¸£°ÚÀ½ + m_pContext->Dispatch((_uint)vGroupCount.x, (_uint)vGroupCount.y, (_uint)vGroupCount.z); + + + //µðÆúÆ®-> ½ºÅ×ÀÌ¡ ¹öÆÛ´Â º¹»ç°¡ °¡´ÉÇÔ (´ÙÀ̳ª¹ÍÀº cpu ±â¹ÝÀÌ¶ó º¹»ç ¾ÈµÊ) + //0¹ø ½ºÅ×ÀÌ¡ ¹öÆÛ°¡ ¾Æ¿ìDz ½ºÅ×ÀÌ¡ ¹öÆÛ¿Í °°À½ + m_pContext->CopyResource(m_pStagingBuffer[0], m_pOutputBuffer); + + //½ºÅ×ÀÌ¡ ¹öÆÛ¸¦ ¿­¾î¼­ Ä«ÇÇÇÔ + D3D11_MAPPED_SUBRESOURCE StagingSubResource = {}; + D3D11_MAPPED_SUBRESOURCE OutSubResource = {}; + + if (SUCCEEDED(m_pContext->Map(m_pStagingBuffer[0], 0, D3D11_MAP_READ, 0, &StagingSubResource))) + { + if (SUCCEEDED(m_pContext->Map(ppBuffers[0], 0, D3D11_MAP_WRITE_DISCARD, 0, &OutSubResource))) + { + memcpy(OutSubResource.pData, StagingSubResource.pData, m_iOutputStructStride * m_iNumElement); // ¾Æ¿ôDz ¹öÆÛ¿¡ µé¾î¿Â °ªµéÀ» ÀüºÎ º¹»çÇÑ´Ù. + + m_pContext->Unmap(ppBuffers[0], 0); + } + + m_pContext->Unmap(m_pStagingBuffer[0], 0); + } + + Reset(); + + + return S_OK; +} + +void CComputeShader::Bind_SRV(_uint iIndex) +{ + m_pContext->CSSetShaderResources(iIndex, // ½ÃÀÛ½½·Ô ¹øÈ£ + m_iNumInputBuffer, // ¹öÆÛ °³¼ö + &m_pInputSRV[0]); // ¹öÆÛ ½ÃÀÛ ÁÖ¼Ò +} + +void CComputeShader::Bind_UAV(_uint iIndex) +{ + m_pContext->CSSetUnorderedAccessViews(iIndex, 1, &m_pOutputUAV, nullptr); +} + +void CComputeShader::Reset() +{ + //´ÙÀ½ ·£´õ¸µ ÆÐ½º¿¡ ¿¬°üµÇÁö ¾Êµµ·Ï ÃʱâÈ­ + ID3D11UnorderedAccessView* pResetUAV[1] = { nullptr }; + ID3D11ShaderResourceView* pResetSRV[1] = { nullptr }; + m_pContext->CSSetUnorderedAccessViews(0, 1, pResetUAV, nullptr); + m_pContext->CSSetShaderResources(0, 1, pResetSRV); + m_pContext->CSSetShader(nullptr, nullptr, 0); +} + +HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iNumInputBuffer, _uint iInputStructStride[]) +{ + + //ÀÎ ¾Æ¿ôDz ¹öÆÛ + + + for (_uint i = 0; i < iNumInputBuffer; i++) // ÀÎDz ¹öÆÛ¸¦ ¿©·¯°³ »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ¸¸µç´Ù + { + D3D11_BUFFER_DESC InputBufferdesc = {}; + + InputBufferdesc.ByteWidth = iInputStructStride[i] * iNumElement; + InputBufferdesc.StructureByteStride = iInputStructStride[i]; + InputBufferdesc.Usage = D3D11_USAGE_DEFAULT; + InputBufferdesc.CPUAccessFlags = 0; + InputBufferdesc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + InputBufferdesc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; + + ID3D11Buffer* pInputBuffer = nullptr; + + if (FAILED(m_pDevice->CreateBuffer(&InputBufferdesc, nullptr, &pInputBuffer))) + return E_FAIL; + + m_pInputBuffer.push_back(pInputBuffer); + + //½ºÅ×ÀÌ¡ ¹öÆÛ À̸§ + D3D11_BUFFER_DESC StagingBufferDesc = {}; + StagingBufferDesc.Usage = D3D11_USAGE_STAGING; // ½ºÅ×ÀÌ¡ ¹öÆÛ + StagingBufferDesc.ByteWidth = iInputStructStride[i] * iNumElement; + StagingBufferDesc.StructureByteStride = iInputStructStride[i]; + StagingBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; + + ID3D11Buffer* pStagingBuffer = nullptr; + + if (FAILED(m_pDevice->CreateBuffer(&StagingBufferDesc, nullptr, &pStagingBuffer))) + return E_FAIL; + + m_pStagingBuffer.push_back(pStagingBuffer); + } + + + D3D11_BUFFER_DESC Bufferdesc = {}; + Bufferdesc.ByteWidth = m_iOutputStructStride * iNumElement; + Bufferdesc.StructureByteStride = m_iOutputStructStride; + Bufferdesc.Usage = D3D11_USAGE_DEFAULT; // ÀÎ ¾Æ¿ôDz ¹öÆÛ´Â µðÆúÆ®·Î ¼³Á¤ÇؾßÇÔ + Bufferdesc.CPUAccessFlags = 0; // µðÆúÆ® ¹öÆÛ´Â CPU¿¡¼­ Read Write°¡ ºÒ°¡´ÉÇϸç + //¿ÀÁ÷ Update_SubResource¸¦ ÅëÇØ¼­¸¸ °»½ÅÀÌ °¡´ÉÇÏ´Ù. + + Bufferdesc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_UNORDERED_ACCESS; + Bufferdesc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; + + if(FAILED(m_pDevice->CreateBuffer(&Bufferdesc, nullptr, &m_pOutputBuffer))) + return E_FAIL; + + + + + return S_OK; +} + +HRESULT CComputeShader::CreateResurceViews(_uint iNumElement, _uint iNumInputBuffer) +{ + // SRV + for (_uint i = 0; i < iNumInputBuffer; i++) // ÀÎDz ¹öÆÛ¸¦ ¿©·¯°³ »ç¿ëÇÒ ¼ö ÀÖµµ·Ï ¸¸µç´Ù + { + ID3D11ShaderResourceView* pSrv = {}; + + D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {}; + srvDesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFEREX; + srvDesc.Format = DXGI_FORMAT_UNKNOWN; + srvDesc.BufferEx.FirstElement = 0; + srvDesc.BufferEx.NumElements = iNumElement; + m_pDevice->CreateShaderResourceView(m_pInputBuffer[i], &srvDesc, &pSrv); + + m_pInputSRV.push_back(pSrv); + + } + + // UAV + D3D11_UNORDERED_ACCESS_VIEW_DESC uavDesc = {}; + uavDesc.ViewDimension = D3D11_UAV_DIMENSION_BUFFER; + uavDesc.Format = DXGI_FORMAT_UNKNOWN; + uavDesc.Buffer.FirstElement = 0; + uavDesc.Buffer.NumElements = iNumElement; + m_pDevice->CreateUnorderedAccessView(m_pOutputBuffer, &uavDesc, &m_pOutputUAV); + + return S_OK; +} + +HRESULT CComputeShader::CreateComputeShader(const _tchar* pShaderFilePath, const _char* pStartFunctionName) +{ + ID3DBlob* pCSBlob = nullptr; + + // Debug ¸ðµå¿Í release ¸ðµåÀÇ Ç÷¹±×¸¦ ´Ù¸£°Ô Áà¾ßÇÔ + UINT HLSLFlags = {}; +#ifdef _DEBUG + HLSLFlags |= D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION; +#else + HLSLFlags = D3DCOMPILE_OPTIMIZATION_LEVEL1; +#endif // _DEBUG + + HRESULT hr = D3DCompileFromFile(pShaderFilePath, + nullptr, + D3D_COMPILE_STANDARD_FILE_INCLUDE, + pStartFunctionName, + "cs_5_0", + HLSLFlags, + 0, + &pCSBlob, + nullptr); + + + if (FAILED(m_pDevice->CreateComputeShader( + pCSBlob->GetBufferPointer(), // ÄÄÆÄÀÏµÈ ½¦ÀÌ´õ ÄÚµå + pCSBlob->GetBufferSize(), // ÄÚµå ±æÀÌ + nullptr, // Ŭ·¡½º ÀνºÅϽº (¾øÀ½) + &m_pComputeShader // ÄÄǻƮ ½¦ÀÌ´õ °´Ã¼ + ))) + return E_FAIL; + + SAFE_RELEASE(pCSBlob); + + return S_OK; +} + + +CComputeShader* CComputeShader::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _tchar* pShaderFilePath, const _char* pStartFunctionName, _uint iNumElement, _uint iNumInputBuffer, _uint iOutputStructStride, _uint iInputStructStride[]) +{ + CComputeShader* pInstance = new CComputeShader(pDevice, pContext); + + if (FAILED(pInstance->Initialize(pShaderFilePath, pStartFunctionName , iNumElement, iNumInputBuffer, iOutputStructStride, iInputStructStride))) + { + MSG_BOX("Failed to Created : CComputeShader Prototype"); + Safe_Release(pInstance); + } + + return pInstance; +} + +void CComputeShader::Free() +{ + __super::Free(); + + for (_uint i = 0; i < m_iNumInputBuffer; i++) + { + Safe_Release(m_pInputSRV[i]); + Safe_Release(m_pInputBuffer[i]); + Safe_Release(m_pStagingBuffer[i]); + } + + Safe_Release(m_pOutputUAV); + Safe_Release(m_pOutputBuffer); + Safe_Release(m_pComputeShader); + Safe_Release(m_pDevice); + Safe_Release(m_pContext); + Safe_Release(m_pGameInstance); +} diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 606640f14..167497628 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -146,6 +146,29 @@ _int CGameInstance::Random_Int(_int iMin, _int iMax) return iMin + (_int)(Random_Normal() * (iMax - iMin)); } +void CGameInstance::Save_ModelFilePath(const _char* FilePath) +{ + m_FilePaths.push_back(FilePath); +} + +const _char* CGameInstance::Load_ModelFilePath(_uint iIndex) +{ + return m_FilePaths[iIndex]; +} + +const _char* CGameInstance::Load_BinaryModelFilePath(_uint iIndex) +{ + auto iter = m_sModelMap.begin(); + std::advance(iter, iIndex); + return iter->first; +} + + +size_t CGameInstance::ModelFilePathCount() +{ + return m_FilePaths.size(); +} + void CGameInstance::Render_Begin(const _float4* pClearColor) { m_pGraphic_Device->Clear_BackBuffer_View(pClearColor); @@ -474,6 +497,16 @@ const SHADOW_LIGHT_DESC* CGameInstance::Get_ShadowDesc() { return m_pShadow->Get_ShadowDesc(); } +SaveModel* CGameInstance::Load_SaveModel(const _char* filePath) +{ + auto iter = m_sModelMap.find(filePath); + return &iter->second; +} +_bool CGameInstance::SaveAssimpModel(const _char* filename) +{ + auto iter = m_ModelMap.find(filename); + return iter->second->SaveAssimpModel(filename); +} bool CGameInstance::Key_Pressing(int _iKey) { if (false == (GUI::IsWindowFocused(ImGuiFocusedFlags_AnyWindow))) { diff --git a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp new file mode 100644 index 000000000..3a175b748 --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp @@ -0,0 +1,416 @@ +#include "pch.h" + +#include "Instance_Model.h" +#include "Mesh.h" +#include "GameInstance.h" +#include "ComputeShader.h" + +CInstance_Model::CInstance_Model(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CComponent { pDevice , pContext } +{ +} + +CInstance_Model::CInstance_Model(const CInstance_Model& rhs) + : CComponent(rhs) + , m_iInstanceStride{ rhs.m_iInstanceStride } + , m_iNumInstance{ rhs.m_iNumInstance } + , m_iNumBuffer {rhs.m_iNumBuffer} + , m_iNumMeshes {rhs.m_iNumMeshes } + , m_Meshes {rhs.m_Meshes} +{ + for (auto& pMesh : m_Meshes) { + SAFE_ADDREF(pMesh); + } + + Safe_AddRef(m_pVBInstance); +} +#ifdef EDITOR_PROJECT +HRESULT CInstance_Model::Initialize_Prototype(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex) +{ + if (FAILED(__super::Initialize_Prototype())) + return E_FAIL; + + m_iNumBuffer = 2; + + if (FAILED(Assimp_Model_Load(pModelFilePath, eType, PreTransformMatrix, iRootBoneIndex))) + return E_FAIL; + + return S_OK; +} +HRESULT CInstance_Model::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex) +{ + + _uint iFlag = {}; + iFlag = aiProcess_ConvertToLeftHanded | aiProcessPreset_TargetRealtime_Fast; + + if (MODEL::NONANIM == eType) { + iFlag |= aiProcess_PreTransformVertices; + } + m_iRootBoneIndex = iRootBoneIndex; + + Assimp::Importer Importer = {}; + const aiScene* pAIScene = { nullptr }; + + pAIScene = Importer.ReadFile(pModelFilePath, iFlag); + if (nullptr == pAIScene) { + return E_FAIL; + } + +#pragma region Mesh + if (FAILED(Ready_Meshes(eType, pAIScene, PreTransformMatrix))) { + return E_FAIL; + } +#pragma endregion + + return S_OK; +} + +HRESULT CInstance_Model::Ready_Meshes(MODEL eType, const aiScene* pAIScene, _fmatrix& PreTransformMatrix) +{ + XMStoreFloat4x4(&m_PreTransformMatrix, PreTransformMatrix); + m_iNumMeshes = pAIScene->mNumMeshes; + + m_Meshes.reserve(m_iNumMeshes); + + for (size_t i = 0; i < m_iNumMeshes; ++i) + { + CMesh* pMesh = CMesh::Create(m_pDevice, m_pContext, eType, m_Bones, pAIScene->mMeshes[i], PreTransformMatrix); + + if (nullptr == pMesh) { + return E_FAIL; + } + + m_Meshes.push_back(pMesh); + } + + m_Meshes.shrink_to_fit(); + + return S_OK; +} +#endif + +HRESULT CInstance_Model::Create_Instance_Buffer(const INSTANCE_DESC* pDesc) +{ + + m_InstanceDesc = *pDesc; + + m_iNumInstance = m_InstanceDesc.iNumInstance; + + m_iInstanceStride = sizeof(VTX_INSTANCE_PARTICLE); + + D3D11_BUFFER_DESC InstanceBufferDesc = {}; + + InstanceBufferDesc.ByteWidth = m_iInstanceStride * m_iNumInstance; + InstanceBufferDesc.Usage = D3D11_USAGE_DYNAMIC; + InstanceBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + InstanceBufferDesc.StructureByteStride = m_iInstanceStride; + InstanceBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + InstanceBufferDesc.MiscFlags = 0; + + + if (FAILED(m_pDevice->CreateBuffer(&InstanceBufferDesc, nullptr, &m_pVBInstance))) + return E_FAIL; + + + + return S_OK; +} + +HRESULT CInstance_Model::Create_SubResource_Buffer() +{ + + // º§·ù ¹öÆÛ »ý¼ºÇϱâ + D3D11_BUFFER_DESC Particle_Buffer_Desc = {}; + Particle_Buffer_Desc.ByteWidth = sizeof(CS_PARTICLE_VALUE_DESC) * m_iNumInstance; + Particle_Buffer_Desc.Usage = D3D11_USAGE_DYNAMIC; + Particle_Buffer_Desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + Particle_Buffer_Desc.StructureByteStride = sizeof(CS_PARTICLE_VALUE_DESC); + Particle_Buffer_Desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + Particle_Buffer_Desc.MiscFlags = 0; + + D3D11_SUBRESOURCE_DATA InitialDesc = {}; + InitialDesc.pSysMem = nullptr; + + + if (FAILED(m_pDevice->CreateBuffer(&Particle_Buffer_Desc, nullptr, &m_pParticleValueBuffer))) + return E_FAIL; + + + //ÄÁ½ºÅÏÆ® ¹öÆÛ »ý¼ºÇϱâ + + D3D11_BUFFER_DESC cbDesc = {}; + cbDesc.Usage = D3D11_USAGE_DYNAMIC; + cbDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; + cbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + cbDesc.ByteWidth = sizeof(CS_PARTICLE_DESC); + + D3D11_SUBRESOURCE_DATA CBInitialDesc = {}; + + if (FAILED(m_pDevice->CreateBuffer(&cbDesc, nullptr, &m_pConstantBuffer))) + return E_FAIL; + + return S_OK; +} + + +HRESULT CInstance_Model::Initialize(void* pArg) +{ + + INSTANCE_DESC* pInstanceDesc = static_cast(pArg); + + if (pInstanceDesc == nullptr) + return E_FAIL; + + if (FAILED(Create_Instance_Buffer(pInstanceDesc))) + return E_FAIL; + + if (FAILED(Create_SubResource_Buffer())) + return E_FAIL; + + //½ÃÀÛ ½Ã¿¡ ÀνºÅÏÆ® ¹öÆÛ¸¦ ±¸¼º ÇØÁÜ + Instane_Buffer_ReStruct(); + + _uint CS_Strides[] = { + sizeof(VTX_INSTANCE_PARTICLE), + sizeof(CS_PARTICLE_VALUE_DESC), + }; + + m_pComputeShader = CComputeShader::Create(m_pDevice, m_pContext, + L"../Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl", "CS_MAIN", m_iNumInstance, 2, sizeof(VTX_INSTANCE_PARTICLE), CS_Strides); + + if (m_pComputeShader == nullptr) + return E_FAIL; + + return S_OK; +} + +void CInstance_Model::Drop(_float fTimeDelta) +{ + D3D11_MAPPED_SUBRESOURCE ConstantSubResource = {}; + + if (SUCCEEDED(m_pContext->Map(m_pConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &ConstantSubResource))) + { + CS_PARTICLE_DESC* pDesc = static_cast(ConstantSubResource.pData); + + pDesc->fTimeDelta = fTimeDelta; + pDesc->fPadding = 0; + pDesc->fPadding2 = 0; + pDesc->fPadding3 = 0; + + m_pContext->Unmap(m_pConstantBuffer, 0); + } + + if (m_pComputeShader == nullptr) + return; + + _uint iGroupCountX = (m_iNumInstance + 255) / 256; + + ID3D11Buffer* CSBuffers[] = { + m_pVBInstance, + m_pParticleValueBuffer + + }; + + m_pComputeShader->Dispatch(0, 0, _float3((_float)iGroupCountX, 1.f, 1.f), CSBuffers, m_pConstantBuffer); + +} + + +HRESULT CInstance_Model::Render(_uint iMeshIndx) +{ + + if (FAILED(m_Meshes[iMeshIndx]->Bind_Resources_Instance(m_pVBInstance, m_iInstanceStride, m_iNumBuffer))) + return E_FAIL; + + if (FAILED(m_Meshes[iMeshIndx]->Render_Instance(m_iNumInstance))) + return E_FAIL; + + + return S_OK; +} + +void CInstance_Model::Instane_Buffer_ReStruct() +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + D3D11_MAPPED_SUBRESOURCE ParticleValue_SubResource{}; + + if (SUCCEEDED(m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_DISCARD, 0, &SubResource))) + { + VTX_INSTANCE_PARTICLE* pVertices = static_cast(SubResource.pData); + + if (SUCCEEDED(m_pContext->Map(m_pParticleValueBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &ParticleValue_SubResource))) + { + + CS_PARTICLE_VALUE_DESC* pParticleValues = static_cast(ParticleValue_SubResource.pData); + + for (size_t i = 0; i < m_iNumInstance; i++) + { + + //½ºÄÉÀÏ ¼³Á¤ + _float3 vScale = _float3( + m_pGameInstance->Random_Float(m_InstanceDesc.vSizeMin.x, m_InstanceDesc.vSizeMax.x), + m_pGameInstance->Random_Float(m_InstanceDesc.vSizeMin.y, m_InstanceDesc.vSizeMax.y), + m_pGameInstance->Random_Float(m_InstanceDesc.vSizeMin.z, m_InstanceDesc.vSizeMax.z) + ); + + _matrix ScaleMatrix = XMMatrixScaling(vScale.x, vScale.y, vScale.z); + + //·ÎÅ×ÀÌ¼Ç ¼³Á¤ + _float3 vRoataion = _float3( + m_pGameInstance->Random_Float(m_InstanceDesc.vRotationAngleMin.x, m_InstanceDesc.vRotationAngleMax.x), + m_pGameInstance->Random_Float(m_InstanceDesc.vRotationAngleMin.y, m_InstanceDesc.vRotationAngleMax.y), + m_pGameInstance->Random_Float(m_InstanceDesc.vRotationAngleMin.z, m_InstanceDesc.vRotationAngleMax.z) + ); + + _matrix RotationMatrix = XMMatrixRotationRollPitchYaw( + XMConvertToDegrees(vRoataion.x), + XMConvertToDegrees(vRoataion.y), + XMConvertToDegrees(vRoataion.z) + ); + + + //À§Ä¡ ¼³Á¤ + _float4x4 SRMatrix = {}; + + XMStoreFloat4x4(&SRMatrix, ScaleMatrix * RotationMatrix); + + memcpy(&pVertices[i].vRight, SRMatrix.m[0], sizeof(_float4)); + memcpy(&pVertices[i].vUp, SRMatrix.m[1], sizeof(_float4)); + memcpy(&pVertices[i].vLook, SRMatrix.m[2], sizeof(_float4)); + + + pVertices[i].vTranslation = _float4( + m_pGameInstance->Random_Float(m_InstanceDesc.vCenter.x - m_InstanceDesc.vRange.x * 0.5f, m_InstanceDesc.vCenter.x + m_InstanceDesc.vRange.x * 0.5f), + m_pGameInstance->Random_Float(m_InstanceDesc.vCenter.y - m_InstanceDesc.vRange.y * 0.5f, m_InstanceDesc.vCenter.y + m_InstanceDesc.vRange.y * 0.5f), + m_pGameInstance->Random_Float(m_InstanceDesc.vCenter.z - m_InstanceDesc.vRange.z * 0.5f, m_InstanceDesc.vCenter.z + m_InstanceDesc.vRange.z * 0.5f), + 1.f); + + //¶óÀÌÇÁ ŸÀÓ ¼³Á¤ + pVertices[i].vLifeTime = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vLifeTime.x, m_InstanceDesc.vLifeTime.y)); + + + pParticleValues[i].fSpeed = m_pGameInstance->Random_Float(m_InstanceDesc.vSpeed.x, m_InstanceDesc.vSpeed.y); + pParticleValues[i].fRotaionSpeed = m_pGameInstance->Random_Float(m_InstanceDesc.vRotationSpeed.x, m_InstanceDesc.vRotationSpeed.y); + + memcpy(&pParticleValues[i].vOriginRight, SRMatrix.m[0], sizeof(_float4)); + memcpy(&pParticleValues[i].vOriginUp, SRMatrix.m[1], sizeof(_float4)); + memcpy(&pParticleValues[i].vOriginLook, SRMatrix.m[2], sizeof(_float4)); + memcpy(&pParticleValues[i].vOriginTranslation, SRMatrix.m[3], sizeof(_float4)); + } + + m_pContext->Unmap(m_pParticleValueBuffer, 0); + + } + m_pContext->Unmap(m_pVBInstance, 0); + } + + +} + +#ifdef EDITOR_PROJECT + +CInstance_Model* CInstance_Model::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex) +{ + CInstance_Model* pInstance = new CInstance_Model(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype(pModelFilePath, eType, PreTransformMatrix, iRootBoneIndex))) + { + MSG_BOX("Failed to Created : CInstance_Model"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} +#endif + +CComponent* CInstance_Model::Clone(void* pArg, CGameObject* pOwner) +{ + CInstance_Model* pInstance = new CInstance_Model(*this); + pInstance->m_pOwner = pOwner; + + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CInstance_Model"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +void CInstance_Model::Free() +{ + __super::Free(); + + Safe_Release(m_pVBInstance); + + for (auto& pMesh : m_Meshes) + Safe_Release(pMesh); + + Safe_Release(m_pComputeShader); + Safe_Release(m_pConstantBuffer); + Safe_Release(m_pParticleValueBuffer); +} + +void CInstance_Model::Describe_Entity() +{ + if (ImGui::TreeNode("Instance_Model")) + { + ImGui::Separator(); ImGui::Spacing(); + + if (ImGui::InputInt("NumInstance", &m_InstanceDesc.iNumInstance)) + { + Instane_Buffer_ReStruct(); + } + + if (ImGui::DragFloat3("SizeMin", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeMin))) + { + Instane_Buffer_ReStruct(); + } + + if (ImGui::DragFloat3("SizeMax", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeMax))) + { + Instane_Buffer_ReStruct(); + } + + + if (ImGui::DragFloat3("Center", reinterpret_cast<_float*>(&m_InstanceDesc.vCenter))) + { + Instane_Buffer_ReStruct(); + } + + if (ImGui::DragFloat3("Range", reinterpret_cast<_float*>(&m_InstanceDesc.vRange))) + { + Instane_Buffer_ReStruct(); + } + + if (ImGui::DragFloat2("Speed", reinterpret_cast<_float*>(&m_InstanceDesc.vSpeed))) + { + Instane_Buffer_ReStruct(); + } + + if (ImGui::DragFloat2("RotationSpeed", reinterpret_cast<_float*>(&m_InstanceDesc.vRotationSpeed))) + { + Instane_Buffer_ReStruct(); + } + + if (ImGui::DragFloat3("RotationMin", reinterpret_cast<_float*>(&m_InstanceDesc.vRotationAngleMin))) + { + Instane_Buffer_ReStruct(); + } + + if (ImGui::DragFloat3("RotationMax", reinterpret_cast<_float*>(&m_InstanceDesc.vRotationAngleMax))) + { + Instane_Buffer_ReStruct(); + } + + if (ImGui::DragFloat2("LifeTime", reinterpret_cast<_float*>(&m_InstanceDesc.vLifeTime))) + { + Instane_Buffer_ReStruct(); + } + + ImGui::TreePop(); + } + + ImGui::Separator(); +} diff --git a/Jusin154_Team3D/Engine/Private/Material.cpp b/Jusin154_Team3D/Engine/Private/Material.cpp index 2ce75d780..5103414fa 100644 --- a/Jusin154_Team3D/Engine/Private/Material.cpp +++ b/Jusin154_Team3D/Engine/Private/Material.cpp @@ -74,9 +74,9 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, const aiMaterial* pAI hr = CreateWICTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, &pSRV); } } + m_SaveMaterial.Path[i].push_back(szTextureFilePath); } - strcpy_s(szSaveDir, sizeof(_char) * MAX_PATH, szName); strcat_s(szSaveDir, sizeof(_char) * MAX_PATH, szExt); @@ -171,6 +171,7 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, HANDLE hFile, DWORD& strcat_s(szTextureDir, sizeof(_char) * MAX_PATH, szDir); strcat_s(szTextureDir, sizeof(_char) * MAX_PATH, szTextureName); + { _char szTextureFileName[MAX_PATH] = {}; _char szTextureFilePath[MAX_PATH] = {}; @@ -200,6 +201,7 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, HANDLE hFile, DWORD& hr = CreateWICTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, &pSRV); } } + } if (FAILED(hr)) { return E_FAIL; @@ -211,6 +213,46 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, HANDLE hFile, DWORD& return S_OK; } +HRESULT CMaterial::Initialize(const _char* pModelFilePath, const SaveMaterial& _SaveMaterial) +{ + for (size_t type = 0; type < 27; type++) + { + for (const auto& path : _SaveMaterial.Path[type]) + { + char szDrive[MAX_PATH] = {}; + char szDir[MAX_PATH] = {}; + _splitpath_s(pModelFilePath, szDrive, MAX_PATH, szDir, MAX_PATH, nullptr, 0, nullptr, 0); + + char szFullPath[MAX_PATH] = {}; + strcpy_s(szFullPath, szDrive); + strcat_s(szFullPath, path.c_str()); + + _tchar szPerfectPath[MAX_PATH] = {}; + MultiByteToWideChar(CP_ACP, 0, szFullPath, -1, szPerfectPath, MAX_PATH); + + ID3D11ShaderResourceView* pSRV = nullptr; + HRESULT hr = S_OK; + + const char* ext = strrchr(szFullPath, '.'); + if (ext) + { + if (strcmp(ext, ".dds") == 0) + hr = CreateDDSTextureFromFile(m_pDevice, szPerfectPath, nullptr, &pSRV); + else if (strcmp(ext, ".tga") == 0) + hr = S_OK; + else + hr = CreateWICTextureFromFile(m_pDevice, szPerfectPath, nullptr, &pSRV); + } + + if (FAILED(hr)) + return E_FAIL; + + m_SRVs[type].push_back(pSRV); + } + } + return S_OK; +} + CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, HANDLE hFile, DWORD& dwByte) { CMaterial* pInstance = new CMaterial(pDevice, pContext); @@ -224,6 +266,19 @@ CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex return pInstance; } +CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, const SaveMaterial& _SaveMaterial) +{ + CMaterial* pInstance = new CMaterial(pDevice, pContext); + + if (FAILED(pInstance->Initialize(pModelFilePath, _SaveMaterial))) + { + MSG_BOX("Failed to Created : CMaterial"); + Safe_Release(pInstance); + } + + return pInstance; +} + void CMaterial::Free() { diff --git a/Jusin154_Team3D/Engine/Private/Mesh.cpp b/Jusin154_Team3D/Engine/Private/Mesh.cpp index 7df2f7281..c4d0320ab 100644 --- a/Jusin154_Team3D/Engine/Private/Mesh.cpp +++ b/Jusin154_Team3D/Engine/Private/Mesh.cpp @@ -116,6 +116,40 @@ HRESULT CMesh::Initialize_Prototype(MODEL eType, vector& Bones, co return S_OK; } #endif + +HRESULT CMesh::Bind_Resources_Instance(ID3D11Buffer* pVBInstance, _uint iInstanceStride, _uint iBufferCount) +{ + ID3D11Buffer* VertexBuffers[] = { + m_pVB, + pVBInstance, + + }; + + _uint VertexStrides[] = { + m_iVertexStride, + iInstanceStride, + }; + + _uint Offsets[] = { + 0, + 0 + }; + + m_pContext->IASetVertexBuffers(0, iBufferCount, VertexBuffers, VertexStrides, Offsets); + m_pContext->IASetIndexBuffer(m_pIB, m_eIndexFormat, 0); + m_pContext->IASetPrimitiveTopology(m_ePrimitive); + + return S_OK; +} + +HRESULT CMesh::Render_Instance(_uint iNumInstance) +{ + m_pContext->DrawIndexedInstanced(m_iNumIndices, iNumInstance, 0, 0, 0); + + return S_OK; +} + + HRESULT CMesh::Initialize_Prototype(HANDLE hFile, DWORD& dwByte) { { // ¸â¹öº¯¼ö @@ -196,6 +230,70 @@ HRESULT CMesh::Initialize_Prototype(HANDLE hFile, DWORD& dwByte) return S_OK; } +HRESULT CMesh::Initialize_Prototype(MODEL eType, const CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix) +{ + strcpy_s(m_szName, _SaveMesh->Name); + + m_iMaterialIndex = _SaveMesh->MaterialIndex; + m_iNumVertexBuffers = 1; + m_iNumVertices = _SaveMesh->VertexCount; + + m_iNumIndices = _SaveMesh->IndexCount; + m_iIndexStride = 4; + + m_eIndexFormat = DXGI_FORMAT_R32_UINT; + m_ePrimitive = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST; + + m_Indices = _SaveMesh->Indices; + + m_Vertices.clear(); + m_Vertices.reserve(_SaveMesh->Vertices.size()); + + XMMATRIX matPre = PreTransformMatrix; + for (size_t i = 0; i < _SaveMesh->Vertices.size(); ++i) + { + _float3 pos = _SaveMesh->Vertices[i].Pos; + XMVECTOR v = XMLoadFloat3(&pos); + v = XMVector3TransformCoord(v, matPre); + XMFLOAT3 tp; + XMStoreFloat3(&tp, v); + m_Vertices.push_back(tp); + } + +#pragma region VERTEX_BUFFER + + HRESULT hr = MODEL::NONANIM == eType ? + Ready_VertexBuffer_For_NonAnim(_SaveMesh, PreTransformMatrix) : + Ready_VertexBuffer_For_Anim(pModel, _SaveMesh); + + if (FAILED(hr)) + return E_FAIL; + +#pragma endregion + +#pragma region INDEX_BUFFER + D3D11_BUFFER_DESC IBDesc{}; + IBDesc.ByteWidth = m_iIndexStride * m_iNumIndices; + IBDesc.Usage = D3D11_USAGE_DEFAULT; + IBDesc.BindFlags = D3D11_BIND_INDEX_BUFFER; + IBDesc.StructureByteStride = m_iIndexStride; + IBDesc.CPUAccessFlags = 0; + IBDesc.MiscFlags = 0; + + + D3D11_SUBRESOURCE_DATA InitialIBData{}; + InitialIBData.pSysMem = _SaveMesh->Indices.data(); + + if (FAILED(m_pDevice->CreateBuffer(&IBDesc, &InitialIBData, &m_pIB))) + return E_FAIL; + +#pragma endregion + + + + return S_OK; +} + HRESULT CMesh::Ready_VertexBuffer_For_NonAnim(HANDLE hFile, DWORD& dwByte) { D3D11_BUFFER_DESC VBDesc{}; @@ -254,6 +352,165 @@ HRESULT CMesh::Ready_VertexBuffer_For_Anim(HANDLE hFile, DWORD& dwByte) return S_OK; } +HRESULT CMesh::Ready_VertexBuffer_For_NonAnim(SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix) +{ + m_iVertexStride = sizeof(VTXMESH); + D3D11_BUFFER_DESC VBDesc{}; + VBDesc.ByteWidth = m_iVertexStride * m_iNumVertices; + VBDesc.Usage = D3D11_USAGE_DEFAULT; + VBDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + VBDesc.StructureByteStride = m_iVertexStride; + VBDesc.CPUAccessFlags = 0; + VBDesc.MiscFlags = 0; + + VTXMESH* pVertices = new VTXMESH[m_iNumVertices]; + ZeroMemory(pVertices, sizeof(VTXMESH) * m_iNumVertices); + + m_pVertexPositions = new _float3[m_iNumVertices]; + ZeroMemory(m_pVertexPositions, sizeof(_float3) * m_iNumVertices); + + for (_uint i = 0; i < m_iNumVertices; ++i) + { + memcpy(&pVertices[i].vPosition, &_SaveMesh->Vertices[i].Pos, sizeof(_float3)); + XMStoreFloat3(&pVertices[i].vPosition, + XMVector3TransformCoord(XMLoadFloat3(&pVertices[i].vPosition), PreTransformMatrix)); + + memcpy(&pVertices[i].vNormal, &_SaveMesh->Vertices[i].Normal, sizeof(_float3)); + XMStoreFloat3(&pVertices[i].vNormal, + XMVector3Normalize(XMVector3TransformNormal(XMLoadFloat3(&pVertices[i].vNormal), PreTransformMatrix))); + + memcpy(&pVertices[i].vTangent, &_SaveMesh->Vertices[i].Tan, sizeof(_float3)); + XMStoreFloat3(&pVertices[i].vTangent, + XMVector3Normalize(XMVector3TransformNormal(XMLoadFloat3(&pVertices[i].vTangent), PreTransformMatrix))); + + memcpy(&pVertices[i].vBinormal, &_SaveMesh->Vertices[i].BiNoraml, sizeof(_float3)); + XMStoreFloat3(&pVertices[i].vBinormal, + XMVector3Normalize(XMVector3TransformNormal(XMLoadFloat3(&pVertices[i].vBinormal), PreTransformMatrix))); + + pVertices[i].vTexcoord = _SaveMesh->Vertices[i].UV; + } + + D3D11_SUBRESOURCE_DATA InitialVBData{}; + InitialVBData.pSysMem = pVertices; + + if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &InitialVBData, &m_pVB))) + return E_FAIL; + + Safe_Delete_Array(pVertices); + + return S_OK; +} + +HRESULT CMesh::Ready_VertexBuffer_For_Anim(const CModel* pModel, SaveMesh* _SaveMesh) +{ + m_iVertexStride = sizeof(VTXANIMMESH); + D3D11_BUFFER_DESC VBDesc{}; + VBDesc.ByteWidth = m_iVertexStride * m_iNumVertices; + VBDesc.Usage = D3D11_USAGE_DEFAULT; + VBDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + VBDesc.StructureByteStride = m_iVertexStride; + VBDesc.CPUAccessFlags = 0; + VBDesc.MiscFlags = 0; + + VTXANIMMESH* pVertices = new VTXANIMMESH[m_iNumVertices]; + ZeroMemory(pVertices, sizeof(VTXANIMMESH) * m_iNumVertices); + + m_pVertexPositions = new _float3[m_iNumVertices]; + ZeroMemory(m_pVertexPositions, sizeof(_float3) * m_iNumVertices); + + for (_uint i = 0; i < m_iNumVertices; ++i) + { + memcpy(&pVertices[i].vPosition, &_SaveMesh->Vertices[i].Pos, sizeof(_float3)); + if (_SaveMesh->Vertices[i].bHasNormal) + memcpy(&pVertices[i].vNormal, &_SaveMesh->Vertices[i].Normal, sizeof(_float3)); + else + pVertices[i].vNormal = _float3(0.f, 1.f, 0.f); + if (_SaveMesh->Vertices[i].bHasTan) + memcpy(&pVertices[i].vTangent, &_SaveMesh->Vertices[i].Tan, sizeof(_float3)); + else + pVertices[i].vTangent = _float3(1.f, 0.f, 0.f); + + memcpy(&pVertices[i].vBinormal, &_SaveMesh->Vertices[i].BiNoraml, sizeof(_float3)); + + if (_SaveMesh->Vertices[i].bHasUV) + memcpy(&pVertices[i].vTexcoord, &_SaveMesh->Vertices[i].UV, sizeof(_float2)); + else + pVertices[i].vTexcoord = _float2(0.f, 0.f); + } + + m_iNumBones = (_uint)_SaveMesh->Bones.size(); + + m_offsetMatrices.reserve(m_iNumBones); + + m_pBoneMatrices = new _float4x4[0 == m_iNumBones ? 1 : m_iNumBones]; + ZeroMemory(m_pBoneMatrices, sizeof(_float4x4) * m_iNumBones); + + _float4x4 OffsetMatrix; + XMStoreFloat4x4(&OffsetMatrix, XMMatrixIdentity()); + + for (_uint i = 0; i < m_iNumBones; i++) + { + SaveBone _SaveBone = _SaveMesh->Bones[i]; + strcpy_s(m_szName, _SaveBone.Name); + + memcpy(&OffsetMatrix, &_SaveBone.OffsetMatrix, sizeof(_float4x4)); + + _int iBoneIndex = pModel->Get_BoneIndex(_SaveBone.Name); + + if (-1 == iBoneIndex) + return E_FAIL; + + m_BoneIndices.push_back(iBoneIndex); + m_offsetMatrices.push_back(OffsetMatrix); + + + for (_uint j = 0; j < _SaveBone.Weights.size(); j++) + { + SaveBoneWeight _SaveBoneWeight = _SaveBone.Weights[j]; + + if (0.f == pVertices[_SaveBoneWeight.VertexId].vBlendWeight.x) + { + pVertices[_SaveBoneWeight.VertexId].vBlendIndex.x = i; + pVertices[_SaveBoneWeight.VertexId].vBlendWeight.x = _SaveBoneWeight.Weight; + } + else if (0.f == pVertices[_SaveBoneWeight.VertexId].vBlendWeight.y) + { + pVertices[_SaveBoneWeight.VertexId].vBlendIndex.y = i; + pVertices[_SaveBoneWeight.VertexId].vBlendWeight.y = _SaveBoneWeight.Weight; + } + else if (0.f == pVertices[_SaveBoneWeight.VertexId].vBlendWeight.z) + { + pVertices[_SaveBoneWeight.VertexId].vBlendIndex.z = i; + pVertices[_SaveBoneWeight.VertexId].vBlendWeight.z = _SaveBoneWeight.Weight; + } + else + { + pVertices[_SaveBoneWeight.VertexId].vBlendIndex.w = i; + pVertices[_SaveBoneWeight.VertexId].vBlendWeight.w = _SaveBoneWeight.Weight; + } + } + } + + if (0 == m_iNumBones) + { + m_iNumBones = 1; + + m_BoneIndices.push_back(pModel->Get_BoneIndex(m_szName)); + + m_offsetMatrices.push_back(OffsetMatrix); + } + + D3D11_SUBRESOURCE_DATA InitialVBData{}; + InitialVBData.pSysMem = pVertices; + + if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &InitialVBData, &m_pVB))) + return E_FAIL; + + Safe_Delete_Array(pVertices); + + return S_OK; +} + HRESULT CMesh::Initialize(void* pArg) { return S_OK; @@ -491,6 +748,19 @@ CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, HANDL return pInstance; } +CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix) +{ + CMesh* pInstance = new CMesh(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype(eType, pModel, _SaveMesh, PreTransformMatrix))) + { + MSG_BOX("Failed to Created : CMesh"); + Safe_Release(pInstance); + } + + return pInstance; +} + CMesh* CMesh::Clone(void* pArg, class CGameObject* pOwner) { CMesh* pInstance = new CMesh(*this); diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 26f8b2448..d1b5950ae 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -59,6 +59,26 @@ _int CModel::Get_BoneIndex(const _char* pBoneName, vector Bones) return iBoneIndex; } +_int CModel::Get_BoneIndex(const _char* pBoneName) const +{ + _int iBoneIndex = {}; + + auto iter = find_if(m_Bones.begin(), m_Bones.end(), [&](CBone* pBone)->_bool + { + if (true == pBone->Compare_Name(pBoneName)) + return true; + + ++iBoneIndex; + + return false; + }); + + if (iter == m_Bones.end()) + return -1; + + return iBoneIndex; +} + void CModel::Change_AnimationIndex(_int iAnimationIndex, _bool bIsLoop, _float fLerpDuration, _bool bIgnoreCurrentIndex) { if (false == bIgnoreCurrentIndex && m_iCurrentAnimIndex == iAnimationIndex) { return; } @@ -164,6 +184,19 @@ _bool CModel::Play_Animation(_float fTimeDelta) return m_bIsFinishedAnim; } +void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop) +{ + if (m_iCurrentAnimIndex == iIndex) + return; + if (iIndex >= 0 && iIndex < m_iNumAnimations) + { + m_iCurrentAnimIndex = iIndex; + m_bIsLoop = isLoop; + } + else + m_iCurrentAnimIndex = -1; +} + void CModel::Stop_Animation() { if (-1 == m_iCurrentAnimIndex // Á¤Áö ȤÀº ½ÃÀÛÀ» ¾È½ÃÄÑÁØ ¾Ö´Ô @@ -329,6 +362,296 @@ HRESULT CModel::Ready_Bones(const aiNode* pAINode, _int iParentIndex) return S_OK; } +bool CModel::SaveAssimpModel(const _char* filename) +{ + if (!m_pAIScene) return false; + + _char szModel[MAX_PATH] = {}; + _char szName[MAX_PATH] = {}; + _splitpath_s(filename, nullptr, 0, nullptr, 0, szName, MAX_PATH, nullptr, 0); + strcat_s(szModel, sizeof(_char) * MAX_PATH, szName); + + _string savePath = string("../Bin/Resources/SaveFile/") + szModel; + + SaveModel modelData; + modelData.MeshCount = m_pAIScene->mNumMeshes; + modelData.MaterialCount = m_pAIScene->mNumMaterials; + + for (unsigned int i = 0; i < m_pAIScene->mNumMeshes; i++) + { + aiMesh* mesh = m_pAIScene->mMeshes[i]; + SaveMesh saveMesh{}; + strcpy_s(saveMesh.Name, mesh->mName.C_Str()); + saveMesh.VertexCount = mesh->mNumVertices; + saveMesh.IndexCount = mesh->mNumFaces * 3; + saveMesh.MaterialIndex = mesh->mMaterialIndex; + + saveMesh.Vertices.resize(saveMesh.VertexCount); + for (unsigned int i = 0; i < mesh->mNumVertices; i++) + { + saveMesh.Vertices[i].Pos = XMFLOAT3{ mesh->mVertices[i].x , mesh->mVertices[i].y,mesh->mVertices[i].z }; + + if (mesh->HasNormals()) + { + saveMesh.Vertices[i].Normal = XMFLOAT3{ + mesh->mNormals[i].x, + mesh->mNormals[i].y, + mesh->mNormals[i].z + }; + saveMesh.Vertices[i].bHasNormal = true; + } + else + { + saveMesh.Vertices[i].Normal = XMFLOAT3(0.f, 1.f, 0.f); + saveMesh.Vertices[i].bHasNormal = false; + } + + if (mesh->HasTangentsAndBitangents()) + { + saveMesh.Vertices[i].Tan = XMFLOAT3{ + mesh->mTangents[i].x, + mesh->mTangents[i].y, + mesh->mTangents[i].z + }; + saveMesh.Vertices[i].bHasTan = true; + } + else + { + saveMesh.Vertices[i].Tan = XMFLOAT3(1.f, 0.f, 0.f); + saveMesh.Vertices[i].bHasTan = false; + } + + saveMesh.Vertices[i].BiNoraml = XMFLOAT3{ + mesh->mBitangents[i].x, + mesh->mBitangents[i].y, + mesh->mBitangents[i].z + }; + + if (mesh->HasTextureCoords(0)) + { + saveMesh.Vertices[i].UV = XMFLOAT2{ + mesh->mTextureCoords[0][i].x, + mesh->mTextureCoords[0][i].y + }; + saveMesh.Vertices[i].bHasUV = true; + } + else + { + saveMesh.Vertices[i].UV = XMFLOAT2(0.f, 0.f); + saveMesh.Vertices[i].bHasUV = false; + } + saveMesh.Vertices[i].BlendIndex = XMUINT4(0, 0, 0, 0); + saveMesh.Vertices[i].BlendWeight = XMFLOAT4(0.f, 0.f, 0.f, 0.f); + } + saveMesh.BoneCount = mesh->mNumBones; + saveMesh.Bones.resize(mesh->mNumBones); + for (size_t j = 0; j < mesh->mNumBones; j++) + { + strcpy_s(saveMesh.Bones[j].Name, sizeof(saveMesh.Bones[j].Name), mesh->mBones[j]->mName.C_Str()); + + memcpy(&saveMesh.Bones[j].OffsetMatrix, &mesh->mBones[j]->mOffsetMatrix, sizeof(_float4x4)); + XMStoreFloat4x4(&saveMesh.Bones[j].OffsetMatrix, XMMatrixTranspose(XMLoadFloat4x4(&saveMesh.Bones[j].OffsetMatrix))); + saveMesh.Bones[j].WeightsCount = mesh->mBones[j]->mNumWeights; + saveMesh.Bones[j].Weights.resize(mesh->mBones[j]->mNumWeights); + for (size_t k = 0; k < saveMesh.Bones[j].WeightsCount; k++) + { + saveMesh.Bones[j].Weights[k].VertexId = mesh->mBones[j]->mWeights[k].mVertexId; + saveMesh.Bones[j].Weights[k].Weight = mesh->mBones[j]->mWeights[k].mWeight; + } + } + + saveMesh.Indices.reserve(saveMesh.IndexCount); + for (unsigned int i = 0; i < mesh->mNumFaces; i++) + { + aiFace& face = mesh->mFaces[i]; + for (unsigned int idx = 0; idx < face.mNumIndices; idx++) + saveMesh.Indices.push_back(face.mIndices[idx]); + } + + modelData.Meshes.push_back(saveMesh); + } + + for (size_t i = 0; i < m_Materials.size(); i++) + { + modelData.Materials.push_back(m_Materials[i]->Get_SaveMaterial()); + } + + std::vector allNodes; + SaveNodeRecursive(m_pAIScene->mRootNode, allNodes, -1); + + modelData.AnimationCount = m_pAIScene->mNumAnimations; + for (unsigned int i = 0; i < modelData.AnimationCount; i++) + { + aiAnimation* Anim = m_pAIScene->mAnimations[i]; + SaveAnimation saveAnim{}; + strcpy_s(saveAnim.Name, Anim->mName.C_Str()); + saveAnim.mDuration = (_float)Anim->mDuration; + saveAnim.mTicksPerSecond = (_float)Anim->mTicksPerSecond; + saveAnim.ChannelCount = Anim->mNumChannels; + + saveAnim.Channels.resize(Anim->mNumChannels); + for (size_t j = 0; j < saveAnim.ChannelCount; j++) + { + strcpy_s(saveAnim.Channels[j].Name, sizeof(saveAnim.Channels[j].Name), + Anim->mChannels[j]->mNodeName.C_Str()); + + saveAnim.Channels[j].ScalingKeyCount = Anim->mChannels[j]->mNumScalingKeys; + saveAnim.Channels[j].RotationKeyCount = Anim->mChannels[j]->mNumRotationKeys; + saveAnim.Channels[j].PositionKeyCount = Anim->mChannels[j]->mNumPositionKeys; + for (size_t k = 0; k < saveAnim.Channels[j].ScalingKeyCount; k++) + { + SaveKeyFrameVec Key; + Key.Time = (_float)Anim->mChannels[j]->mScalingKeys[k].mTime; + Key.Value = XMFLOAT3( + Anim->mChannels[j]->mScalingKeys[k].mValue.x, + Anim->mChannels[j]->mScalingKeys[k].mValue.y, + Anim->mChannels[j]->mScalingKeys[k].mValue.z); + saveAnim.Channels[j].ScalingKeys.push_back(Key); + } + for (size_t k = 0; k < saveAnim.Channels[j].RotationKeyCount; k++) + { + SaveKeyFrameRotation Key; + Key.Time = (_float)Anim->mChannels[j]->mRotationKeys[k].mTime; + Key.Value = XMFLOAT4( + Anim->mChannels[j]->mRotationKeys[k].mValue.x, + Anim->mChannels[j]->mRotationKeys[k].mValue.y, + Anim->mChannels[j]->mRotationKeys[k].mValue.z, + Anim->mChannels[j]->mRotationKeys[k].mValue.w); + saveAnim.Channels[j].RotationKeys.push_back(Key); + } + for (size_t k = 0; k < saveAnim.Channels[j].PositionKeyCount; k++) + { + SaveKeyFrameVec Key; + Key.Time = (_float)Anim->mChannels[j]->mPositionKeys[k].mTime; + Key.Value = XMFLOAT3( + Anim->mChannels[j]->mPositionKeys[k].mValue.x, + Anim->mChannels[j]->mPositionKeys[k].mValue.y, + Anim->mChannels[j]->mPositionKeys[k].mValue.z); + saveAnim.Channels[j].PositionKeys.push_back(Key); + } + } + modelData.Animations.push_back(saveAnim); + } + + FILE* fp = nullptr; + fopen_s(&fp, savePath.c_str(), "wb"); + if (!fp) return false; + + fwrite(&modelData.MeshCount, sizeof(_uint), 1, fp); + fwrite(&modelData.MaterialCount, sizeof(_uint), 1, fp); + fwrite(&modelData.AnimationCount, sizeof(_uint), 1, fp); + modelData.NodeCount = (_uint)allNodes.size(); + fwrite(&modelData.NodeCount, sizeof(_uint), 1, fp); + + for (auto& mesh : modelData.Meshes) + { + fwrite(&mesh.Name, sizeof(mesh.Name), 1, fp); + fwrite(&mesh.VertexCount, sizeof(_uint), 1, fp); + fwrite(&mesh.IndexCount, sizeof(_uint), 1, fp); + fwrite(&mesh.MaterialIndex, sizeof(_uint), 1, fp); + fwrite(&mesh.BoneCount, sizeof(_uint), 1, fp); + + fwrite(mesh.Vertices.data(), sizeof(SaveVertex), mesh.VertexCount, fp); + fwrite(mesh.Indices.data(), sizeof(_uint), mesh.IndexCount, fp); + for (auto& bone : mesh.Bones) + { + fwrite(&bone.Name, sizeof(bone.Name), 1, fp); + fwrite(&bone.OffsetMatrix, sizeof(XMFLOAT4X4), 1, fp); + fwrite(&bone.WeightsCount, sizeof(_uint), 1, fp); + for (auto& Weights : bone.Weights) + { + fwrite(&Weights.VertexId, sizeof(_uint), 1, fp); + fwrite(&Weights.Weight, sizeof(float), 1, fp); + } + } + } + + + for (auto& node : allNodes) + { + fwrite(node.Name, sizeof(node.Name), 1, fp); + fwrite(&node.ParentIndex, sizeof(int), 1, fp); + fwrite(&node.Transformation, sizeof(XMFLOAT4X4), 1, fp); + fwrite(&node.ChildrenCount, sizeof(_uint), 1, fp); + + for (auto child : node.ChildrenIndices) + { + fwrite(&child, sizeof(int), 1, fp); + } + } + + for (auto& Anim : modelData.Animations) + { + fwrite(Anim.Name, sizeof(Anim.Name), 1, fp); + fwrite(&Anim.mDuration, sizeof(_float), 1, fp); + fwrite(&Anim.mTicksPerSecond, sizeof(_float), 1, fp); + fwrite(&Anim.ChannelCount, sizeof(_uint), 1, fp); + for (size_t i = 0; i < Anim.ChannelCount; i++) + { + fwrite(Anim.Channels[i].Name, sizeof(Anim.Channels[i].Name), 1, fp); + + fwrite(&Anim.Channels[i].ScalingKeyCount, sizeof(_uint), 1, fp); + fwrite(Anim.Channels[i].ScalingKeys.data(), sizeof(SaveKeyFrameVec), Anim.Channels[i].ScalingKeyCount, fp); + + fwrite(&Anim.Channels[i].RotationKeyCount, sizeof(_uint), 1, fp); + fwrite(Anim.Channels[i].RotationKeys.data(), sizeof(SaveKeyFrameRotation), Anim.Channels[i].RotationKeyCount, fp); + + fwrite(&Anim.Channels[i].PositionKeyCount, sizeof(_uint), 1, fp); + fwrite(Anim.Channels[i].PositionKeys.data(), sizeof(SaveKeyFrameVec), Anim.Channels[i].PositionKeyCount, fp); + } + } + + for (auto& mat : modelData.Materials) + { + for (_uint i = 0; i < AI_TEXTURE_TYPE_MAX; i++) + { + _uint MaterialCount = static_cast<_uint>(mat.Path[i].size()); + fwrite(&MaterialCount, sizeof(_uint), 1, fp); + for (const auto& path : mat.Path[i]) + { + _uint len = static_cast<_uint>(path.size()); + fwrite(&len, sizeof(_uint), 1, fp); + fwrite(path.c_str(), sizeof(char), len, fp); + } + } + } + + fclose(fp); + + MSG_BOX("Save Succeed"); + + return true; +} +_int CModel::SaveNodeRecursive(const aiNode* pAINode, std::vector& outNodes, _int parentIndex) +{ + SaveNode node{}; + strcpy_s(node.Name, sizeof(node.Name), pAINode->mName.C_Str()); + node.ParentIndex = parentIndex; + + const aiMatrix4x4& m = pAINode->mTransformation; + node.Transformation = XMFLOAT4X4( + m.a1, m.a2, m.a3, m.a4, + m.b1, m.b2, m.b3, m.b4, + m.c1, m.c2, m.c3, m.c4, + m.d1, m.d2, m.d3, m.d4 + ); + + XMStoreFloat4x4(&node.Transformation, XMMatrixTranspose(XMLoadFloat4x4(&node.Transformation))); + + node.ChildrenCount = pAINode->mNumChildren; + node.ChildrenIndices.resize(node.ChildrenCount); + + int currentIndex = static_cast(outNodes.size()); + outNodes.push_back(node); + + for (size_t i = 0; i < pAINode->mNumChildren; i++) + { + int childIndex = SaveNodeRecursive(pAINode->mChildren[i], outNodes, currentIndex); + outNodes[currentIndex].ChildrenIndices[i] = childIndex; + } + + return currentIndex; +} #endif // EDITOR_PROJECT HRESULT CModel::Initialize_Prototype() @@ -336,11 +659,195 @@ HRESULT CModel::Initialize_Prototype() return S_OK; } +HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix) +{ + LoadData(pModelFilePath); + m_pSaveModel = m_pGameInstance->Load_SaveModel(pModelFilePath); + + m_eType = eType; + XMStoreFloat4x4(&m_PreTransformMatrix, PreTransformMatrix); + + Ready_Bones(m_pSaveModel->Nodes, 0, -1); + + if (FAILED(Ready_Meshes())) + return E_FAIL; + + if (FAILED(Ready_Materials(pModelFilePath))) + return E_FAIL; + + if (FAILED(Ready_Animations())) + return E_FAIL; + + + + return S_OK; +} + + HRESULT CModel::Initialize_Prototype(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex) { return Assimp_Model_Load(pModelFilePath, eType, PreTransformMatrix, iRootBoneIndex); } +bool CModel::LoadData(const _char* filename) +{ + FILE* fp = nullptr; + fopen_s(&fp, filename, "rb"); + if (!fp) return false; + + SaveModel NewModel = {}; + + fread(&NewModel.MeshCount, sizeof(_uint), 1, fp); + fread(&NewModel.MaterialCount, sizeof(_uint), 1, fp); + fread(&NewModel.AnimationCount, sizeof(_uint), 1, fp); + fread(&NewModel.NodeCount, sizeof(_uint), 1, fp); + + for (_uint i = 0; i < NewModel.MeshCount; i++) + { + SaveMesh mesh{}; + fread(&mesh.Name, sizeof(mesh.Name), 1, fp); + fread(&mesh.VertexCount, sizeof(_uint), 1, fp); + fread(&mesh.IndexCount, sizeof(_uint), 1, fp); + fread(&mesh.MaterialIndex, sizeof(_uint), 1, fp); + fread(&mesh.BoneCount, sizeof(_uint), 1, fp); + + mesh.Vertices.resize(mesh.VertexCount); + fread(mesh.Vertices.data(), sizeof(SaveVertex), mesh.VertexCount, fp); + + mesh.Indices.resize(mesh.IndexCount); + fread(mesh.Indices.data(), sizeof(_uint), mesh.IndexCount, fp); + + mesh.Bones.resize(mesh.BoneCount); + for (size_t i = 0; i < mesh.BoneCount; i++) + { + fread(&mesh.Bones[i].Name, sizeof(mesh.Bones[i].Name), 1, fp); + fread(&mesh.Bones[i].OffsetMatrix, sizeof(XMFLOAT4X4), 1, fp); + fread(&mesh.Bones[i].WeightsCount, sizeof(_uint), 1, fp); + mesh.Bones[i].Weights.resize(mesh.Bones[i].WeightsCount); + for (size_t j = 0;j < mesh.Bones[i].WeightsCount; j++) + { + fread(&mesh.Bones[i].Weights[j].VertexId, sizeof(_uint), 1, fp); + fread(&mesh.Bones[i].Weights[j].Weight, sizeof(_float), 1, fp); + } + } + NewModel.Meshes.push_back(mesh); + } + + NewModel.Nodes.resize(NewModel.NodeCount); + for (size_t i = 0; i < NewModel.NodeCount; i++) + { + fread(NewModel.Nodes[i].Name, sizeof(NewModel.Nodes[i].Name), 1, fp); + fread(&NewModel.Nodes[i].ParentIndex, sizeof(int), 1, fp); + fread(&NewModel.Nodes[i].Transformation, sizeof(XMFLOAT4X4), 1, fp); + fread(&NewModel.Nodes[i].ChildrenCount, sizeof(_uint), 1, fp); + NewModel.Nodes[i].ChildrenIndices.resize(NewModel.Nodes[i].ChildrenCount); + for (size_t j = 0; j < NewModel.Nodes[i].ChildrenCount; j++) + { + fread(&NewModel.Nodes[i].ChildrenIndices[j], sizeof(int), 1, fp); + } + } + + for (size_t i = 0; i < NewModel.AnimationCount; i++) + { + SaveAnimation saveAnim = {}; + fread(&saveAnim.Name, sizeof(saveAnim.Name), 1, fp); + fread(&saveAnim.mDuration, sizeof(_float), 1, fp); + fread(&saveAnim.mTicksPerSecond, sizeof(_float), 1, fp); + fread(&saveAnim.ChannelCount, sizeof(_uint), 1, fp); + saveAnim.Channels.resize(saveAnim.ChannelCount); + for (size_t j = 0; j < saveAnim.ChannelCount; j++) + { + fread(&saveAnim.Channels[j].Name, sizeof(saveAnim.Channels[j].Name), 1, fp); + + fread(&saveAnim.Channels[j].ScalingKeyCount, sizeof(_uint), 1, fp); + saveAnim.Channels[j].ScalingKeys.resize(saveAnim.Channels[j].ScalingKeyCount); + fread(saveAnim.Channels[j].ScalingKeys.data(), sizeof(SaveKeyFrameVec), saveAnim.Channels[j].ScalingKeyCount, fp); + + fread(&saveAnim.Channels[j].RotationKeyCount, sizeof(_uint), 1, fp); + saveAnim.Channels[j].RotationKeys.resize(saveAnim.Channels[j].RotationKeyCount); + fread(saveAnim.Channels[j].RotationKeys.data(), sizeof(SaveKeyFrameRotation), saveAnim.Channels[j].RotationKeyCount, fp); + + fread(&saveAnim.Channels[j].PositionKeyCount, sizeof(_uint), 1, fp); + saveAnim.Channels[j].PositionKeys.resize(saveAnim.Channels[j].PositionKeyCount); + fread(saveAnim.Channels[j].PositionKeys.data(), sizeof(SaveKeyFrameVec), saveAnim.Channels[j].PositionKeyCount, fp); + } + NewModel.Animations.push_back(saveAnim); + } + + NewModel.Materials.clear(); + for (_uint i = 0; i < NewModel.MaterialCount; i++) + { + SaveMaterial mat; + + for (_uint k = 0; k < AI_TEXTURE_TYPE_MAX; k++) + { + _uint MaterialCount = 0; + fread(&MaterialCount, sizeof(_uint), 1, fp); + mat.Path[k].resize(MaterialCount); + for (_uint j = 0; j < MaterialCount; j++) + { + _uint len = 0; + fread(&len, sizeof(_uint), 1, fp); + std::string temp; + temp.resize(len); + fread(&temp[0], sizeof(char), len, fp); + mat.Path[k][j] = temp; + } + } + + + /*_uint diffuseCount = 0; + fread(&diffuseCount, sizeof(_uint), 1, fp); + mat.DiffusePath.resize(diffuseCount); + for (_uint j = 0; j < diffuseCount; j++) + { + _uint len = 0; + fread(&len, sizeof(_uint), 1, fp); + std::string temp; + temp.resize(len); + fread(&temp[0], sizeof(char), len, fp); + mat.DiffusePath[j] = temp; + } + + _uint normalCount = 0; + fread(&normalCount, sizeof(_uint), 1, fp); + mat.NormalPath.resize(normalCount); + for (_uint j = 0; j < normalCount; j++) + { + _uint len = 0; + fread(&len, sizeof(_uint), 1, fp); + std::string temp; + temp.resize(len); + fread(&temp[0], sizeof(char), len, fp); + mat.NormalPath[j] = temp; + } + + _uint specularCount = 0; + fread(&specularCount, sizeof(_uint), 1, fp); + mat.SpecularPath.resize(specularCount); + for (_uint j = 0; j < specularCount; j++) + { + _uint len = 0; + fread(&len, sizeof(_uint), 1, fp); + std::string temp; + temp.resize(len); + fread(&temp[0], sizeof(char), len, fp); + mat.SpecularPath[j] = temp; + }*/ + + NewModel.Materials.push_back(mat); + } + + + fclose(fp); + + m_SaveModel.push_back(NewModel); + + m_pGameInstance->Add_SaveModel(filename, m_SaveModel.back()); + + return true; +} + CModel* CModel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex) { CModel* pInstance = new CModel(pDevice, pContext); @@ -364,34 +871,36 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma } m_iRootBoneIndex = iRootBoneIndex; - Assimp::Importer Importer = {}; - const aiScene* pAIScene = { nullptr }; - - pAIScene = Importer.ReadFile(pModelFilePath, iFlag); - if (nullptr == pAIScene) { + m_pAIScene = m_Importer.ReadFile(pModelFilePath, iFlag); + if (nullptr == m_pAIScene) return E_FAIL; - } + #pragma region Bone - if (FAILED(Ready_Bones(pAIScene->mRootNode, -1))) { + if (FAILED(Ready_Bones(m_pAIScene->mRootNode, -1))) { return E_FAIL; } #pragma endregion #pragma region Mesh - if (FAILED(Ready_Meshes(eType, pAIScene, PreTransformMatrix))) { + if (FAILED(Ready_Meshes(eType, m_pAIScene, PreTransformMatrix))) { return E_FAIL; } #pragma endregion #pragma region Material - if (FAILED(Ready_Materials(pAIScene, pModelFilePath))) { + if (FAILED(Ready_Materials(m_pAIScene, pModelFilePath))) { return E_FAIL; } #pragma endregion #pragma region Animation - if (FAILED(Ready_Animations(pAIScene))) { + if (FAILED(Ready_Animations(m_pAIScene))) { return E_FAIL; } #pragma endregion + + m_pGameInstance->Save_ModelFilePath(pModelFilePath); + + m_pGameInstance->Add_ModelToMap(pModelFilePath, this); + return S_OK; } @@ -407,6 +916,73 @@ HRESULT CModel::Initialize(void* pArg) return S_OK; } +HRESULT CModel::Ready_Meshes() +{ + m_iNumMeshes = m_pSaveModel->MeshCount; + + for (size_t i = 0; i < m_iNumMeshes; i++) + { + CMesh* pMesh = CMesh::Create(m_pDevice, m_pContext, m_eType, this, &m_pSaveModel->Meshes[i], XMLoadFloat4x4(&m_PreTransformMatrix)); + if (nullptr == pMesh) + return E_FAIL; + + m_Meshes.push_back(pMesh); + } + + return S_OK; +} + +HRESULT CModel::Ready_Materials(const _char* pModelFilePath) +{ + m_iNumMaterials = m_pSaveModel->MaterialCount; + + for (size_t i = 0; i < m_iNumMaterials; i++) + { + CMaterial* pMaterial = CMaterial::Create(m_pDevice, m_pContext, pModelFilePath, m_pSaveModel->Materials[i]); + if (nullptr == pMaterial) + return E_FAIL; + + m_Materials.push_back(pMaterial); + } + + return S_OK; +} + +HRESULT CModel::Ready_Bones(const std::vector& allNodes, _int currentIndex, _int parentIndex) +{ + const SaveNode& saveNode = allNodes[currentIndex]; + + CBone* pBone = CBone::Create(saveNode, parentIndex); + + if (!pBone) return E_FAIL; + + m_Bones.push_back(pBone); + + _int myIndex = _int(m_Bones.size() - 1); + + for (size_t i = 0; i < saveNode.ChildrenIndices.size(); i++) + { + Ready_Bones(allNodes, saveNode.ChildrenIndices[i], myIndex); + } + return S_OK; +} + +HRESULT CModel::Ready_Animations() +{ + m_iNumAnimations = m_pSaveModel->AnimationCount; + + for (size_t i = 0; i < m_iNumAnimations; i++) + { + CAnimation* pAnimation = CAnimation::Create(this, &m_pSaveModel->Animations[i]); + if (nullptr == pAnimation) + return E_FAIL; + + m_Animations.push_back(pAnimation); + } + + return S_OK; +} + CModel* CModel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CModel* pInstance = new CModel(pDevice, pContext); @@ -420,6 +996,19 @@ CModel* CModel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) return pInstance; } +CModel* CModel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pModelFilePath,_fmatrix PreTransformMatrix) +{ + CModel* pInstance = new CModel(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype(eType, pModelFilePath, PreTransformMatrix))) + { + MSG_BOX("Failed to Created : CModel"); + Safe_Release(pInstance); + } + + return pInstance; +} + CComponent* CModel::Clone(void* pArg, class CGameObject* pOwner) { CModel* pInstance = new CModel(*this); @@ -458,6 +1047,8 @@ void CModel::Free() SAFE_RELEASE(m_pTransform); SAFE_RELEASE(m_pLerpAnim); + + m_SaveModel.clear(); } void CModel::Describe_Entity() diff --git a/Jusin154_Team3D/Engine/Public/Animation.h b/Jusin154_Team3D/Engine/Public/Animation.h index a4b8b03cf..9b9fc2ca9 100644 --- a/Jusin154_Team3D/Engine/Public/Animation.h +++ b/Jusin154_Team3D/Engine/Public/Animation.h @@ -33,10 +33,17 @@ class ENGINE_DLL CAnimation : public CBase private: HRESULT Initialize(HANDLE hFile, DWORD& dwByte); + // ¹ÙÀ̳ʸ® + HRESULT Initialize(const class CModel* pModel,SaveAnimation* pSaveAnimation); + // HRESULT Combined_Initialize(); _uint Get_BoneIndex(const char* pChannelName); private: + SaveAnimation* m_pSaveAnim = { nullptr }; + _char m_szName[MAX_PATH] = {}; + _float m_fTickPerSecond = {}; + _bool m_bPause = { FALSE }; // ¾Ö´ÔÆÛÁî À妽º _string m_strName = {}; // ¾Ö´Ô À̸§ _float m_fCurrentTrackPosition = {}; // ÇöÀç Æ®·¢ À§Ä¡ @@ -52,6 +59,9 @@ class ENGINE_DLL CAnimation : public CBase public: static CAnimation* Create(HANDLE hFile, DWORD& dwByte); + // ¹ÙÀ̳ʸ® + static CAnimation* Create(const class CModel* pModel, SaveAnimation* pSaveAnimation); + // CAnimation* Clone(); virtual void Free() override; void Describe_Entity(); diff --git a/Jusin154_Team3D/Engine/Public/Bone.h b/Jusin154_Team3D/Engine/Public/Bone.h index 6f6972292..1657173ce 100644 --- a/Jusin154_Team3D/Engine/Public/Bone.h +++ b/Jusin154_Team3D/Engine/Public/Bone.h @@ -37,6 +37,9 @@ class ENGINE_DLL CBone final : public CBase private: HRESULT Initialize(HANDLE hFile, DWORD& dwByte); + // ¹ÙÀ̳ʸ® + HRESULT Initialize(const SaveNode& _SaveNode, _int iParentIndex); + // public: static CBone* Create(HANDLE hFile, DWORD& dwByte); @@ -47,6 +50,9 @@ class ENGINE_DLL CBone final : public CBase public: HRESULT SaveAsBinary(HANDLE hFile, DWORD& dwByte); static CBone* Create(const aiNode* pAINode, _int iParentIndex); + // ¹ÙÀ̳ʸ® + static CBone* Create(const SaveNode& _SaveNode, _int iParentIndex); + // private: HRESULT Initialize(const aiNode* pAINode, _int iParentIndex); #endif // EDITOR_PROJECT diff --git a/Jusin154_Team3D/Engine/Public/Channel.h b/Jusin154_Team3D/Engine/Public/Channel.h index 0f2f55ece..fb1379f26 100644 --- a/Jusin154_Team3D/Engine/Public/Channel.h +++ b/Jusin154_Team3D/Engine/Public/Channel.h @@ -30,18 +30,25 @@ class ENGINE_DLL CChannel : public CBase } private: HRESULT Initialize(HANDLE hFile, DWORD& dwByte); + // ¹ÙÀ̳ʸ® + HRESULT Initialize(const class CModel* pModel, SaveChannel* pSaveChannel); + // HRESULT Initialize(const vector& Bones, _uint iIndex); private: - _char m_szName[MAX_PATH] = {}; // ¿µÇâÀ» ¹ÞÀ» º»ÀÇ À̸§ - _int m_iBoneIndex = { -1 }; // º» º¤ÅÍ¿¡¼­ º»ÀÇ À妽º - _uint m_iNumKeyFrames = {}; // AnimationÀÇ m_fDurationµ¿¾È ÀÌ º»ÀÌ ÃëÇØ¾ßÇÒ Å°ÇÁ·¹ÀÓÀÇ °¹¼ö - vector m_KeyFrames; // ŰÇÁ·¹ÀÓ º¤ÅÍ + _char m_szName[MAX_PATH] = {}; // ¿µÇâÀ» ¹ÞÀ» º»ÀÇ À̸§ + _int m_iBoneIndex = { -1 }; // º» º¤ÅÍ¿¡¼­ º»ÀÇ À妽º + _uint m_iNumKeyFrames = {}; // AnimationÀÇ m_fDurationµ¿¾È ÀÌ º»ÀÌ ÃëÇØ¾ßÇÒ Å°ÇÁ·¹ÀÓÀÇ °¹¼ö + _float4x4 m_PreTransformMatrix = {}; + vector m_KeyFrames; // ŰÇÁ·¹ÀÓ º¤ÅÍ public: static CChannel* Create(const vector& Bones, _uint iIndex); // ·²ÇÁÀü¿ë static CChannel* Create(HANDLE hFile, DWORD& dwByte); + // ¹ÙÀ̳ʸ® + static CChannel* Create(const class CModel* pModel, SaveChannel* pSaveChannel); + // virtual void Free() override; }; diff --git a/Jusin154_Team3D/Engine/Public/Component.h b/Jusin154_Team3D/Engine/Public/Component.h index 6cdda3b6b..4ff590597 100644 --- a/Jusin154_Team3D/Engine/Public/Component.h +++ b/Jusin154_Team3D/Engine/Public/Component.h @@ -32,6 +32,7 @@ class ENGINE_DLL CComponent abstract : public CBase #ifdef _DEBUG virtual void Describe_Entity()PURE; // IMGUI Àü¿ë #endif + }; NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Public/ComputeShader.h b/Jusin154_Team3D/Engine/Public/ComputeShader.h new file mode 100644 index 000000000..5d61cdf3b --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/ComputeShader.h @@ -0,0 +1,55 @@ +#pragma once + +#include "Base.h" + +NS_BEGIN(Engine) + +class ENGINE_DLL CComputeShader final : public CBase +{ + +private: + CComputeShader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual ~CComputeShader() = default; + + +public: + HRESULT Initialize(const _tchar* pShaderFilePath, const _char* pStartFunctionName, _uint iNumElement, _uint iNumInputBuffer, _uint iOutputStructStride, _uint iInputStructStride[]); +public: + HRESULT Dispatch(_uint iSRVIndex, _uint iUAVIndex, _float3 vGroupCount, ID3D11Buffer** ppBuffers, ID3D11Buffer* pConstantBuffer = nullptr); + +private: + void Bind_SRV(_uint iIndex); + void Bind_UAV(_uint iIndex); + void Reset(); + + HRESULT CreateBuffer(_uint iNumElement, _uint iNumInputBuffer, _uint iStructStride[]); + HRESULT CreateResurceViews(_uint iNumElement, _uint iNumInputBuffer); + HRESULT CreateComputeShader(const _tchar* pShaderFilePath, const _char* pStartFunctionName); + +private: + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; + class CGameInstance* m_pGameInstance = { nullptr }; + +private: + vector m_pInputSRV = {}; + ID3D11UnorderedAccessView* m_pOutputUAV = nullptr; + + vector m_pInputBuffer = {}; + ID3D11Buffer* m_pOutputBuffer = nullptr; + + vector m_pStagingBuffer = {}; + ID3D11ComputeShader* m_pComputeShader = nullptr; + +private: + _uint m_iNumElement = 0; // Àμö °³¼ö + _uint m_iNumInputBuffer = 0; // ÀÎDz ¹öÆÛÀÇ °³¼ö + _uint m_iOutputStructStride = 0; // µ¥ÀÌÅÍ Å©±â + +public: + static CComputeShader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _tchar* pShaderFilePath, const _char* pStartFunctionName, _uint iNumElement, _uint iNumInputBuffer, _uint iOutputStructStride, _uint iInputStructStride[]); + virtual void Free() override; + +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index 4a8b78d27..780e6d550 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -55,6 +55,111 @@ typedef struct tagShadowLight _float fWidth, fHeight, fNear, fFar; }SHADOW_LIGHT_DESC; +struct SaveVertex +{ + XMFLOAT3 Pos; + XMFLOAT3 Normal; + XMFLOAT3 Tan; + XMFLOAT3 BiNoraml; + XMFLOAT2 UV; + + bool bHasNormal; + bool bHasTan; + bool bHasUV; + + XMUINT4 BlendIndex; + XMFLOAT4 BlendWeight; +}; + +struct SaveBoneWeight +{ + unsigned int VertexId; + float Weight; +}; + +struct SaveBone +{ + char Name[64]; + XMFLOAT4X4 OffsetMatrix; + int BoneIndex; + unsigned int WeightsCount; + vectorWeights; +}; + +struct SaveNode +{ + char Name[64]; + int ParentIndex; + unsigned int ChildrenCount; + XMFLOAT4X4 Transformation; + vector ChildrenIndices; +}; + +struct SaveMesh +{ + char Name[64]; + unsigned int VertexCount; + unsigned int IndexCount; + unsigned int MaterialIndex; + unsigned int BoneCount; + + vector Vertices; + vector Indices; + + vector Bones; +}; + +struct SaveMaterial +{ + vector Path[27]; + +}; + +struct SaveKeyFrameVec +{ + float Time; + XMFLOAT3 Value; +}; + +struct SaveKeyFrameRotation +{ + float Time; + XMFLOAT4 Value; +}; + +struct SaveChannel +{ + char Name[64]; + unsigned int ScalingKeyCount; + unsigned int RotationKeyCount; + unsigned int PositionKeyCount; + + vector ScalingKeys; + vector RotationKeys; + vector PositionKeys; +}; + +struct SaveAnimation +{ + char Name[128]; + float mDuration; + float mTicksPerSecond; + unsigned int ChannelCount; + vector Channels; +}; + +struct SaveModel +{ + unsigned int MeshCount; + unsigned int MaterialCount; + unsigned int AnimationCount; + unsigned int NodeCount; + vector Meshes; + vector Materials; + vector Animations; + vectorNodes; +}; + typedef struct tagVertexInstance_Particle { _float4 vRight; @@ -171,4 +276,23 @@ typedef struct tagVertexPosInstanceParticleDesc }; }VTX_POS_INSTANCE_PARTICLE; + +typedef struct tagVertexModelInstanceParticleDesc +{ + static constexpr unsigned int iNumElements = { 10 }; + static constexpr D3D11_INPUT_ELEMENT_DESC Elements[] = { + { "POSITION" , 0 , DXGI_FORMAT_R32G32B32_FLOAT , 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, + { "NORMAL" , 0 , DXGI_FORMAT_R32G32B32_FLOAT , 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0}, + { "TANGENT" , 0 , DXGI_FORMAT_R32G32B32_FLOAT , 0, 24, D3D11_INPUT_PER_VERTEX_DATA, 0}, + { "BINORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 36, D3D11_INPUT_PER_VERTEX_DATA, 0}, + { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 48, D3D11_INPUT_PER_VERTEX_DATA, 0}, + + { "TEXCOORD", 1, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 0, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, + { "TEXCOORD", 2, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 16, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, + { "TEXCOORD", 3, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 32, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, + { "TEXCOORD", 4, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 48, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, + { "TEXCOORD", 5, DXGI_FORMAT_R32G32_FLOAT, 1, 64, D3D11_INPUT_PER_INSTANCE_DATA, 1 } + }; +}VTX_MODEL_INSTANCE_PARTICLE; + NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index 1132f5d4d..ed0bcd649 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -63,6 +63,13 @@ class ENGINE_DLL CGameInstance final : public CBase { return m_pPrototype_Manager->CPrototype_Manager::Clone_Prototype(iLevelNumber, pArg, pOwner); } + + template + void Asset_Description(_uint iLevel, const _char* pComponentName, CComponent** ppOut, void* pDesc, class CGameObject* pOwner = nullptr) + { + return m_pPrototype_Manager->CPrototype_Manager::Asset_Description(iLevel, pComponentName, ppOut, pDesc, pOwner); + } + #pragma endregion #pragma region OBJECT_MANAGER @@ -165,6 +172,24 @@ class ENGINE_DLL CGameInstance final : public CBase #pragma region SOUND_MANAGER #pragma endregion +public: + void Add_ModelToMap(const _char* filePath, CModel* pModel) + { + m_ModelMap[filePath] = pModel; + } + + void Add_SaveModel(const _char* filePath, SaveModel sModel) + { + m_sModelMap[filePath] = sModel; + } + + SaveModel* Load_SaveModel(const _char* filePath); + _bool SaveAssimpModel(const _char* filename); + void Save_ModelFilePath(const _char* FilePath); + const _char* Load_ModelFilePath(_uint iIndex); + const _char* Load_BinaryModelFilePath(_uint iIndex); + size_t ModelFilePathCount(); + private: class CGraphic_Device* m_pGraphic_Device = { nullptr }; class CTimer_Manager* m_pTimer_Manager = { nullptr }; @@ -189,6 +214,10 @@ class ENGINE_DLL CGameInstance final : public CBase _float m_fTimer_DrawCall = { 0.f }; _float m_fTimer_Present = { 0.f }; _float m_fTimer_FrameCount = { 0.f }; + + vector m_FilePaths = {}; + map m_ModelMap; + map m_sModelMap; #endif // _DEBUG public: diff --git a/Jusin154_Team3D/Engine/Public/Instance_Model.h b/Jusin154_Team3D/Engine/Public/Instance_Model.h new file mode 100644 index 000000000..ffaa18034 --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/Instance_Model.h @@ -0,0 +1,106 @@ +#pragma once + +#include "Component.h" +#include "Assimp/scene.h" + +NS_BEGIN(Engine) + +class ENGINE_DLL CInstance_Model final : public CComponent +{ +public: + typedef struct tagInstanceDesc + { + _int iNumInstance = {}; // ÀνºÅϽº °³¼ö + _float2 vLifeTime = {}; // ¶óÀÌÇÁ ŸÀÓ min , max + _float3 vSizeMin = {}; // »çÀÌÁî min xyz + _float3 vSizeMax = {}; // »çÀÌÁî max xyz + _float3 vRotationAngleMin = {}; // ·ÎÅ×ÀÌ¼Ç min x y z for angle + _float3 vRotationAngleMax = {};// ·ÎÅ×ÀÌ¼Ç max x y z for angle + _float2 vRotationSpeed = {}; // ·ÎÅ×ÀÌ¼Ç ½ºÇǵå min , max + _float2 vSpeed = {}; // ½ºÇǵå min , max + _float3 vCenter = {}; // ¼¾ÅÍ À§Ä¡ + _float3 vRange = {}; // À§Ä¡ ¹üÀ§ + + }INSTANCE_DESC; + + typedef struct tagCSParticleDesc + { + _float fTimeDelta; + _float fPadding; + _float fPadding2; + _float fPadding3; + + }CS_PARTICLE_DESC; + + typedef struct tagCSParticleValueDesc + { + _float fSpeed; + _float fRotaionSpeed; + + _float4 vOriginRight; + _float4 vOriginUp; + _float4 vOriginLook; + _float4 vOriginTranslation; + + _float2 fPadding; + + }CS_PARTICLE_VALUE_DESC; + +public: + CInstance_Model(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CInstance_Model(const CInstance_Model& rhs); + virtual ~CInstance_Model() = default; + +public: +#ifdef EDITOR_PROJECT + virtual HRESULT Initialize_Prototype(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex); + +#endif + + virtual HRESULT Initialize(void* pArg) override; + void Drop(_float fTimeDelta); +public: + HRESULT Render(_uint iMeshIndx); + void Instane_Buffer_ReStruct(); + _uint Get_NumMeshes() const { return m_iNumMeshes; } +private: +#ifdef EDITOR_PROJECT + HRESULT Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex); + HRESULT Ready_Meshes(MODEL eType, const aiScene* pAIScene, _fmatrix& PreTransformMatrix); +#endif + HRESULT Create_Instance_Buffer(const INSTANCE_DESC* pDesc); + HRESULT Create_SubResource_Buffer(); + +private: + ID3D11Buffer* m_pVBInstance = { nullptr }; + + INSTANCE_DESC m_InstanceDesc = {}; + + _uint m_iInstanceStride = {}; + _uint m_iNumInstance = {}; + + _uint m_iNumBuffer = {}; + _uint m_iNumMeshes = {}; + _int m_iRootBoneIndex = { -1 }; + + MODEL m_eType = {}; + _float4x4 m_PreTransformMatrix = {}; + + vector m_Meshes = {}; + vector m_Bones = {}; // ³ªÁß¿¡ Ȥ½Ã ¾Ö´Ô¸Þ½¬¸¦ ÀνºÅÏ½Ì ÇÒ ÀÏÀÌ ÀÖÀ»Áöµµ ¸ð¸£´Ï ³²°Ü³õÀ½ + +private: + class CComputeShader* m_pComputeShader = {}; + ID3D11Buffer* m_pConstantBuffer = { nullptr }; // ÄÄǻƮ ½¦À̵å Àü¿ë »ó¼ö¹öÆÛ + ID3D11Buffer* m_pParticleValueBuffer = { nullptr }; // ÄÄǻƮ ½¦ÀÌµå µÎ¹øÂ° ¹öÆÛ (½ºÇǵå, ·ÎÅ×À̼Ç) + +public: +#ifdef EDITOR_PROJECT + static CInstance_Model* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex); +#endif + virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr); + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Public/Material.h b/Jusin154_Team3D/Engine/Public/Material.h index 0d71f57b9..4c8764da7 100644 --- a/Jusin154_Team3D/Engine/Public/Material.h +++ b/Jusin154_Team3D/Engine/Public/Material.h @@ -12,13 +12,14 @@ class ENGINE_DLL CMaterial final : public CBase public: HRESULT Bind_SRV(class CShader* pShader, const _char* pConstantName, _uint iType, _uint iTextureIndex); - + SaveMaterial Get_SaveMaterial() { return m_SaveMaterial; } private: class CGameInstance* m_pGameInstance = { nullptr }; ID3D11Device* m_pDevice = { nullptr }; ID3D11DeviceContext* m_pContext = { nullptr }; vector m_SRVs[AI_TEXTURE_TYPE_MAX]; + SaveMaterial m_SaveMaterial; #ifdef EDITOR_PROJECT public: @@ -30,10 +31,15 @@ class ENGINE_DLL CMaterial final : public CBase #endif // EDITOR_PROJECT virtual HRESULT Initialize(const _char* pModelFilePath, HANDLE hFile, DWORD& dwByte); - + // ¹ÙÀ̳ʸ® + HRESULT Initialize(const _char* pModelFilePath, const SaveMaterial& _SaveMaterial); + // public: static CMaterial* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, HANDLE hFile, DWORD& dwByte); + // ¹ÙÀ̳ʸ® + static CMaterial* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePathconst, const SaveMaterial& _SaveMaterial); + // virtual void Free() override; }; diff --git a/Jusin154_Team3D/Engine/Public/Mesh.h b/Jusin154_Team3D/Engine/Public/Mesh.h index f5b9e5169..5fede893e 100644 --- a/Jusin154_Team3D/Engine/Public/Mesh.h +++ b/Jusin154_Team3D/Engine/Public/Mesh.h @@ -29,12 +29,21 @@ class ENGINE_DLL CMesh final : public CVIBuffer HRESULT SaveAsBinary(HANDLE hFile, DWORD& dwByte); #endif // EDITOR_PROJECT +public: + //ÀνºÅÏ½Ì ¸ðµ¨ Àü¿ë µå·Î¿ì, ¹ÙÀεù ÇÔ¼ö + virtual HRESULT Bind_Resources_Instance(ID3D11Buffer* pVBInstance, _uint iInstanceStride, _uint iBufferCount); + virtual HRESULT Render_Instance(_uint iNumInstance); + private: virtual HRESULT Initialize_Prototype(HANDLE hFile, DWORD& dwByte); virtual HRESULT Initialize(void* pArg) override; HRESULT Ready_VertexBuffer_For_NonAnim(HANDLE hFile, DWORD& dwByte); HRESULT Ready_VertexBuffer_For_Anim(HANDLE hFile, DWORD& dwByte); - + // ¹ÙÀ̳ʸ® + virtual HRESULT Initialize_Prototype(MODEL eType, const class CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix); + HRESULT Ready_VertexBuffer_For_NonAnim(SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix); + HRESULT Ready_VertexBuffer_For_Anim(const class CModel* pModel, SaveMesh* _SaveMesh); + // private: _char m_szName[MAX_PATH] = {}; _uint m_iMaterialIndex = {}; @@ -43,9 +52,16 @@ class ENGINE_DLL CMesh final : public CVIBuffer vector<_int> m_BoneIndices; _float4x4* m_pBoneMatrices = { nullptr }; vector<_float4x4> m_offsetMatrices; + // ¹ÙÀ̳ʸ® + std::vector<_uint> m_Indices; + std::vector<_float3> m_Vertices; + // public: static CMesh* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, HANDLE hFile, DWORD& dwByte); + // ¹ÙÀ̳ʸ® + static CMesh* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const class CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix); + // virtual CMesh* Clone(void* pArg, class CGameObject* pOwner = nullptr) override; virtual void Free() override; void Describe_Entity() override; diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 292b2529e..b248ee612 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -13,11 +13,12 @@ class ENGINE_DLL CModel final : public CComponent public: static _int Get_BoneIndex(const _char* pBoneName, vector Bones); // º»ÀÇ º¤ÅÍ¿Í À̸§À» ³Ñ°ÜÁÖ¸é À妽º¸¦ ³Ñ°ÜÁÜ ( n ¼øÈ¸ ) + _int Get_BoneIndex(const _char* pBoneName) const; void Set_RootBoneIndex(_int iIndex) { m_iRootBoneIndex = iIndex; } void Change_AnimationIndex(_int iAnimationIndex, _bool bIsLoop, _float fLerpDuration, _bool bIgnoreCurrentIndex = false); // ¾Ö´Ï¸ÞÀ̼ÇÀ» ´Ù¸¥ À妽º·Î º¯°æÇÔ _bool Play_Animation(_float fTimeDelta); // ¾Ö´Ï¸ÞÀ̼ǿ¡ µ¨Å¸Å¸ÀÓÀ» ³Ö¾îÁÜ + void Set_AnimationIndex(_uint iIndex, _bool isLoop = true); void Stop_Animation(); // ¾Ö´Ï¸ÞÀ̼ÇÀ» Á¤Áö (Ãʱâ»óÅ·Î) - void Get_CurrentAnimationState(); _bool IsFinishedAnim() const { return m_bIsFinishedAnim; } _bool IsFinishedLerp() const { return m_bIsFinishedLerp; } void RefreshAnim(); // ¾Ö´ÔÀ» ÇöÀç ¾Ö´ÔÀÇ Ãʱâ»óÅ·ΠµÇµ¹¸² @@ -34,6 +35,7 @@ class ENGINE_DLL CModel final : public CComponent _matrix Get_BoneMatrix(_uint iBoneIndex); _float4x4* Get_PreTransformMatrixPtr() { return &m_PreTransformMatrix; } + _float4x4 Get_PreTransformMatrix() const { return m_PreTransformMatrix; }; void Get_BoneMatrices(_float4x4* pOut); _uint Get_BonesNum() const { return (_uint)m_Bones.size(); } @@ -51,9 +53,18 @@ class ENGINE_DLL CModel final : public CComponent HRESULT Ready_Materials(const aiScene* pAIScene, const _char* pModelFilePath); HRESULT Ready_Animations(const aiScene* pAIScene); HRESULT Ready_Bones(const aiNode* pAINode, _int iParentIndex); + // ¹ÙÀ̳ʸ® + bool SaveAssimpModel(const _char* filename); + _int SaveNodeRecursive(const aiNode* pAINode, std::vector& outNodes, _int parentIndex); + // #endif // EDITOR_PROJECT +private: + const aiScene* m_pAIScene = { nullptr }; + Assimp::Importer m_Importer; + + private: MODEL m_eType = {}; // ¸ðµ¨ÀÇ Å¸ÀÔ _float4x4 m_PreTransformMatrix = {}; // »çÀü¿¡ ·çÆ®º»¿¡ °öÇØÁÙ ¸ÅÆ®¸¯½º @@ -81,12 +92,32 @@ class ENGINE_DLL CModel final : public CComponent class CTransform* m_pTransform = { nullptr }; // ¸ðµ¨ ´ë»óÀÇ Æ®·£½ºÆû + // ¹ÙÀ̳ʸ® + SaveModel* m_pSaveModel = { nullptr }; + list m_SaveModel; + // + private: virtual HRESULT Initialize_Prototype() override; + // ¹ÙÀ̳ʸ® + virtual HRESULT Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix); + bool LoadData(const _char* filename); + // virtual HRESULT Initialize(void* pArg) override; +private: + // ¹ÙÀ̳ʸ® + HRESULT Ready_Meshes(); + HRESULT Ready_Materials(const _char* pModelFilePath); + HRESULT Ready_Bones(const std::vector& allNodes, _int currentIndex, _int parentIndex); + HRESULT Ready_Animations(); + // + public: static CModel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + // ¹ÙÀ̳ʸ® + static CModel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix = XMMatrixIdentity()); + // virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr); virtual void Free(); public: void Describe_Entity() override; diff --git a/Jusin154_Team3D/Engine/Public/Prototype_Manager.h b/Jusin154_Team3D/Engine/Public/Prototype_Manager.h index 28cef4d70..ed01a4907 100644 --- a/Jusin154_Team3D/Engine/Public/Prototype_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Prototype_Manager.h @@ -8,6 +8,7 @@ #include "Texture.h" #include "Cell.h" #include "Model.h" +#include "Instance_Model.h" NS_BEGIN(Engine) @@ -62,12 +63,54 @@ class CPrototype_Manager final : public CBase return dynamic_cast(pObject->Clone(_pArg, pOwner)); } +#ifdef _DEBUG +public: + //ƯÁ¤ ŸÀÔÀÇ ÄÄÆ÷³ÍÆ®µéÀÇ À̸§À» ÅëÇÑ ÄÞº¸¹Ú½º , À̹ÌÁö´Â À̹ÌÁö Ŭ¸³À» + //¸¸µé°í ¼±ÅÃÇÒ ½Ã¿¡ ³» ppOut¿¡ Ŭ·ÐÇÏ´Â ±â´ÉÀ» ´ã´ç + template + void Asset_Description(_uint iLevel , const _char* pComponentName , CComponent** ppOut , void* pDesc , class CGameObject* pOwner = nullptr) + { + vector pComponentNames = {}; + + + for (auto& Pair : m_pAssets[iLevel]) + { + + if (typeid(*Pair.second) == typeid(T)) // °°Àº ŸÀÔÀÇ ÄÄÆ÷³ÍÆ® ¿´´Ù¸é + { + _string strName = CMyTools::ToString(Pair.first); + + pComponentNames.push_back(strName.c_str()); + } + } + + _int iCurrentItem = 0; + + if (GUI::Combo("pComponentName", &iCurrentItem, pComponentNames.data(), (_int)pComponentNames.size())) + { + if (*ppOut != nullptr) + Safe_Release(*ppOut); + + _string strComponentName = pComponentNames[iCurrentItem]; + _wstring wstrComponentName = CMyTools::ToWstring(strComponentName); + + auto iter = m_pAssets[iLevel].find(wstrComponentName); + + if (iter == m_pAssets[iLevel].end()) { + return; + } + + *ppOut = iter->second->Clone(pDesc , pOwner); + } + } +#endif + private: - CGameInstance* m_pGameInstance = { nullptr }; - ID3D11Device* m_pDevice = { nullptr }; - ID3D11DeviceContext* m_pContext = { nullptr }; - vector* m_pPrototypes = { nullptr }; - map<_wstring, CComponent*>* m_pAssets = { nullptr }; + CGameInstance* m_pGameInstance = { nullptr }; + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; + vector* m_pPrototypes = { nullptr }; + map<_wstring, CComponent*>* m_pAssets = { nullptr }; _uint m_iLevelNumber = { };