├── 10 ├── DX12Tutorial10 │ ├── DX12Tutorial10.sln │ ├── DX12Tutorial10.vcxproj │ ├── DX12Tutorial10.vcxproj.filters │ ├── Res │ │ ├── Act │ │ │ └── ActEnemy.json │ │ ├── Anm │ │ │ ├── Animation.json │ │ │ └── AnmTitle.json │ │ ├── Cell │ │ │ ├── CellEnemy.json │ │ │ ├── CellFont.json │ │ │ └── CellPlayer.json │ │ ├── NoiseTexture.hlsl │ │ ├── Objects.png │ │ ├── PixelShader.hlsl │ │ ├── SE │ │ │ ├── Bomb.wav │ │ │ ├── MainGame.xwm │ │ │ ├── PlayerShot.wav │ │ │ ├── Start.wav │ │ │ └── bgm.xwm │ │ ├── TextFont.png │ │ ├── TextFont.xcf │ │ ├── Title.png │ │ ├── Title.xcf │ │ ├── UnknownPlanet.png │ │ └── VertexShader.hlsl │ └── Src │ │ ├── Action.cpp │ │ ├── Action.h │ │ ├── Animation.cpp │ │ ├── Animation.h │ │ ├── Audio.cpp │ │ ├── Audio.h │ │ ├── Collision.cpp │ │ ├── Collision.h │ │ ├── GamePad.cpp │ │ ├── GamePad.h │ │ ├── Graphics.cpp │ │ ├── Graphics.h │ │ ├── Json.cpp │ │ ├── Json.h │ │ ├── Main.cpp │ │ ├── PSO.cpp │ │ ├── PSO.h │ │ ├── Scene.cpp │ │ ├── Scene.h │ │ ├── Scene │ │ ├── EndingScene.cpp │ │ ├── EndingScene.h │ │ ├── GameOverScene.cpp │ │ ├── GameOverScene.h │ │ ├── MainGameScene.cpp │ │ ├── MainGameScene.h │ │ ├── PauseScene.cpp │ │ ├── PauseScene.h │ │ ├── TitleScene.cpp │ │ └── TitleScene.h │ │ ├── Sprite.cpp │ │ ├── Sprite.h │ │ ├── Texture.cpp │ │ ├── Texture.h │ │ ├── Timer.cpp │ │ ├── Timer.h │ │ └── d3dx12.h └── DX12講義10.doc ├── 11 ├── DX12Tutorial11 │ ├── DX12Tutorial11.sln │ ├── DX12Tutorial11.vcxproj │ ├── DX12Tutorial11.vcxproj.filters │ ├── Res │ │ ├── Act │ │ │ └── ActEnemy.json │ │ ├── Anm │ │ │ ├── Animation.json │ │ │ └── AnmTitle.json │ │ ├── Cell │ │ │ ├── CellEnemy.json │ │ │ ├── CellFont.json │ │ │ └── CellPlayer.json │ │ ├── NoiseTexture.hlsl │ │ ├── Objects.png │ │ ├── PixelShader.hlsl │ │ ├── SE │ │ │ ├── Bomb.wav │ │ │ ├── BombBoss.wav │ │ │ ├── Boss1st.xwm │ │ │ ├── Hit.wav │ │ │ ├── MainGame.xwm │ │ │ ├── PlayerShot.wav │ │ │ └── Start.wav │ │ ├── TextFont.png │ │ ├── Title.png │ │ ├── UnknownPlanet.png │ │ └── VertexShader.hlsl │ └── Src │ │ ├── Action.cpp │ │ ├── Action.h │ │ ├── Animation.cpp │ │ ├── Animation.h │ │ ├── Audio.cpp │ │ ├── Audio.h │ │ ├── Collision.cpp │ │ ├── Collision.h │ │ ├── GamePad.cpp │ │ ├── GamePad.h │ │ ├── Graphics.cpp │ │ ├── Graphics.h │ │ ├── Json.cpp │ │ ├── Json.h │ │ ├── Main - Copy.cpp │ │ ├── Main.cpp │ │ ├── PSO.cpp │ │ ├── PSO.h │ │ ├── Scene.cpp │ │ ├── Scene.h │ │ ├── Scene │ │ ├── EndingScene.cpp │ │ ├── EndingScene.h │ │ ├── GameOverScene.cpp │ │ ├── GameOverScene.h │ │ ├── MainGameScene.cpp │ │ ├── MainGameScene.h │ │ ├── PauseScene.cpp │ │ ├── PauseScene.h │ │ ├── TitleScene.cpp │ │ └── TitleScene.h │ │ ├── Sprite.cpp │ │ ├── Sprite.h │ │ ├── Texture.cpp │ │ ├── Texture.h │ │ ├── Timer.cpp │ │ ├── Timer.h │ │ └── d3dx12.h └── DX12講義11.doc ├── 12 ├── DX12Tutorial12 │ ├── DX12Tutorial12.sln │ ├── DX12Tutorial12.vcxproj │ ├── DX12Tutorial12.vcxproj.filters │ ├── Res │ │ ├── Act │ │ │ └── ActEnemy.json │ │ ├── Anm │ │ │ ├── Animation.json │ │ │ └── AnmTitle.json │ │ ├── Cell │ │ │ ├── CellEnemy.json │ │ │ ├── CellFont.json │ │ │ └── CellPlayer.json │ │ ├── FontPhenomena.fnt │ │ ├── FontPhenomena.png │ │ ├── NoiseTexture.hlsl │ │ ├── Objects.png │ │ ├── PixelShader.hlsl │ │ ├── SE │ │ │ ├── Bomb.wav │ │ │ ├── BombBoss.wav │ │ │ ├── Boss1st.xwm │ │ │ ├── Hit.wav │ │ │ ├── MainGame.xwm │ │ │ ├── PlayerShot.wav │ │ │ └── Start.wav │ │ ├── TextFont.png │ │ ├── Title.png │ │ ├── UnknownPlanet.png │ │ └── VertexShader.hlsl │ └── Src │ │ ├── Action.cpp │ │ ├── Action.h │ │ ├── Animation.cpp │ │ ├── Animation.h │ │ ├── Audio.cpp │ │ ├── Audio.h │ │ ├── Collision.cpp │ │ ├── Collision.h │ │ ├── GamePad.cpp │ │ ├── GamePad.h │ │ ├── Graphics.cpp │ │ ├── Graphics.h │ │ ├── Json.cpp │ │ ├── Json.h │ │ ├── Main.cpp │ │ ├── PSO.cpp │ │ ├── PSO.h │ │ ├── Scene.cpp │ │ ├── Scene.h │ │ ├── Scene │ │ ├── EndingScene.cpp │ │ ├── EndingScene.h │ │ ├── GameOverScene.cpp │ │ ├── GameOverScene.h │ │ ├── MainGameScene.cpp │ │ ├── MainGameScene.h │ │ ├── PauseScene.cpp │ │ ├── PauseScene.h │ │ ├── TitleScene.cpp │ │ └── TitleScene.h │ │ ├── Sprite.cpp │ │ ├── Sprite.h │ │ ├── Texture.cpp │ │ ├── Texture.h │ │ ├── Timer.cpp │ │ ├── Timer.h │ │ └── d3dx12.h └── DX12講義12.doc ├── .gitignore ├── 01 └── DX12講義01.doc ├── 02 ├── DX12Tutorial02 │ ├── DX12Tutorial02.sln │ ├── DX12Tutorial02.vcxproj │ ├── DX12Tutorial02.vcxproj.filters │ ├── Debug │ │ └── DX12Tutorial02.tlog │ │ │ └── DX12Tutorial02.lastbuildstate │ └── Src │ │ ├── Main.cpp │ │ └── d3dx12.h ├── DX12講義02.doc ├── Direct3D_Part4_Picture1.png ├── Direct3D_Part4_Picture1_cr.png ├── Direct3D_Part4_Picture2.png ├── Direct3D_Part4_Picture2_cr.png ├── Direct3D_Part4_Picture3.png ├── Direct3D_Part4_Picture4.png ├── Direct3D_Part4_Picture5.png ├── pictures.xcf ├── rendering_timeline.png └── rendering_timeline.xcf ├── 03 ├── 100202.png ├── DX12Tutorial03 │ ├── .gitignore │ ├── DX12Tutorial03.sln │ ├── DX12Tutorial03.vcxproj │ ├── DX12Tutorial03.vcxproj.filters │ ├── Res │ │ ├── PixelShader.hlsl │ │ └── VertexShader.hlsl │ └── Src │ │ ├── Main.cpp │ │ └── d3dx12.h ├── DX12講義03.doc ├── add_shader_01.png ├── add_shader_01_cr.png ├── add_shader_02.png ├── graphics_pipeline.png ├── graphics_pipeline.xcf ├── graphics_pipeline_x.xcf ├── primitives.png └── primitives.xcf ├── 04 ├── DX12Tutorial04 │ ├── .gitignore │ ├── DX12Tutorial04.sln │ ├── DX12Tutorial04.vcxproj │ ├── DX12Tutorial04.vcxproj.filters │ ├── Res │ │ ├── PixelShader.hlsl │ │ └── VertexShader.hlsl │ └── Src │ │ ├── Main.cpp │ │ └── d3dx12.h ├── DX12講義04.doc ├── polygon.xcf ├── polygon_using_index_buffer.png └── polygon_using_vertex_buffer.png ├── 05 ├── DX12Tutorial05 │ ├── DX12Tutorial05.sln │ ├── DX12Tutorial05.vcxproj │ ├── DX12Tutorial05.vcxproj.filters │ ├── Res │ │ ├── PixelShader.hlsl │ │ ├── UnknownPlanet.png │ │ └── VertexShader.hlsl │ └── Src │ │ ├── Main.cpp │ │ ├── Texture.cpp │ │ ├── Texture.h │ │ └── d3dx12.h ├── DX12講義05.doc └── Material │ └── UnknownPlanet.blend ├── 06 ├── DX12Tutorial06 │ ├── DX12Tutorial06.sln │ ├── DX12Tutorial06.vcxproj │ ├── DX12Tutorial06.vcxproj.filters │ ├── Res │ │ ├── NoiseTexture.hlsl │ │ ├── PixelShader.hlsl │ │ ├── UnknownPlanet.png │ │ ├── VertexShader.hlsl │ │ └── terrain.png │ └── Src │ │ ├── Main.cpp │ │ ├── Texture.cpp │ │ ├── Texture.h │ │ └── d3dx12.h └── DX12講義06.doc ├── 07 ├── DX12Tutorial07 │ ├── DX12Tutorial07.sln │ ├── DX12Tutorial07.vcxproj │ ├── DX12Tutorial07.vcxproj.filters │ ├── Res │ │ ├── NoiseTexture.hlsl │ │ ├── PixelShader.hlsl │ │ ├── UnknownPlanet.png │ │ └── VertexShader.hlsl │ └── Src │ │ ├── Main.cpp │ │ ├── PSO.cpp │ │ ├── PSO.h │ │ ├── Sprite.cpp │ │ ├── Sprite.h │ │ ├── Texture.cpp │ │ ├── Texture.h │ │ └── d3dx12.h ├── DX12講義07.doc └── erratta ├── 08 ├── DX12Tutorial08 │ ├── DX12Tutorial08.sln │ ├── DX12Tutorial08.vcxproj │ ├── DX12Tutorial08.vcxproj.filters │ ├── Res │ │ ├── NoiseTexture.hlsl │ │ ├── Objects.png │ │ ├── PixelShader.hlsl │ │ ├── UnknownPlanet.png │ │ ├── VertexShader.hlsl │ │ └── animation.json │ └── Src │ │ ├── Action.cpp │ │ ├── Action.h │ │ ├── Animation.cpp │ │ ├── Animation.h │ │ ├── Json.cpp │ │ ├── Json.h │ │ ├── Main.cpp │ │ ├── PSO.cpp │ │ ├── PSO.h │ │ ├── Sprite.cpp │ │ ├── Sprite.h │ │ ├── Texture.cpp │ │ ├── Texture.h │ │ ├── Timer.cpp │ │ ├── Timer.h │ │ └── d3dx12.h ├── DX12講義08.doc └── errata ├── 09 ├── DX12Tutorial09 │ ├── DX12Tutorial09.sln │ ├── DX12Tutorial09.vcxproj │ ├── DX12Tutorial09.vcxproj.filters │ ├── Res │ │ ├── Act │ │ │ └── ActEnemy.json │ │ ├── Anm │ │ │ ├── Animation.json │ │ │ └── AnmTitle.json │ │ ├── Cell │ │ │ ├── CellEnemy.json │ │ │ ├── CellFont.json │ │ │ └── CellPlayer.json │ │ ├── NoiseTexture.hlsl │ │ ├── Objects.png │ │ ├── PixelShader.hlsl │ │ ├── TextFont.png │ │ ├── Title.png │ │ ├── UnknownPlanet.png │ │ └── VertexShader.hlsl │ └── Src │ │ ├── Action.cpp │ │ ├── Action.h │ │ ├── Animation.cpp │ │ ├── Animation.h │ │ ├── Collision.cpp │ │ ├── Collision.h │ │ ├── GamePad.cpp │ │ ├── GamePad.h │ │ ├── Graphics.cpp │ │ ├── Graphics.h │ │ ├── Json.cpp │ │ ├── Json.h │ │ ├── Main.cpp │ │ ├── PSO.cpp │ │ ├── PSO.h │ │ ├── Scene.cpp │ │ ├── Scene.h │ │ ├── Scene │ │ ├── EndingScene.cpp │ │ ├── EndingScene.h │ │ ├── GameOverScene.cpp │ │ ├── GameOverScene.h │ │ ├── MainGameScene.cpp │ │ ├── MainGameScene.h │ │ ├── PauseScene.cpp │ │ ├── PauseScene.h │ │ ├── TitleScene.cpp │ │ └── TitleScene.h │ │ ├── Sprite.cpp │ │ ├── Sprite.h │ │ ├── Texture.cpp │ │ ├── Texture.h │ │ ├── Timer.cpp │ │ ├── Timer.h │ │ └── d3dx12.h └── DX12講義09.doc ├── LICENSE ├── ScreenShots ├── GamePlay00.jpg ├── GamePlay01.jpg ├── GamePlay02.jpg └── Title.jpg ├── d3dx12.h ├── readme.md └── 田中講師後期シラバス.xls /01/DX12講義01.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/01/DX12講義01.doc -------------------------------------------------------------------------------- /02/DX12Tutorial02/DX12Tutorial02.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DX12Tutorial02", "DX12Tutorial02.vcxproj", "{C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.ActiveCfg = Debug|x64 17 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.Build.0 = Debug|x64 18 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.ActiveCfg = Debug|Win32 19 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.Build.0 = Debug|Win32 20 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.ActiveCfg = Release|x64 21 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.Build.0 = Release|x64 22 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.ActiveCfg = Release|Win32 23 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /02/DX12Tutorial02/DX12Tutorial02.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | ソース ファイル 20 | 21 | 22 | 23 | 24 | ヘッダー ファイル 25 | 26 | 27 | -------------------------------------------------------------------------------- /02/DX12Tutorial02/Debug/DX12Tutorial02.tlog/DX12Tutorial02.lastbuildstate: -------------------------------------------------------------------------------- 1 | #TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1 2 | Debug|Win32|C:\usr\local\projects\DX12Tutorial\02\DX12Tutorial02\| 3 | -------------------------------------------------------------------------------- /02/DX12Tutorial02/Src/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/02/DX12Tutorial02/Src/Main.cpp -------------------------------------------------------------------------------- /02/DX12講義02.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/02/DX12講義02.doc -------------------------------------------------------------------------------- /02/Direct3D_Part4_Picture1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/02/Direct3D_Part4_Picture1.png -------------------------------------------------------------------------------- /02/Direct3D_Part4_Picture1_cr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/02/Direct3D_Part4_Picture1_cr.png -------------------------------------------------------------------------------- /02/Direct3D_Part4_Picture2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/02/Direct3D_Part4_Picture2.png -------------------------------------------------------------------------------- /02/Direct3D_Part4_Picture2_cr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/02/Direct3D_Part4_Picture2_cr.png -------------------------------------------------------------------------------- /02/Direct3D_Part4_Picture3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/02/Direct3D_Part4_Picture3.png -------------------------------------------------------------------------------- /02/Direct3D_Part4_Picture4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/02/Direct3D_Part4_Picture4.png -------------------------------------------------------------------------------- /02/Direct3D_Part4_Picture5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/02/Direct3D_Part4_Picture5.png -------------------------------------------------------------------------------- /02/pictures.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/02/pictures.xcf -------------------------------------------------------------------------------- /02/rendering_timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/02/rendering_timeline.png -------------------------------------------------------------------------------- /02/rendering_timeline.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/02/rendering_timeline.xcf -------------------------------------------------------------------------------- /03/100202.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/03/100202.png -------------------------------------------------------------------------------- /03/DX12Tutorial03/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | *.diagsession 10 | 11 | # User-specific files (MonoDevelop/Xamarin Studio) 12 | *.userprefs 13 | 14 | # Build results 15 | [Dd]ebug/ 16 | [Dd]ebugPublic/ 17 | [Rr]elease/ 18 | [Rr]eleases/ 19 | [Xx]64/ 20 | [Xx]86/ 21 | [Bb]uild/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | 26 | # Visual Studio 2015 cache/options directory 27 | .vs/ 28 | # Uncomment if you have tasks that create the project's static files in wwwroot 29 | #wwwroot/ 30 | 31 | # MSTest test Results 32 | [Tt]est[Rr]esult*/ 33 | [Bb]uild[Ll]og.* 34 | 35 | # NUNIT 36 | *.VisualState.xml 37 | TestResult.xml 38 | 39 | # Build Results of an ATL Project 40 | [Dd]ebugPS/ 41 | [Rr]eleasePS/ 42 | dlldata.c 43 | 44 | # DNX 45 | project.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | *.sap 91 | 92 | # TFS 2012 Local Workspace 93 | $tf/ 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | *.DotSettings.user 102 | 103 | # JustCode is a .NET coding add-in 104 | .JustCode 105 | 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | 109 | # DotCover is a Code Coverage Tool 110 | *.dotCover 111 | 112 | # NCrunch 113 | _NCrunch_* 114 | .*crunch*.local.xml 115 | nCrunchTemp_* 116 | 117 | # MightyMoose 118 | *.mm.* 119 | AutoTest.Net/ 120 | 121 | # Web workbench (sass) 122 | .sass-cache/ 123 | 124 | # Installshield output folder 125 | [Ee]xpress/ 126 | 127 | # DocProject is a documentation generator add-in 128 | DocProject/buildhelp/ 129 | DocProject/Help/*.HxT 130 | DocProject/Help/*.HxC 131 | DocProject/Help/*.hhc 132 | DocProject/Help/*.hhk 133 | DocProject/Help/*.hhp 134 | DocProject/Help/Html2 135 | DocProject/Help/html 136 | 137 | # Click-Once directory 138 | publish/ 139 | 140 | # Publish Web Output 141 | *.[Pp]ublish.xml 142 | *.azurePubxml 143 | 144 | # TODO: Un-comment the next line if you do not want to checkin 145 | # your web deploy settings because they may include unencrypted 146 | # passwords 147 | #*.pubxml 148 | *.publishproj 149 | 150 | # NuGet Packages 151 | *.nupkg 152 | # The packages folder can be ignored because of Package Restore 153 | **/packages/* 154 | # except build/, which is used as an MSBuild target. 155 | !**/packages/build/ 156 | # Uncomment if necessary however generally it will be regenerated when needed 157 | #!**/packages/repositories.config 158 | # NuGet v3's project.json files produces more ignoreable files 159 | *.nuget.props 160 | *.nuget.targets 161 | 162 | # Microsoft Azure Build Output 163 | csx/ 164 | *.build.csdef 165 | 166 | # Microsoft Azure Emulator 167 | ecf/ 168 | rcf/ 169 | 170 | # Windows Store app package directory 171 | AppPackages/ 172 | BundleArtifacts/ 173 | 174 | # Visual Studio cache files 175 | # files ending in .cache can be ignored 176 | *.[Cc]ache 177 | # but keep track of directories ending in .cache 178 | !*.[Cc]ache/ 179 | 180 | # Others 181 | ClientBin/ 182 | [Ss]tyle[Cc]op.* 183 | ~$* 184 | *~ 185 | *.dbmdl 186 | *.dbproj.schemaview 187 | *.pfx 188 | *.publishsettings 189 | node_modules/ 190 | orleans.codegen.cs 191 | 192 | # RIA/Silverlight projects 193 | Generated_Code/ 194 | 195 | # Backup & report files from converting an old project file 196 | # to a newer Visual Studio version. Backup files are not needed, 197 | # because we have git ;-) 198 | _UpgradeReport_Files/ 199 | Backup*/ 200 | UpgradeLog*.XML 201 | UpgradeLog*.htm 202 | 203 | # SQL Server files 204 | *.mdf 205 | *.ldf 206 | 207 | # Business Intelligence projects 208 | *.rdl.data 209 | *.bim.layout 210 | *.bim_*.settings 211 | 212 | # Microsoft Fakes 213 | FakesAssemblies/ 214 | 215 | # GhostDoc plugin setting file 216 | *.GhostDoc.xml 217 | 218 | # Node.js Tools for Visual Studio 219 | .ntvs_analysis.dat 220 | 221 | # Visual Studio 6 build log 222 | *.plg 223 | 224 | # Visual Studio 6 workspace options file 225 | *.opt 226 | 227 | # Visual Studio LightSwitch build output 228 | **/*.HTMLClient/GeneratedArtifacts 229 | **/*.DesktopClient/GeneratedArtifacts 230 | **/*.DesktopClient/ModelManifest.xml 231 | **/*.Server/GeneratedArtifacts 232 | **/*.Server/ModelManifest.xml 233 | _Pvt_Extensions 234 | 235 | # LightSwitch generated files 236 | GeneratedArtifacts/ 237 | ModelManifest.xml 238 | 239 | # Paket dependency manager 240 | .paket/paket.exe 241 | 242 | # FAKE - F# Make 243 | .fake/ 244 | -------------------------------------------------------------------------------- /03/DX12Tutorial03/DX12Tutorial03.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DX12Tutorial03", "DX12Tutorial03.vcxproj", "{C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.ActiveCfg = Debug|x64 17 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.Build.0 = Debug|x64 18 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.ActiveCfg = Debug|Win32 19 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.Build.0 = Debug|Win32 20 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.ActiveCfg = Release|x64 21 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.Build.0 = Release|x64 22 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.ActiveCfg = Release|Win32 23 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /03/DX12Tutorial03/DX12Tutorial03.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | ソース ファイル 20 | 21 | 22 | 23 | 24 | ヘッダー ファイル 25 | 26 | 27 | 28 | 29 | リソース ファイル 30 | 31 | 32 | リソース ファイル 33 | 34 | 35 | -------------------------------------------------------------------------------- /03/DX12Tutorial03/Res/PixelShader.hlsl: -------------------------------------------------------------------------------- 1 | struct PSInput 2 | { 3 | float4 position : SV_POSITION; 4 | float4 color : COLOR; 5 | }; 6 | 7 | float4 main(PSInput input) : SV_TARGET 8 | { 9 | return input.color; 10 | } -------------------------------------------------------------------------------- /03/DX12Tutorial03/Res/VertexShader.hlsl: -------------------------------------------------------------------------------- 1 | struct PSInput 2 | { 3 | float4 position : SV_POSITION; 4 | float4 color : COLOR; 5 | }; 6 | 7 | PSInput main(float3 pos : POSITION, float4 color : COLOR) 8 | { 9 | PSInput input; 10 | input.position = float4(pos, 1.0f); 11 | input.color = color; 12 | return input; 13 | } -------------------------------------------------------------------------------- /03/DX12Tutorial03/Src/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/03/DX12Tutorial03/Src/Main.cpp -------------------------------------------------------------------------------- /03/DX12講義03.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/03/DX12講義03.doc -------------------------------------------------------------------------------- /03/add_shader_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/03/add_shader_01.png -------------------------------------------------------------------------------- /03/add_shader_01_cr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/03/add_shader_01_cr.png -------------------------------------------------------------------------------- /03/add_shader_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/03/add_shader_02.png -------------------------------------------------------------------------------- /03/graphics_pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/03/graphics_pipeline.png -------------------------------------------------------------------------------- /03/graphics_pipeline.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/03/graphics_pipeline.xcf -------------------------------------------------------------------------------- /03/graphics_pipeline_x.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/03/graphics_pipeline_x.xcf -------------------------------------------------------------------------------- /03/primitives.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/03/primitives.png -------------------------------------------------------------------------------- /03/primitives.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/03/primitives.xcf -------------------------------------------------------------------------------- /04/DX12Tutorial04/DX12Tutorial04.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DX12Tutorial04", "DX12Tutorial04.vcxproj", "{C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.ActiveCfg = Debug|x64 17 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.Build.0 = Debug|x64 18 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.ActiveCfg = Debug|Win32 19 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.Build.0 = Debug|Win32 20 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.ActiveCfg = Release|x64 21 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.Build.0 = Release|x64 22 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.ActiveCfg = Release|Win32 23 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /04/DX12Tutorial04/DX12Tutorial04.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | ソース ファイル 20 | 21 | 22 | 23 | 24 | ヘッダー ファイル 25 | 26 | 27 | 28 | 29 | リソース ファイル 30 | 31 | 32 | リソース ファイル 33 | 34 | 35 | -------------------------------------------------------------------------------- /04/DX12Tutorial04/Res/PixelShader.hlsl: -------------------------------------------------------------------------------- 1 | struct PSInput 2 | { 3 | float4 position : SV_POSITION; 4 | float4 color : COLOR; 5 | }; 6 | 7 | float4 main(PSInput input) : SV_TARGET 8 | { 9 | return input.color; 10 | } -------------------------------------------------------------------------------- /04/DX12Tutorial04/Res/VertexShader.hlsl: -------------------------------------------------------------------------------- 1 | /** 2 | * VertexShader.hlsl 3 | */ 4 | 5 | struct RootConstants 6 | { 7 | float4x4 matViewProjection; 8 | }; 9 | ConstantBuffer rc : register(b0); 10 | 11 | struct PSInput 12 | { 13 | float4 position : SV_POSITION; 14 | float4 color : COLOR; 15 | }; 16 | 17 | PSInput main(float3 pos : POSITION, float4 color : COLOR) 18 | { 19 | PSInput input; 20 | input.position = mul(float4(pos, 1.0f), rc.matViewProjection); 21 | input.color = color; 22 | return input; 23 | } -------------------------------------------------------------------------------- /04/DX12Tutorial04/Src/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/04/DX12Tutorial04/Src/Main.cpp -------------------------------------------------------------------------------- /04/DX12講義04.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/04/DX12講義04.doc -------------------------------------------------------------------------------- /04/polygon.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/04/polygon.xcf -------------------------------------------------------------------------------- /04/polygon_using_index_buffer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/04/polygon_using_index_buffer.png -------------------------------------------------------------------------------- /04/polygon_using_vertex_buffer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/04/polygon_using_vertex_buffer.png -------------------------------------------------------------------------------- /05/DX12Tutorial05/DX12Tutorial05.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DX12Tutorial05", "DX12Tutorial05.vcxproj", "{C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.ActiveCfg = Debug|x64 17 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.Build.0 = Debug|x64 18 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.ActiveCfg = Debug|Win32 19 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.Build.0 = Debug|Win32 20 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.ActiveCfg = Release|x64 21 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.Build.0 = Release|x64 22 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.ActiveCfg = Release|Win32 23 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /05/DX12Tutorial05/DX12Tutorial05.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | ソース ファイル 20 | 21 | 22 | ソース ファイル 23 | 24 | 25 | 26 | 27 | ヘッダー ファイル 28 | 29 | 30 | ヘッダー ファイル 31 | 32 | 33 | 34 | 35 | リソース ファイル 36 | 37 | 38 | リソース ファイル 39 | 40 | 41 | 42 | 43 | リソース ファイル 44 | 45 | 46 | -------------------------------------------------------------------------------- /05/DX12Tutorial05/Res/PixelShader.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | struct PSInput 5 | { 6 | float4 position : SV_POSITION; 7 | float4 color : COLOR; 8 | float2 texcoord : TEXCOORD; 9 | }; 10 | 11 | float4 main(PSInput input) : SV_TARGET 12 | { 13 | return t0.Sample(s0, input.texcoord) * input.color; 14 | } -------------------------------------------------------------------------------- /05/DX12Tutorial05/Res/UnknownPlanet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/05/DX12Tutorial05/Res/UnknownPlanet.png -------------------------------------------------------------------------------- /05/DX12Tutorial05/Res/VertexShader.hlsl: -------------------------------------------------------------------------------- 1 | /** 2 | * VertexShader.hlsl 3 | */ 4 | 5 | cbuffer RootConstants 6 | { 7 | float4x4 matViewProjection; 8 | }; 9 | 10 | struct PSInput 11 | { 12 | float4 position : SV_POSITION; 13 | float4 color : COLOR; 14 | float2 texcoord : TEXCOORD; 15 | }; 16 | 17 | PSInput main(float3 pos : POSITION, float4 color : COLOR, float2 texcoord : TEXCOORD) 18 | { 19 | PSInput input; 20 | input.position = mul(float4(pos, 1.0f), matViewProjection); 21 | input.color = color; 22 | input.texcoord = texcoord; 23 | return input; 24 | } -------------------------------------------------------------------------------- /05/DX12Tutorial05/Src/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/05/DX12Tutorial05/Src/Main.cpp -------------------------------------------------------------------------------- /05/DX12Tutorial05/Src/Texture.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/05/DX12Tutorial05/Src/Texture.cpp -------------------------------------------------------------------------------- /05/DX12Tutorial05/Src/Texture.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/05/DX12Tutorial05/Src/Texture.h -------------------------------------------------------------------------------- /05/DX12講義05.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/05/DX12講義05.doc -------------------------------------------------------------------------------- /05/Material/UnknownPlanet.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/05/Material/UnknownPlanet.blend -------------------------------------------------------------------------------- /06/DX12Tutorial06/DX12Tutorial06.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DX12Tutorial06", "DX12Tutorial06.vcxproj", "{C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.ActiveCfg = Debug|x64 17 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.Build.0 = Debug|x64 18 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.ActiveCfg = Debug|Win32 19 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.Build.0 = Debug|Win32 20 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.ActiveCfg = Release|x64 21 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.Build.0 = Release|x64 22 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.ActiveCfg = Release|Win32 23 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /06/DX12Tutorial06/DX12Tutorial06.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | ソース ファイル 20 | 21 | 22 | ソース ファイル 23 | 24 | 25 | 26 | 27 | ヘッダー ファイル 28 | 29 | 30 | ヘッダー ファイル 31 | 32 | 33 | 34 | 35 | リソース ファイル 36 | 37 | 38 | リソース ファイル 39 | 40 | 41 | リソース ファイル 42 | 43 | 44 | 45 | 46 | リソース ファイル 47 | 48 | 49 | -------------------------------------------------------------------------------- /06/DX12Tutorial06/Res/NoiseTexture.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | struct PSInput 5 | { 6 | float4 position : SV_POSITION; 7 | float4 color : COLOR; 8 | float2 texcoord : TEXCOORD; 9 | }; 10 | 11 | float NoiseSeed(float2 st) 12 | { 13 | return frac(sin(st.x * 12.9898f + st.y * 78.233f) * 43758.5453123f); 14 | } 15 | 16 | float Noise(float2 st) 17 | { 18 | float2 i = floor(st); 19 | float2 f = frac(st); 20 | float2 u = f * f * (3.0f - 2.0f * f); 21 | const float a = NoiseSeed(i + float2(0, 0)); 22 | const float b = NoiseSeed(i + float2(1, 0)); 23 | const float c = NoiseSeed(i + float2(0, 1)); 24 | const float d = NoiseSeed(i + float2(1, 1)); 25 | return (a * (1.0f - u.x) + b * u.x) + (c - a) * u.y * (1.0f - u.x) + (d - b) * u.y * u.x; 26 | } 27 | 28 | float4 main(PSInput input) : SV_TARGET 29 | { 30 | float value = 0.0f; 31 | float scale = 0.5f; 32 | float freq = 4.0f; 33 | for (float i = 0; i <= 4; ++i) { 34 | value += Noise(input.texcoord * freq) * scale; 35 | scale *= 0.5f; 36 | freq *= 2.0f; 37 | } 38 | return t0.Sample(s0, float2(value, input.texcoord.y * 4.0f)) * input.color; 39 | } -------------------------------------------------------------------------------- /06/DX12Tutorial06/Res/PixelShader.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | struct PSInput 5 | { 6 | float4 position : SV_POSITION; 7 | float4 color : COLOR; 8 | float2 texcoord : TEXCOORD; 9 | }; 10 | 11 | float4 main(PSInput input) : SV_TARGET 12 | { 13 | return t0.Sample(s0, input.texcoord) * input.color; 14 | } -------------------------------------------------------------------------------- /06/DX12Tutorial06/Res/UnknownPlanet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/06/DX12Tutorial06/Res/UnknownPlanet.png -------------------------------------------------------------------------------- /06/DX12Tutorial06/Res/VertexShader.hlsl: -------------------------------------------------------------------------------- 1 | /** 2 | * VertexShader.hlsl 3 | */ 4 | 5 | struct PSInput 6 | { 7 | float4 position : SV_POSITION; 8 | float4 color : COLOR; 9 | float2 texcoord : TEXCOORD; 10 | }; 11 | 12 | cbuffer RootConstants : register(b0) 13 | { 14 | float4x4 matViewProjection; 15 | }; 16 | 17 | PSInput main(float3 pos : POSITION, float4 color : COLOR, float2 texcoord : TEXCOORD) 18 | { 19 | PSInput input; 20 | input.position = mul(float4(pos, 1.0f), matViewProjection); 21 | input.color = color; 22 | input.texcoord = texcoord; 23 | return input; 24 | } -------------------------------------------------------------------------------- /06/DX12Tutorial06/Res/terrain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/06/DX12Tutorial06/Res/terrain.png -------------------------------------------------------------------------------- /06/DX12Tutorial06/Src/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/06/DX12Tutorial06/Src/Main.cpp -------------------------------------------------------------------------------- /06/DX12Tutorial06/Src/Texture.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/06/DX12Tutorial06/Src/Texture.cpp -------------------------------------------------------------------------------- /06/DX12Tutorial06/Src/Texture.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/06/DX12Tutorial06/Src/Texture.h -------------------------------------------------------------------------------- /06/DX12講義06.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/06/DX12講義06.doc -------------------------------------------------------------------------------- /07/DX12Tutorial07/DX12Tutorial07.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DX12Tutorial07", "DX12Tutorial07.vcxproj", "{C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.ActiveCfg = Debug|x64 17 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.Build.0 = Debug|x64 18 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.ActiveCfg = Debug|Win32 19 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.Build.0 = Debug|Win32 20 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.ActiveCfg = Release|x64 21 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.Build.0 = Release|x64 22 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.ActiveCfg = Release|Win32 23 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /07/DX12Tutorial07/DX12Tutorial07.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | ソース ファイル 20 | 21 | 22 | ソース ファイル 23 | 24 | 25 | ソース ファイル 26 | 27 | 28 | ソース ファイル 29 | 30 | 31 | 32 | 33 | ヘッダー ファイル 34 | 35 | 36 | ヘッダー ファイル 37 | 38 | 39 | ヘッダー ファイル 40 | 41 | 42 | ヘッダー ファイル 43 | 44 | 45 | 46 | 47 | リソース ファイル 48 | 49 | 50 | リソース ファイル 51 | 52 | 53 | リソース ファイル 54 | 55 | 56 | 57 | 58 | リソース ファイル 59 | 60 | 61 | -------------------------------------------------------------------------------- /07/DX12Tutorial07/Res/NoiseTexture.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | struct PSInput 5 | { 6 | float4 position : SV_POSITION; 7 | float4 color : COLOR; 8 | float2 texcoord : TEXCOORD; 9 | }; 10 | 11 | float NoiseSeed(float2 st) 12 | { 13 | return frac(sin(st.x * 12.9898f + st.y * 78.233f) * 43758.5453123f); 14 | } 15 | 16 | float Noise(float2 st) 17 | { 18 | float2 i = floor(st); 19 | float2 f = frac(st); 20 | float2 u = f * f * (3.0f - 2.0f * f); 21 | const float a = NoiseSeed(i + float2(0, 0)); 22 | const float b = NoiseSeed(i + float2(1, 0)); 23 | const float c = NoiseSeed(i + float2(0, 1)); 24 | const float d = NoiseSeed(i + float2(1, 1)); 25 | return (a * (1.0f - u.x) + b * u.x) + (c - a) * u.y * (1.0f - u.x) + (d - b) * u.y * u.x; 26 | } 27 | 28 | float4 main(PSInput input) : SV_TARGET 29 | { 30 | float value = 0.0f; 31 | float scale = 0.5f; 32 | float freq = 4.0f; 33 | for (float i = 0; i <= 4; ++i) { 34 | value += Noise(input.texcoord * freq) * scale;; 35 | scale *= 0.5f; 36 | freq *= 2.0f; 37 | } 38 | return value + t0.Sample(s0, input.texcoord) * input.color; 39 | } -------------------------------------------------------------------------------- /07/DX12Tutorial07/Res/PixelShader.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | struct PSInput 5 | { 6 | float4 position : SV_POSITION; 7 | float4 color : COLOR; 8 | float2 texcoord : TEXCOORD; 9 | }; 10 | 11 | float4 main(PSInput input) : SV_TARGET 12 | { 13 | return t0.Sample(s0, input.texcoord) * input.color; 14 | } -------------------------------------------------------------------------------- /07/DX12Tutorial07/Res/UnknownPlanet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/07/DX12Tutorial07/Res/UnknownPlanet.png -------------------------------------------------------------------------------- /07/DX12Tutorial07/Res/VertexShader.hlsl: -------------------------------------------------------------------------------- 1 | /** 2 | * VertexShader.hlsl 3 | */ 4 | 5 | struct PSInput 6 | { 7 | float4 position : SV_POSITION; 8 | float4 color : COLOR; 9 | float2 texcoord : TEXCOORD; 10 | }; 11 | 12 | cbuffer RootConstants : register(b0) 13 | { 14 | float4x4 matViewProjection; 15 | }; 16 | 17 | PSInput main(float3 pos : POSITION, float4 color : COLOR, float2 texcoord : TEXCOORD) 18 | { 19 | PSInput input; 20 | input.position = mul(float4(pos, 1.0f), matViewProjection); 21 | input.color = color; 22 | input.texcoord = texcoord; 23 | return input; 24 | } -------------------------------------------------------------------------------- /07/DX12Tutorial07/Src/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/07/DX12Tutorial07/Src/Main.cpp -------------------------------------------------------------------------------- /07/DX12Tutorial07/Src/PSO.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/07/DX12Tutorial07/Src/PSO.cpp -------------------------------------------------------------------------------- /07/DX12Tutorial07/Src/PSO.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/07/DX12Tutorial07/Src/PSO.h -------------------------------------------------------------------------------- /07/DX12Tutorial07/Src/Sprite.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/07/DX12Tutorial07/Src/Sprite.cpp -------------------------------------------------------------------------------- /07/DX12Tutorial07/Src/Sprite.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/07/DX12Tutorial07/Src/Sprite.h -------------------------------------------------------------------------------- /07/DX12Tutorial07/Src/Texture.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/07/DX12Tutorial07/Src/Texture.cpp -------------------------------------------------------------------------------- /07/DX12Tutorial07/Src/Texture.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/07/DX12Tutorial07/Src/Texture.h -------------------------------------------------------------------------------- /07/DX12講義07.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/07/DX12講義07.doc -------------------------------------------------------------------------------- /07/erratta: -------------------------------------------------------------------------------- 1 | 3.3 TYPO コマンドリストしたら -> コマンドリストを作成したら 2 | 4.2 ヘッダファイルの追加について説明不足 3 | 5.2 拡大率を反映してしまっている 4 | 5.3 頂点バッファのサイズを*4する(2箇所) 5 | 8.1 WM_KEYUPのVK_SPACE処理 6 | gamepad.buttons |= GamePad::A; -> gamepad.buttons &= ~GamePad::A; 7 | -------------------------------------------------------------------------------- /08/DX12Tutorial08/DX12Tutorial08.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DX12Tutorial08", "DX12Tutorial08.vcxproj", "{C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.ActiveCfg = Debug|x64 17 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.Build.0 = Debug|x64 18 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.ActiveCfg = Debug|Win32 19 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.Build.0 = Debug|Win32 20 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.ActiveCfg = Release|x64 21 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.Build.0 = Release|x64 22 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.ActiveCfg = Release|Win32 23 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /08/DX12Tutorial08/DX12Tutorial08.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | ソース ファイル 20 | 21 | 22 | ソース ファイル 23 | 24 | 25 | ソース ファイル 26 | 27 | 28 | ソース ファイル 29 | 30 | 31 | ソース ファイル 32 | 33 | 34 | ソース ファイル 35 | 36 | 37 | ソース ファイル 38 | 39 | 40 | ソース ファイル 41 | 42 | 43 | 44 | 45 | ヘッダー ファイル 46 | 47 | 48 | ヘッダー ファイル 49 | 50 | 51 | ヘッダー ファイル 52 | 53 | 54 | ヘッダー ファイル 55 | 56 | 57 | ヘッダー ファイル 58 | 59 | 60 | ヘッダー ファイル 61 | 62 | 63 | ヘッダー ファイル 64 | 65 | 66 | ヘッダー ファイル 67 | 68 | 69 | 70 | 71 | リソース ファイル 72 | 73 | 74 | リソース ファイル 75 | 76 | 77 | リソース ファイル 78 | 79 | 80 | 81 | 82 | リソース ファイル 83 | 84 | 85 | リソース ファイル 86 | 87 | 88 | -------------------------------------------------------------------------------- /08/DX12Tutorial08/Res/NoiseTexture.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | struct PSInput 5 | { 6 | float4 position : SV_POSITION; 7 | float4 color : COLOR; 8 | float2 texcoord : TEXCOORD; 9 | }; 10 | 11 | cbuffer Constant : register(b0) 12 | { 13 | float scrollOffset; 14 | } 15 | 16 | float NoiseSeed(float2 st) 17 | { 18 | return frac(sin(st.x * 12.9898f + st.y * 78.233f) * 43758.5453123f); 19 | } 20 | 21 | float Noise(float2 st) 22 | { 23 | float2 i = floor(st); 24 | float2 f = frac(st); 25 | float2 u = f * f * (3.0f - 2.0f * f); 26 | const float a = NoiseSeed(i + float2(0, 0)); 27 | const float b = NoiseSeed(i + float2(1, 0)); 28 | const float c = NoiseSeed(i + float2(0, 1)); 29 | const float d = NoiseSeed(i + float2(1, 1)); 30 | return (a * (1.0f - u.x) + b * u.x) + (c - a) * u.y * (1.0f - u.x) + (d - b) * u.y * u.x; 31 | } 32 | 33 | float4 main(PSInput input) : SV_TARGET 34 | { 35 | 36 | const float4 colorList[] = { 37 | float4(0.1f, 0.2f, 0.5f, 1.0f), 38 | float4(0.7f, 0.9f, 1.0f, 1.0f), 39 | float4(0.7f, 0.5f, 0.1f, 1.0f), 40 | float4(0.3f, 0.65f, 0.1f, 1.0f), 41 | float4(0.95f, 1.0f, 1.0f, 1.0f) 42 | }; 43 | 44 | const float offsetList[] = { 0.0f, 0.4f, 0.43f, 0.65f, 1.0f }; 45 | 46 | float value = 0.0f; 47 | float scale = 0.5f; 48 | float freq = 3.0f; 49 | float2 pos = input.texcoord + float2(0, scrollOffset); 50 | for (int i = 0; i <= 4; ++i) { 51 | value += Noise(pos * freq) * scale;; 52 | scale *= 0.5f; 53 | freq *= 2.0f; 54 | } 55 | 56 | float4 color = colorList[4]; 57 | for (i = 1; i < 5; ++i) { 58 | if (value <= offsetList[i]) { 59 | float range = offsetList[i] - offsetList[i - 1]; 60 | color = lerp(colorList[i - 1], colorList[i], (value - offsetList[i - 1]) / range); 61 | break; 62 | } 63 | } 64 | return color; 65 | //return value + t0.Sample(s0, input.texcoord) * input.color; 66 | } -------------------------------------------------------------------------------- /08/DX12Tutorial08/Res/Objects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Res/Objects.png -------------------------------------------------------------------------------- /08/DX12Tutorial08/Res/PixelShader.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | struct PSInput 5 | { 6 | float4 position : SV_POSITION; 7 | float4 color : COLOR; 8 | float2 texcoord : TEXCOORD; 9 | }; 10 | 11 | float4 main(PSInput input) : SV_TARGET 12 | { 13 | return t0.Sample(s0, input.texcoord) * input.color; 14 | } -------------------------------------------------------------------------------- /08/DX12Tutorial08/Res/UnknownPlanet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Res/UnknownPlanet.png -------------------------------------------------------------------------------- /08/DX12Tutorial08/Res/VertexShader.hlsl: -------------------------------------------------------------------------------- 1 | /** 2 | * VertexShader.hlsl 3 | */ 4 | 5 | struct PSInput 6 | { 7 | float4 position : SV_POSITION; 8 | float4 color : COLOR; 9 | float2 texcoord : TEXCOORD; 10 | }; 11 | 12 | cbuffer RootConstants : register(b0) 13 | { 14 | float4x4 matViewProjection; 15 | }; 16 | 17 | PSInput main(float3 pos : POSITION, float4 color : COLOR, float2 texcoord : TEXCOORD) 18 | { 19 | PSInput input; 20 | input.position = mul(float4(pos, 1.0f), matViewProjection); 21 | input.color = color; 22 | input.texcoord = texcoord; 23 | return input; 24 | } -------------------------------------------------------------------------------- /08/DX12Tutorial08/Res/animation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name" : "enemy", 4 | "list" : [ 5 | [ 6 | { "cell" : 0, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 7 | { "cell" : 1, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 8 | { "cell" : 2, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 9 | { "cell" : 3, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 10 | ], 11 | [ 12 | { "cell" : 4, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 13 | { "cell" : 5, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 14 | { "cell" : 6, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 15 | ], 16 | [ 17 | { "cell" : 7, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 18 | { "cell" : 8, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 19 | { "cell" : 9, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 20 | ], 21 | [ 22 | { "cell" : 10, "time" : 0.125, "rotation" : 0, "scale" : [ 1.0, 1.0 ], "color" : [ 1, 1, 1, 1 ] }, 23 | { "cell" : 10, "time" : 0.125, "rotation" : 0, "scale" : [ 0.9, 0.9 ], "color" : [ 1, 1, 1, 1 ] }, 24 | { "cell" : 10, "time" : 0.125, "rotation" : 0, "scale" : [ 1.0, 1.0 ], "color" : [ 1, 1, 1, 1 ] }, 25 | { "cell" : 10, "time" : 0.125, "rotation" : 0, "scale" : [ 1.1, 1.1 ], "color" : [ 1, 1, 1, 1 ] } 26 | ], 27 | [ 28 | { "cell" : 11, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 29 | { "cell" : 11, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 30 | { "cell" : 12, "time" : 0.10, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 31 | { "cell" : 13, "time" : 0.10, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 32 | { "cell" : 14, "time" : 0.10, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 33 | { "cell" : 14, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 0.75, 0.75, 0.75, 0.5 ] }, 34 | { "cell" : 15, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 35 | ] 36 | ] 37 | }, 38 | { 39 | "name" : "player", 40 | "list" : [ 41 | [ 42 | { "cell" : 16, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 43 | { "cell" : 17, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 44 | { "cell" : 18, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 45 | ] 46 | ] 47 | } 48 | ] 49 | -------------------------------------------------------------------------------- /08/DX12Tutorial08/Src/Action.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Src/Action.cpp -------------------------------------------------------------------------------- /08/DX12Tutorial08/Src/Action.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Action.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_ACTION_H_ 5 | #define DX12TUTORIAL_SRC_ACTION_H_ 6 | #include 7 | #include 8 | #include 9 | 10 | namespace Sprite { 11 | struct Sprite; 12 | } // namespace Sprite 13 | 14 | namespace Action { 15 | 16 | struct List; 17 | enum class Type; 18 | enum InterporationType; 19 | 20 | struct Point { 21 | DirectX::XMFLOAT2 pos; 22 | float t; 23 | bool operator<(const Point& p) const { return t < p.t; } 24 | }; 25 | 26 | class ActionController 27 | { 28 | public: 29 | ActionController() = delete; 30 | ActionController(const List& l, uint32_t no = 0); 31 | void Update(float delta, Sprite::Sprite*); 32 | void SetSeqIndex(uint32_t no); 33 | void SetManualMove(float degree, float speed); 34 | void SetManualAccel(float degree, float accel); 35 | void SetTime(float time); 36 | float GetCurrentTime() const { return currentTime; } 37 | float GetTotalTime() const { return totalTime; } 38 | 39 | private: 40 | void Init(); 41 | void UpdateSub(float delta, Sprite::Sprite*); 42 | 43 | private: 44 | const List& list; 45 | uint32_t seqIndex; 46 | uint32_t dataIndex; 47 | Type type; 48 | 49 | float totalTime; 50 | float currentTime; 51 | 52 | DirectX::XMFLOAT2 move; 53 | DirectX::XMFLOAT2 accel; 54 | struct PathParam { 55 | std::vector cp; 56 | InterporationType type; 57 | } path; 58 | }; 59 | 60 | const List& GetList(); 61 | 62 | } // namespace Action 63 | 64 | #endif // DX12TUTORIAL_SRC_ACTION_H_ -------------------------------------------------------------------------------- /08/DX12Tutorial08/Src/Animation.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Src/Animation.cpp -------------------------------------------------------------------------------- /08/DX12Tutorial08/Src/Animation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Src/Animation.h -------------------------------------------------------------------------------- /08/DX12Tutorial08/Src/Json.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Src/Json.cpp -------------------------------------------------------------------------------- /08/DX12Tutorial08/Src/Json.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Src/Json.h -------------------------------------------------------------------------------- /08/DX12Tutorial08/Src/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Src/Main.cpp -------------------------------------------------------------------------------- /08/DX12Tutorial08/Src/PSO.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Src/PSO.cpp -------------------------------------------------------------------------------- /08/DX12Tutorial08/Src/PSO.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Src/PSO.h -------------------------------------------------------------------------------- /08/DX12Tutorial08/Src/Sprite.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Src/Sprite.cpp -------------------------------------------------------------------------------- /08/DX12Tutorial08/Src/Sprite.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Src/Sprite.h -------------------------------------------------------------------------------- /08/DX12Tutorial08/Src/Texture.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Src/Texture.cpp -------------------------------------------------------------------------------- /08/DX12Tutorial08/Src/Texture.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Src/Texture.h -------------------------------------------------------------------------------- /08/DX12Tutorial08/Src/Timer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Src/Timer.cpp -------------------------------------------------------------------------------- /08/DX12Tutorial08/Src/Timer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12Tutorial08/Src/Timer.h -------------------------------------------------------------------------------- /08/DX12講義08.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/08/DX12講義08.doc -------------------------------------------------------------------------------- /08/errata: -------------------------------------------------------------------------------- 1 | 3.3を4章の後に移動する 2 | 3.3 スプライトに追加したコンストラクタを追加した -> スプライトにコンストラクタを追加した 3 | SpriteRenderer::Draw関数の修正についての項目を追加. 4 | 6.1 if(time == 0.0f || time < targetTime) -> if(targetTime == 0.0f || time < targetTime) 5 | SrdBlend -> SrcBlend 6 | 2.2 #include を追加 7 | -------------------------------------------------------------------------------- /09/DX12Tutorial09/DX12Tutorial09.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DX12Tutorial09", "DX12Tutorial09.vcxproj", "{C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.ActiveCfg = Debug|x64 17 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.Build.0 = Debug|x64 18 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.ActiveCfg = Debug|Win32 19 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.Build.0 = Debug|Win32 20 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.ActiveCfg = Release|x64 21 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.Build.0 = Release|x64 22 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.ActiveCfg = Release|Win32 23 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /09/DX12Tutorial09/Res/Act/ActEnemy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name" : "WinpFighter", 4 | "list" : [ 5 | [ 6 | { "type" : "Move", "args" : [ 270, 200 ] }, 7 | { "type" : "Accel", "args" : [ 180, 800 ] }, 8 | { "type" : "Wait", "args" : [ 0.5 ] }, 9 | { "type" : "Accel", "args" : [ 0, 800 ] }, 10 | { "type" : "Wait", "args" : [ 1.0 ] }, 11 | { "type" : "Accel", "args" : [ 180, 800 ] }, 12 | { "type" : "Wait", "args" : [ 1.0 ] }, 13 | { "type" : "Accel", "args" : [ 0, 800 ] }, 14 | { "type" : "Wait", "args" : [ 2.0 ] }, 15 | { "type" : "Delete", "args" : [] } 16 | ], 17 | [ 18 | { "type" : "Move", "args" : [ 270, 400 ] }, 19 | { "type" : "Wait", "args" : [ 5.0 ] }, 20 | { "type" : "Delete", "args" : [] } 21 | ], 22 | [ 23 | { "type" : "Move", "args" : [ 240, 400 ] }, 24 | { "type" : "Accel", "args" : [ 60, 200 ] }, 25 | { "type" : "Wait", "args" : [ 1.0 ] }, 26 | { "type" : "Move", "args" : [ 0, 0 ] }, 27 | { "type" : "Accel", "args" : [ 90, 400 ] }, 28 | { "type" : "Wait", "args" : [ 3.0 ] }, 29 | { "type" : "Delete", "args" : [] } 30 | ], 31 | [ 32 | { "type" : "Move", "args" : [ 300, 400 ] }, 33 | { "type" : "Accel", "args" : [ 120, 200 ] }, 34 | { "type" : "Wait", "args" : [ 1.0 ] }, 35 | { "type" : "Move", "args" : [ 0, 0 ] }, 36 | { "type" : "Accel", "args" : [ 90, 400 ] }, 37 | { "type" : "Wait", "args" : [ 3.0 ] }, 38 | { "type" : "Delete", "args" : [] } 39 | ], 40 | [ 41 | { "type" : "Accel", "args" : [ 0, 0 ] }, 42 | { "type" : "Wait", "args" : [ 0.5 ] }, 43 | { "type" : "Delete", "args" : [] } 44 | ] 45 | ] 46 | }, 47 | { 48 | "name" : "MiddleClassFighter", 49 | "list" : [ 50 | [ 51 | { "type" : "Move", "args" : [ 0, 200 ] }, 52 | { "type" : "Accel", "args" : [ 0, -200 ] }, 53 | { "type" : "Wait", "args" : [ 1.0 ] }, 54 | { "type" : "Move", "args" : [ 200, 0 ] }, 55 | { "type" : "Wait", "args" : [ 1.0 ] }, 56 | { "type" : "Move", "args" : [ -200, 0 ] }, 57 | { "type" : "Wait", "args" : [ 1.0 ] }, 58 | { "type" : "Move", "args" : [ 200, 0 ] }, 59 | { "type" : "Wait", "args" : [ 1.0 ] }, 60 | { "type" : "Move", "args" : [ -200, 0 ] }, 61 | { "type" : "Wait", "args" : [ 1.0 ] }, 62 | { "type" : "Accel", "args" : [ 0, -400 ] }, 63 | { "type" : "Wait", "args" : [ 3.0 ] }, 64 | { "type" : "Delete", "args" : [] } 65 | ], 66 | [ 67 | { "type" : "Move", "args" : [ 0, 200 ] }, 68 | { "type" : "Accel", "args" : [ 0, -200 ] }, 69 | { "type" : "Wait", "args" : [ 1.0 ] }, 70 | { "type" : "Move", "args" : [ -200, 0 ] }, 71 | { "type" : "Wait", "args" : [ 1.0 ] }, 72 | { "type" : "Move", "args" : [ 200, 0 ] }, 73 | { "type" : "Wait", "args" : [ 1.0 ] }, 74 | { "type" : "Move", "args" : [ -200, 0 ] }, 75 | { "type" : "Wait", "args" : [ 1.0 ] }, 76 | { "type" : "Move", "args" : [ 200, 0 ] }, 77 | { "type" : "Wait", "args" : [ 1.0 ] }, 78 | { "type" : "Move", "args" : [ 0, 0 ] }, 79 | { "type" : "Accel", "args" : [ 0, -400 ] }, 80 | { "type" : "Wait", "args" : [ 3.0 ] }, 81 | { "type" : "Delete", "args" : [] } 82 | ], 83 | [ 84 | { "type" : "Accel", "args" : [ 0, 0 ] }, 85 | { "type" : "Wait", "args" : [ 0.5 ] }, 86 | { "type" : "Delete", "args" : [] } 87 | ] 88 | ] 89 | } 90 | ] 91 | -------------------------------------------------------------------------------- /09/DX12Tutorial09/Res/Anm/Animation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name" : "enemy", 4 | "list" : [ 5 | [ 6 | { "cell" : 0, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 7 | { "cell" : 1, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 8 | { "cell" : 2, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 9 | { "cell" : 3, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 10 | ], 11 | [ 12 | { "cell" : 4, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 13 | { "cell" : 5, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 14 | { "cell" : 6, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 15 | ], 16 | [ 17 | { "cell" : 7, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 18 | { "cell" : 8, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 19 | { "cell" : 9, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 20 | ], 21 | [ 22 | { "cell" : 10, "time" : 0.125, "rotation" : 0, "scale" : [ 1.0, 1.0 ], "color" : [ 1, 1, 1, 1 ] }, 23 | { "cell" : 10, "time" : 0.125, "rotation" : 0, "scale" : [ 0.9, 0.9 ], "color" : [ 1, 1, 1, 1 ] }, 24 | { "cell" : 10, "time" : 0.125, "rotation" : 0, "scale" : [ 1.0, 1.0 ], "color" : [ 1, 1, 1, 1 ] }, 25 | { "cell" : 10, "time" : 0.125, "rotation" : 0, "scale" : [ 1.1, 1.1 ], "color" : [ 1, 1, 1, 1 ] } 26 | ], 27 | [ 28 | { "cell" : 11, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 29 | { "cell" : 11, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 30 | { "cell" : 12, "time" : 0.10, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 31 | { "cell" : 13, "time" : 0.10, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 32 | { "cell" : 14, "time" : 0.10, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 33 | { "cell" : 14, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 0.75, 0.75, 0.75, 0.5 ] }, 34 | { "cell" : 15, "time" : -1, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 35 | ] 36 | ] 37 | }, 38 | { 39 | "name" : "player", 40 | "list" : [ 41 | [ 42 | { "cell" : 0, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 43 | { "cell" : 1, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 44 | { "cell" : 2, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 45 | ], 46 | [ 47 | { "cell" : 3, "time" : 0.125, "rotation" : 0, "scale" : [ 1.0, 1 ], "color" : [ 1, 1, 1, 1 ] }, 48 | { "cell" : 3, "time" : 0.125, "rotation" : 0, "scale" : [ 0.9, 1 ], "color" : [ 1, 1, 1, 1 ] }, 49 | { "cell" : 3, "time" : 0.125, "rotation" : 0, "scale" : [ 0.8, 1 ], "color" : [ 1, 1, 1, 1 ] }, 50 | { "cell" : 3, "time" : 0.125, "rotation" : 0, "scale" : [ 0.9, 1 ], "color" : [ 1, 1, 1, 1 ] } 51 | ], 52 | [ 53 | { "cell" : 4, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 54 | { "cell" : 4, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 55 | { "cell" : 5, "time" : 0.10, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 56 | { "cell" : 6, "time" : 0.10, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 57 | { "cell" : 7, "time" : 0.10, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 58 | { "cell" : 7, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 0.75, 0.75, 0.75, 0.5 ] }, 59 | { "cell" : 8, "time" : 2, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 60 | { "cell" : 8, "time" : -1, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 61 | ] 62 | ] 63 | } 64 | ] 65 | -------------------------------------------------------------------------------- /09/DX12Tutorial09/Res/Cell/CellEnemy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Enemy", 4 | "texsize": [ 32, 32 ], 5 | "list": [ 6 | { "uv": [ 2.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 7 | { "uv": [ 0.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 8 | { "uv": [ 4.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 9 | 10 | { "uv": [ 6.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 11 | { "uv": [ 0.0, 2.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 12 | { "uv": [ 1.0, 2.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 13 | { "uv": [ 2.0, 2.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 14 | 15 | { "uv": [ 4.0, 2.0 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 16 | { "uv": [ 5.0, 2.0 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 17 | { "uv": [ 3.0, 2.0 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 18 | 19 | { "uv": [ 0.0, 3.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 20 | 21 | { "uv": [ 0.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 22 | { "uv": [ 2.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 23 | { "uv": [ 4.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 24 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 25 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 0, 0 ] } 26 | ] 27 | } 28 | ] -------------------------------------------------------------------------------- /09/DX12Tutorial09/Res/Cell/CellFont.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Font", 4 | "texsize": [ 16, 16 ], 5 | "list": [ 6 | { "uv": [ 0.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 7 | { "uv": [ 1.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 8 | { "uv": [ 2.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 9 | { "uv": [ 3.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 10 | { "uv": [ 4.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 11 | { "uv": [ 5.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 12 | { "uv": [ 6.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 13 | { "uv": [ 7.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 14 | { "uv": [ 8.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 15 | { "uv": [ 9.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 16 | { "uv": [10.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 17 | { "uv": [11.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 18 | { "uv": [12.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 19 | { "uv": [13.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 20 | { "uv": [14.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 21 | { "uv": [15.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 22 | 23 | { "uv": [ 0.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 24 | { "uv": [ 1.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 25 | { "uv": [ 2.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 26 | { "uv": [ 3.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 27 | { "uv": [ 4.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 28 | { "uv": [ 5.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 29 | { "uv": [ 6.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 30 | { "uv": [ 7.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 31 | { "uv": [ 8.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 32 | { "uv": [ 9.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 33 | { "uv": [10.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 34 | { "uv": [11.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 35 | { "uv": [12.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 36 | { "uv": [13.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 37 | { "uv": [14.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 38 | { "uv": [15.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 39 | 40 | { "uv": [ 0.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 41 | { "uv": [ 1.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 42 | { "uv": [ 2.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 43 | { "uv": [ 3.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 44 | { "uv": [ 4.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 45 | { "uv": [ 5.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 46 | { "uv": [ 6.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 47 | { "uv": [ 7.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 48 | { "uv": [ 8.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 49 | { "uv": [ 9.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 50 | { "uv": [10.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 51 | { "uv": [11.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 52 | { "uv": [12.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 53 | { "uv": [13.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 54 | { "uv": [14.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 55 | { "uv": [15.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 56 | 57 | { "uv": [ 0.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 58 | { "uv": [ 1.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 59 | { "uv": [ 2.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 60 | { "uv": [ 3.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 61 | { "uv": [ 4.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 62 | { "uv": [ 5.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 63 | { "uv": [ 6.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 64 | { "uv": [ 7.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 65 | { "uv": [ 8.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 66 | { "uv": [ 9.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 67 | { "uv": [10.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 68 | { "uv": [11.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 69 | { "uv": [12.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 70 | { "uv": [13.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 71 | { "uv": [14.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 72 | { "uv": [15.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 73 | 74 | { "uv": [ 0.0, 8.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] } 75 | ] 76 | } 77 | ] -------------------------------------------------------------------------------- /09/DX12Tutorial09/Res/Cell/CellPlayer.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Player", 4 | "texsize": [ 32, 32 ], 5 | "list": [ 6 | { "uv": [ 0, 30 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 7 | { "uv": [ 2, 30 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 8 | { "uv": [ 4, 30 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 9 | 10 | { "uv": [ 0, 28 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 11 | 12 | { "uv": [ 0.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 13 | { "uv": [ 2.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 14 | { "uv": [ 4.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 15 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 16 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 0, 0 ] } 17 | ] 18 | } 19 | ] -------------------------------------------------------------------------------- /09/DX12Tutorial09/Res/NoiseTexture.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | struct PSInput 5 | { 6 | float4 position : SV_POSITION; 7 | float4 color : COLOR; 8 | float2 texcoord : TEXCOORD; 9 | }; 10 | 11 | cbuffer Constant : register(b0) 12 | { 13 | float scrollOffset; 14 | } 15 | 16 | float NoiseSeed(float2 st) 17 | { 18 | return frac(sin(st.x * 12.9898f + st.y * 78.233f) * 43758.5453123f); 19 | } 20 | 21 | float Noise(float2 st) 22 | { 23 | float2 i = floor(st); 24 | float2 f = frac(st); 25 | float2 u = f * f * (3.0f - 2.0f * f); 26 | const float a = NoiseSeed(i + float2(0, 0)); 27 | const float b = NoiseSeed(i + float2(1, 0)); 28 | const float c = NoiseSeed(i + float2(0, 1)); 29 | const float d = NoiseSeed(i + float2(1, 1)); 30 | return (a * (1.0f - u.x) + b * u.x) + (c - a) * u.y * (1.0f - u.x) + (d - b) * u.y * u.x; 31 | } 32 | 33 | float4 main(PSInput input) : SV_TARGET 34 | { 35 | 36 | const float4 colorList[] = { 37 | float4(0.1f, 0.2f, 0.5f, 1.0f), 38 | float4(0.7f, 0.9f, 1.0f, 1.0f), 39 | float4(0.7f, 0.5f, 0.1f, 1.0f), 40 | float4(0.3f, 0.65f, 0.1f, 1.0f), 41 | float4(0.95f, 1.0f, 1.0f, 1.0f) 42 | }; 43 | 44 | const float offsetList[] = { 0.0f, 0.4f, 0.43f, 0.65f, 1.0f }; 45 | 46 | float value = 0.0f; 47 | float scale = 0.5f; 48 | float freq = 3.0f; 49 | float2 pos = input.texcoord + float2(0, scrollOffset); 50 | for (int i = 0; i <= 4; ++i) { 51 | value += Noise(pos * freq) * scale;; 52 | scale *= 0.5f; 53 | freq *= 2.0f; 54 | } 55 | 56 | float4 color = colorList[4]; 57 | for (i = 1; i < 5; ++i) { 58 | if (value <= offsetList[i]) { 59 | float range = offsetList[i] - offsetList[i - 1]; 60 | color = lerp(colorList[i - 1], colorList[i], (value - offsetList[i - 1]) / range); 61 | break; 62 | } 63 | } 64 | return color; 65 | //return value + t0.Sample(s0, input.texcoord) * input.color; 66 | } -------------------------------------------------------------------------------- /09/DX12Tutorial09/Res/Objects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Res/Objects.png -------------------------------------------------------------------------------- /09/DX12Tutorial09/Res/PixelShader.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | struct PSInput 5 | { 6 | float4 position : SV_POSITION; 7 | float4 color : COLOR; 8 | float2 texcoord : TEXCOORD; 9 | }; 10 | 11 | float4 main(PSInput input) : SV_TARGET 12 | { 13 | return t0.Sample(s0, input.texcoord) * input.color; 14 | } -------------------------------------------------------------------------------- /09/DX12Tutorial09/Res/TextFont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Res/TextFont.png -------------------------------------------------------------------------------- /09/DX12Tutorial09/Res/Title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Res/Title.png -------------------------------------------------------------------------------- /09/DX12Tutorial09/Res/UnknownPlanet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Res/UnknownPlanet.png -------------------------------------------------------------------------------- /09/DX12Tutorial09/Res/VertexShader.hlsl: -------------------------------------------------------------------------------- 1 | /** 2 | * VertexShader.hlsl 3 | */ 4 | 5 | struct PSInput 6 | { 7 | float4 position : SV_POSITION; 8 | float4 color : COLOR; 9 | float2 texcoord : TEXCOORD; 10 | }; 11 | 12 | cbuffer RootConstants : register(b0) 13 | { 14 | float4x4 matViewProjection; 15 | }; 16 | 17 | PSInput main(float3 pos : POSITION, float4 color : COLOR, float2 texcoord : TEXCOORD) 18 | { 19 | PSInput input; 20 | input.position = mul(float4(pos, 1.0f), matViewProjection); 21 | input.color = color; 22 | input.texcoord = texcoord; 23 | return input; 24 | } -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Action.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Action.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Action.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Action.h -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Animation.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Animation.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Animation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Animation.h -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Collision.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Collision.cpp 3 | */ 4 | #include "Collision.h" 5 | #include 6 | 7 | using namespace DirectX; 8 | 9 | namespace Collision { 10 | 11 | namespace /* unnamed */ { 12 | 13 | bool CircleCircle(const Shape& sa, const XMFLOAT2& pa, const Shape& sb, const XMFLOAT2& pb) 14 | { 15 | const float dx = pa.x - pb.x; 16 | const float dy = pa.y - pb.y; 17 | const float ra = sa.circle.radius; 18 | const float rb = sb.circle.radius; 19 | return (dx * dx + dy + dy) < (ra * ra + rb * rb); 20 | } 21 | 22 | bool RectCircle(const Shape& sa, const XMFLOAT2& pa, const Shape& sb, const XMFLOAT2& pb) 23 | { 24 | const XMFLOAT2 aLT(pa.x + sa.rect.leftTop.x, pa.y + sa.rect.leftTop.y); 25 | const XMFLOAT2 aRB(pa.x + sa.rect.rightBottom.x, pa.y + sa.rect.rightBottom.y); 26 | XMFLOAT2 p; 27 | p.x = std::min(std::max(pb.x, aLT.x), aRB.x); 28 | p.y = std::min(std::max(pb.y, aLT.y), aRB.y); 29 | const float dx = p.x - pb.x; 30 | const float dy = p.y - pb.y; 31 | const float rb = sb.circle.radius; 32 | return (dx * dx + dy * dy) < (rb * rb); 33 | } 34 | bool CircleRect(const Shape& sa, const XMFLOAT2& pa, const Shape& sb, const XMFLOAT2& pb) { return RectCircle(sb, pb, sa, pa); } 35 | 36 | bool RectRect(const Shape& sa, const XMFLOAT2& pa, const Shape& sb, const XMFLOAT2& pb) 37 | { 38 | const XMFLOAT2 aLT(pa.x + sa.rect.leftTop.x, pa.y + sa.rect.leftTop.y); 39 | const XMFLOAT2 aRB(pa.x + sa.rect.rightBottom.x, pa.y + sa.rect.rightBottom.y); 40 | const XMFLOAT2 bLT(pb.x + sb.rect.leftTop.x, pb.y + sb.rect.leftTop.y); 41 | const XMFLOAT2 bRB(pb.x + sb.rect.rightBottom.x, pb.y + sb.rect.rightBottom.y); 42 | if (aRB.x < bLT.x || aLT.x > bRB.x) return false; 43 | if (aRB.y < bLT.y || aLT.y > bRB.y) return false; 44 | return true; 45 | } 46 | 47 | } // unnamed namespace 48 | 49 | bool IsCollision(const Shape& sa, const XMFLOAT2& pa, const Shape& sb, const XMFLOAT2& pb) 50 | { 51 | static bool(*const funcList[2][2])(const Shape&, const XMFLOAT2&, const Shape&, const XMFLOAT2&) = { 52 | { CircleCircle, CircleRect }, 53 | { RectCircle, RectRect }, 54 | }; 55 | return funcList[static_cast(sa.type)][static_cast(sb.type)](sa, pa, sb, pb); 56 | } 57 | 58 | } // namespace Collision 59 | -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Collision.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Collision.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_COLLISION_H_ 5 | #define DX12TUTORIAL_SRC_COLLISION_H_ 6 | #include 7 | #include 8 | #include 9 | 10 | namespace Collision { 11 | 12 | enum class ShapeType 13 | { 14 | Circle, 15 | Rectangle, 16 | }; 17 | 18 | struct Shape 19 | { 20 | Shape() : type(ShapeType::Circle), circle{ 0.1f } {} 21 | Shape(const Shape& src) : type(src.type) 22 | { 23 | switch (type) { 24 | case ShapeType::Circle: 25 | circle.radius = src.circle.radius; 26 | break; 27 | case ShapeType::Rectangle: 28 | rect.leftTop = src.rect.leftTop; 29 | rect.rightBottom = src.rect.rightBottom; 30 | break; 31 | } 32 | } 33 | ~Shape() {} 34 | 35 | Shape& operator=(const Shape& src) 36 | { 37 | this->~Shape(); 38 | new(this) Shape(src); 39 | return *this; 40 | } 41 | 42 | static Shape MakeCircle(float r) 43 | { 44 | Shape shape; 45 | shape.type = ShapeType::Circle; 46 | shape.circle.radius = r; 47 | return shape; 48 | } 49 | static Shape MakeRectangle(const DirectX::XMFLOAT2& lt, const DirectX::XMFLOAT2& rb) 50 | { 51 | Shape shape; 52 | shape.type = ShapeType::Rectangle; 53 | shape.rect.leftTop = lt; 54 | shape.rect.rightBottom = rb; 55 | return shape; 56 | } 57 | 58 | ShapeType type; 59 | int groupId; 60 | union { 61 | struct Circle 62 | { 63 | float radius; 64 | } circle; 65 | struct Rect 66 | { 67 | DirectX::XMFLOAT2 leftTop; 68 | DirectX::XMFLOAT2 rightBottom; 69 | } rect; 70 | }; 71 | }; 72 | 73 | bool IsCollision(const Shape&, const DirectX::XMFLOAT2&, const Shape&, const DirectX::XMFLOAT2&); 74 | 75 | } // namespace Collision 76 | 77 | #endif // DX12TUTORIAL_SRC_COLLISION_H_ -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/GamePad.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/GamePad.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/GamePad.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/GamePad.h -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Graphics.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Graphics.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Graphics.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Graphics.h -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Json.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Json.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Json.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Json.h -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Main.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/PSO.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/PSO.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/PSO.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/PSO.h -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Scene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Scene.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Scene.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Scene.h -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Scene/EndingScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Scene/EndingScene.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Scene/EndingScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file EndingScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_ENDINGSCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_ENDINGSCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | 11 | class EndingScene : public Scene::Scene 12 | { 13 | public: 14 | static ::Scene::ScenePtr Create(); 15 | 16 | virtual bool Load(); 17 | virtual bool Unload(); 18 | virtual int Update(double delta); 19 | virtual void Draw(Graphics::Graphics& graphics) const; 20 | 21 | private: 22 | EndingScene(); 23 | EndingScene(const EndingScene&) = delete; 24 | EndingScene& operator=(const EndingScene&) = delete; 25 | 26 | Resource::Texture texBackground; 27 | Resource::Texture texLogo; 28 | Resource::Texture texFont; 29 | std::vector sprBackground; 30 | std::vector sprLogo; 31 | std::vector sprFont; 32 | Sprite::FilePtr cellFile; 33 | AnimationFile animationFile; 34 | double time; 35 | }; 36 | 37 | #endif // DX12TUTORIAL_SRC_SCENE_ENDINGSCENE_H_ 38 | -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Scene/GameOverScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Scene/GameOverScene.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Scene/GameOverScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file GameOverScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_GAMEOVERSCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_GAMEOVERSCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | 11 | class GameOverScene : public Scene::Scene 12 | { 13 | public: 14 | static ::Scene::ScenePtr Create(); 15 | 16 | virtual bool Load(); 17 | virtual bool Unload(); 18 | virtual int Update(double delta); 19 | virtual void Draw(Graphics::Graphics& graphics) const; 20 | 21 | private: 22 | GameOverScene(); 23 | GameOverScene(const GameOverScene&) = delete; 24 | GameOverScene& operator=(const GameOverScene&) = delete; 25 | 26 | Resource::Texture texBackground; 27 | Resource::Texture texFont; 28 | std::vector sprBackground; 29 | std::vector sprFont; 30 | Sprite::FilePtr cellFile; 31 | AnimationFile animationFile; 32 | double time; 33 | }; 34 | 35 | #endif // DX12TUTORIAL_SRC_SCENE_GAMEOVERSCENE_H_ 36 | -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Scene/MainGameScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Scene/MainGameScene.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Scene/MainGameScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file MainGameScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_MAINGAMESCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_MAINGAMESCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | #include "../Action.h" 11 | 12 | class MainGameScene : public Scene::Scene 13 | { 14 | public: 15 | enum ExitCode 16 | { 17 | ExitCode_Ending = ExitCode_User, 18 | ExitCode_Pause, 19 | ExitCode_GameOver, 20 | }; 21 | 22 | static ::Scene::ScenePtr Create(); 23 | 24 | virtual bool Load() override; 25 | virtual bool Unload() override; 26 | virtual int Update(double delta) override; 27 | virtual void Draw(Graphics::Graphics& graphics) const override; 28 | 29 | struct Occurrence; 30 | struct FormationData; 31 | 32 | private: 33 | MainGameScene(); 34 | MainGameScene(const MainGameScene&) = delete; 35 | MainGameScene& operator=(const MainGameScene&) = delete; 36 | 37 | void UpdatePlayer(double); 38 | void GenerateEnemy(double); 39 | void UpdateEnemy(double); 40 | void UpdateScore(); 41 | void SolveCollision(); 42 | 43 | Resource::Texture texBackground; 44 | Resource::Texture texObjects; 45 | Resource::Texture texFont; 46 | std::vector sprBackground; 47 | std::vector sprPlayer; 48 | std::vector sprEnemy; 49 | std::vector sprFont; 50 | Sprite::FilePtr cellFile[2]; 51 | Sprite::FilePtr cellPlayer; 52 | AnimationFile anmObjects; 53 | AnimationFile anmOthers; 54 | Action::FilePtr actionFile; 55 | const Occurrence* pCurOccurrence; 56 | const Occurrence* pEndOccurrence; 57 | 58 | struct Formation { 59 | float time; 60 | DirectX::XMFLOAT3 pos; 61 | const FormationData* cur; 62 | const FormationData* end; 63 | }; 64 | std::vector formationList; 65 | std::vector freePlayerShotList; 66 | std::vector freeEnemyList; 67 | std::vector freeEnemyShotList; 68 | double time; 69 | uint32_t score; 70 | 71 | int playerShotCycle = 0; 72 | float playerShotInterval = 0; 73 | }; 74 | 75 | #endif // DX12TUTORIAL_SRC_SCENE_MAINGAMESCENE_H_ 76 | -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Scene/PauseScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Scene/PauseScene.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Scene/PauseScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file PauseScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_PAUSESCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_PAUSESCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | 11 | class PauseScene : public Scene::Scene 12 | { 13 | public: 14 | static ::Scene::ScenePtr Create(); 15 | 16 | virtual bool Load(); 17 | virtual bool Unload(); 18 | virtual int Update(double delta); 19 | virtual void Draw(Graphics::Graphics& graphics) const; 20 | 21 | private: 22 | PauseScene(); 23 | PauseScene(const PauseScene&) = delete; 24 | PauseScene& operator=(const PauseScene&) = delete; 25 | 26 | Resource::Texture texFont; 27 | std::vector sprFont; 28 | Sprite::FilePtr cellFile; 29 | AnimationFile animationFile; 30 | double time; 31 | }; 32 | 33 | #endif // DX12TUTORIAL_SRC_SCENE_PAUSESCENE_H_ 34 | -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Scene/TitleScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Scene/TitleScene.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Scene/TitleScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file TitleScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_TITLESCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_TITLESCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | 11 | class TitleScene : public Scene::Scene 12 | { 13 | public: 14 | enum ExitCode 15 | { 16 | ExitCode_MainGame, 17 | ExitCode_Option, 18 | }; 19 | 20 | static ::Scene::ScenePtr Create(); 21 | 22 | virtual bool Load() override; 23 | virtual bool Unload() override; 24 | virtual int Update(double delta) override; 25 | virtual void Draw(Graphics::Graphics& graphics) const override; 26 | 27 | private: 28 | TitleScene(); 29 | TitleScene(const TitleScene&) = delete; 30 | TitleScene& operator=(const TitleScene&) = delete; 31 | 32 | Resource::Texture texBackground; 33 | Resource::Texture texLogo; 34 | Resource::Texture texFont; 35 | std::vector sprBackground; 36 | std::vector sprLogo; 37 | std::vector sprFont; 38 | Sprite::FilePtr cellFile; 39 | AnimationFile animationFile; 40 | double time; 41 | }; 42 | 43 | #endif // DX12TUTORIAL_SRC_SCENE_TITLESCENE_H_ -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Sprite.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Sprite.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Sprite.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Sprite.h -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Texture.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Texture.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Texture.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Texture.h -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Timer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Timer.cpp -------------------------------------------------------------------------------- /09/DX12Tutorial09/Src/Timer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12Tutorial09/Src/Timer.h -------------------------------------------------------------------------------- /09/DX12講義09.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/09/DX12講義09.doc -------------------------------------------------------------------------------- /10/DX12Tutorial10/DX12Tutorial10.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DX12Tutorial10", "DX12Tutorial10.vcxproj", "{C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.ActiveCfg = Debug|x64 17 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.Build.0 = Debug|x64 18 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.ActiveCfg = Debug|Win32 19 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.Build.0 = Debug|Win32 20 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.ActiveCfg = Release|x64 21 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.Build.0 = Release|x64 22 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.ActiveCfg = Release|Win32 23 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/Act/ActEnemy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name" : "WinpFighter", 4 | "list" : [ 5 | [ 6 | { "type" : "Move", "args" : [ 270, 200 ] }, 7 | { "type" : "Accel", "args" : [ 180, 800 ] }, 8 | { "type" : "Wait", "args" : [ 0.5 ] }, 9 | { "type" : "Accel", "args" : [ 0, 800 ] }, 10 | { "type" : "Wait", "args" : [ 1.0 ] }, 11 | { "type" : "Accel", "args" : [ 180, 800 ] }, 12 | { "type" : "Wait", "args" : [ 1.0 ] }, 13 | { "type" : "Accel", "args" : [ 0, 800 ] }, 14 | { "type" : "Wait", "args" : [ 2.0 ] }, 15 | { "type" : "Delete", "args" : [] } 16 | ], 17 | [ 18 | { "type" : "Move", "args" : [ 270, 400 ] }, 19 | { "type" : "Wait", "args" : [ 5.0 ] }, 20 | { "type" : "Delete", "args" : [] } 21 | ], 22 | [ 23 | { "type" : "Move", "args" : [ 240, 400 ] }, 24 | { "type" : "Accel", "args" : [ 60, 200 ] }, 25 | { "type" : "Wait", "args" : [ 1.0 ] }, 26 | { "type" : "Move", "args" : [ 0, 0 ] }, 27 | { "type" : "Accel", "args" : [ 90, 400 ] }, 28 | { "type" : "Wait", "args" : [ 3.0 ] }, 29 | { "type" : "Delete", "args" : [] } 30 | ], 31 | [ 32 | { "type" : "Move", "args" : [ 300, 400 ] }, 33 | { "type" : "Accel", "args" : [ 120, 200 ] }, 34 | { "type" : "Wait", "args" : [ 1.0 ] }, 35 | { "type" : "Move", "args" : [ 0, 0 ] }, 36 | { "type" : "Accel", "args" : [ 90, 400 ] }, 37 | { "type" : "Wait", "args" : [ 3.0 ] }, 38 | { "type" : "Delete", "args" : [] } 39 | ], 40 | [ 41 | { "type" : "Accel", "args" : [ 0, 0 ] }, 42 | { "type" : "Wait", "args" : [ 0.5 ] }, 43 | { "type" : "Delete", "args" : [] } 44 | ] 45 | ] 46 | }, 47 | { 48 | "name" : "MiddleClassFighter", 49 | "list" : [ 50 | [ 51 | { "type" : "Move", "args" : [ 0, 200 ] }, 52 | { "type" : "Accel", "args" : [ 0, -200 ] }, 53 | { "type" : "Wait", "args" : [ 1.0 ] }, 54 | { "type" : "Move", "args" : [ 200, 0 ] }, 55 | { "type" : "Wait", "args" : [ 1.0 ] }, 56 | { "type" : "Move", "args" : [ -200, 0 ] }, 57 | { "type" : "Wait", "args" : [ 1.0 ] }, 58 | { "type" : "Move", "args" : [ 200, 0 ] }, 59 | { "type" : "Wait", "args" : [ 1.0 ] }, 60 | { "type" : "Move", "args" : [ -200, 0 ] }, 61 | { "type" : "Wait", "args" : [ 1.0 ] }, 62 | { "type" : "Accel", "args" : [ 0, -400 ] }, 63 | { "type" : "Wait", "args" : [ 3.0 ] }, 64 | { "type" : "Delete", "args" : [] } 65 | ], 66 | [ 67 | { "type" : "Move", "args" : [ 0, 200 ] }, 68 | { "type" : "Accel", "args" : [ 0, -200 ] }, 69 | { "type" : "Wait", "args" : [ 1.0 ] }, 70 | { "type" : "Move", "args" : [ -200, 0 ] }, 71 | { "type" : "Wait", "args" : [ 1.0 ] }, 72 | { "type" : "Move", "args" : [ 200, 0 ] }, 73 | { "type" : "Wait", "args" : [ 1.0 ] }, 74 | { "type" : "Move", "args" : [ -200, 0 ] }, 75 | { "type" : "Wait", "args" : [ 1.0 ] }, 76 | { "type" : "Move", "args" : [ 200, 0 ] }, 77 | { "type" : "Wait", "args" : [ 1.0 ] }, 78 | { "type" : "Move", "args" : [ 0, 0 ] }, 79 | { "type" : "Accel", "args" : [ 0, -400 ] }, 80 | { "type" : "Wait", "args" : [ 3.0 ] }, 81 | { "type" : "Delete", "args" : [] } 82 | ], 83 | [ 84 | { "type" : "Accel", "args" : [ 0, 0 ] }, 85 | { "type" : "Wait", "args" : [ 0.5 ] }, 86 | { "type" : "Delete", "args" : [] } 87 | ] 88 | ] 89 | } 90 | ] 91 | -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/Anm/Animation.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name" : "enemy", 4 | "list" : [ 5 | [ 6 | { "cell" : 0, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 7 | { "cell" : 1, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 8 | { "cell" : 2, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 9 | { "cell" : 3, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 10 | ], 11 | [ 12 | { "cell" : 4, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 13 | { "cell" : 5, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 14 | { "cell" : 6, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 15 | ], 16 | [ 17 | { "cell" : 7, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 18 | { "cell" : 8, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 19 | { "cell" : 9, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 20 | ], 21 | [ 22 | { "cell" : 10, "time" : 0.125, "rotation" : 0, "scale" : [ 1.0, 1.0 ], "color" : [ 1, 1, 1, 1 ] }, 23 | { "cell" : 10, "time" : 0.125, "rotation" : 0, "scale" : [ 0.9, 0.9 ], "color" : [ 1, 1, 1, 1 ] }, 24 | { "cell" : 10, "time" : 0.125, "rotation" : 0, "scale" : [ 1.0, 1.0 ], "color" : [ 1, 1, 1, 1 ] }, 25 | { "cell" : 10, "time" : 0.125, "rotation" : 0, "scale" : [ 1.1, 1.1 ], "color" : [ 1, 1, 1, 1 ] } 26 | ], 27 | [ 28 | { "cell" : 11, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 29 | { "cell" : 11, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 30 | { "cell" : 12, "time" : 0.10, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 31 | { "cell" : 13, "time" : 0.10, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 32 | { "cell" : 14, "time" : 0.10, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 33 | { "cell" : 14, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 0.75, 0.75, 0.75, 0.5 ] }, 34 | { "cell" : 15, "time" : -1, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 35 | ] 36 | ] 37 | }, 38 | { 39 | "name" : "player", 40 | "list" : [ 41 | [ 42 | { "cell" : 0, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 43 | { "cell" : 1, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 44 | { "cell" : 2, "time" : 0.125, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 45 | ], 46 | [ 47 | { "cell" : 3, "time" : 0.125, "rotation" : 0, "scale" : [ 1.0, 1 ], "color" : [ 1, 1, 1, 1 ] }, 48 | { "cell" : 3, "time" : 0.125, "rotation" : 0, "scale" : [ 0.9, 1 ], "color" : [ 1, 1, 1, 1 ] }, 49 | { "cell" : 3, "time" : 0.125, "rotation" : 0, "scale" : [ 0.8, 1 ], "color" : [ 1, 1, 1, 1 ] }, 50 | { "cell" : 3, "time" : 0.125, "rotation" : 0, "scale" : [ 0.9, 1 ], "color" : [ 1, 1, 1, 1 ] } 51 | ], 52 | [ 53 | { "cell" : 4, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 54 | { "cell" : 4, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 55 | { "cell" : 5, "time" : 0.10, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 56 | { "cell" : 6, "time" : 0.10, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 57 | { "cell" : 7, "time" : 0.10, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 58 | { "cell" : 7, "time" : 0.05, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 0.75, 0.75, 0.75, 0.5 ] }, 59 | { "cell" : 8, "time" : 2, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] }, 60 | { "cell" : 8, "time" : -1, "rotation" : 0, "scale" : [ 1, 1 ], "color" : [ 1, 1, 1, 1 ] } 61 | ] 62 | ] 63 | } 64 | ] 65 | -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/Cell/CellEnemy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Enemy", 4 | "texsize": [ 32, 32 ], 5 | "list": [ 6 | { "uv": [ 2.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 7 | { "uv": [ 0.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 8 | { "uv": [ 4.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 9 | 10 | { "uv": [ 6.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 11 | { "uv": [ 0.0, 2.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 12 | { "uv": [ 1.0, 2.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 13 | { "uv": [ 2.0, 2.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 14 | 15 | { "uv": [ 4.0, 2.0 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 16 | { "uv": [ 5.0, 2.0 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 17 | { "uv": [ 3.0, 2.0 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 18 | 19 | { "uv": [ 0.0, 3.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 20 | 21 | { "uv": [ 0.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 22 | { "uv": [ 2.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 23 | { "uv": [ 4.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 24 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 25 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 0, 0 ] } 26 | ] 27 | } 28 | ] -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/Cell/CellFont.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Font", 4 | "texsize": [ 16, 16 ], 5 | "list": [ 6 | { "uv": [ 0.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 7 | { "uv": [ 1.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 8 | { "uv": [ 2.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 9 | { "uv": [ 3.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 10 | { "uv": [ 4.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 11 | { "uv": [ 5.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 12 | { "uv": [ 6.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 13 | { "uv": [ 7.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 14 | { "uv": [ 8.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 15 | { "uv": [ 9.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 16 | { "uv": [10.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 17 | { "uv": [11.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 18 | { "uv": [12.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 19 | { "uv": [13.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 20 | { "uv": [14.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 21 | { "uv": [15.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 22 | 23 | { "uv": [ 0.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 24 | { "uv": [ 1.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 25 | { "uv": [ 2.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 26 | { "uv": [ 3.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 27 | { "uv": [ 4.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 28 | { "uv": [ 5.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 29 | { "uv": [ 6.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 30 | { "uv": [ 7.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 31 | { "uv": [ 8.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 32 | { "uv": [ 9.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 33 | { "uv": [10.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 34 | { "uv": [11.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 35 | { "uv": [12.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 36 | { "uv": [13.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 37 | { "uv": [14.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 38 | { "uv": [15.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 39 | 40 | { "uv": [ 0.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 41 | { "uv": [ 1.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 42 | { "uv": [ 2.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 43 | { "uv": [ 3.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 44 | { "uv": [ 4.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 45 | { "uv": [ 5.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 46 | { "uv": [ 6.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 47 | { "uv": [ 7.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 48 | { "uv": [ 8.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 49 | { "uv": [ 9.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 50 | { "uv": [10.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 51 | { "uv": [11.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 52 | { "uv": [12.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 53 | { "uv": [13.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 54 | { "uv": [14.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 55 | { "uv": [15.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 56 | 57 | { "uv": [ 0.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 58 | { "uv": [ 1.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 59 | { "uv": [ 2.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 60 | { "uv": [ 3.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 61 | { "uv": [ 4.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 62 | { "uv": [ 5.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 63 | { "uv": [ 6.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 64 | { "uv": [ 7.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 65 | { "uv": [ 8.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 66 | { "uv": [ 9.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 67 | { "uv": [10.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 68 | { "uv": [11.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 69 | { "uv": [12.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 70 | { "uv": [13.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 71 | { "uv": [14.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 72 | { "uv": [15.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 73 | 74 | { "uv": [ 0.0, 8.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] } 75 | ] 76 | } 77 | ] -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/Cell/CellPlayer.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Player", 4 | "texsize": [ 32, 32 ], 5 | "list": [ 6 | { "uv": [ 0, 30 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 7 | { "uv": [ 2, 30 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 8 | { "uv": [ 4, 30 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 9 | 10 | { "uv": [ 0, 28 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 11 | 12 | { "uv": [ 0.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 13 | { "uv": [ 2.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 14 | { "uv": [ 4.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 15 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 16 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 0, 0 ] } 17 | ] 18 | } 19 | ] -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/NoiseTexture.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | struct PSInput 5 | { 6 | float4 position : SV_POSITION; 7 | float4 color : COLOR; 8 | float2 texcoord : TEXCOORD; 9 | }; 10 | 11 | cbuffer Constant : register(b0) 12 | { 13 | float scrollOffset; 14 | } 15 | 16 | float NoiseSeed(float2 st) 17 | { 18 | return frac(sin(st.x * 12.9898f + st.y * 78.233f) * 43758.5453123f); 19 | } 20 | 21 | float Noise(float2 st) 22 | { 23 | float2 i = floor(st); 24 | float2 f = frac(st); 25 | float2 u = f * f * (3.0f - 2.0f * f); 26 | const float a = NoiseSeed(i + float2(0, 0)); 27 | const float b = NoiseSeed(i + float2(1, 0)); 28 | const float c = NoiseSeed(i + float2(0, 1)); 29 | const float d = NoiseSeed(i + float2(1, 1)); 30 | return (a * (1.0f - u.x) + b * u.x) + (c - a) * u.y * (1.0f - u.x) + (d - b) * u.y * u.x; 31 | } 32 | 33 | float4 main(PSInput input) : SV_TARGET 34 | { 35 | 36 | const float4 colorList[] = { 37 | float4(0.1f, 0.2f, 0.5f, 1.0f), 38 | float4(0.7f, 0.9f, 1.0f, 1.0f), 39 | float4(0.7f, 0.5f, 0.1f, 1.0f), 40 | float4(0.3f, 0.65f, 0.1f, 1.0f), 41 | float4(0.95f, 1.0f, 1.0f, 1.0f) 42 | }; 43 | 44 | const float offsetList[] = { 0.0f, 0.4f, 0.43f, 0.65f, 1.0f }; 45 | 46 | float value = 0.0f; 47 | float scale = 0.5f; 48 | float freq = 3.0f; 49 | float2 pos = input.texcoord + float2(0, scrollOffset); 50 | for (int i = 0; i <= 4; ++i) { 51 | value += Noise(pos * freq) * scale;; 52 | scale *= 0.5f; 53 | freq *= 2.0f; 54 | } 55 | float valueLeft = 0.0f; 56 | scale = 0.5f; 57 | freq = 3.0f; 58 | pos.x -= 1.0f / 800.0f; 59 | for (i = 0; i <= 4; ++i) { 60 | valueLeft += Noise(pos * freq) * scale;; 61 | scale *= 0.5f; 62 | freq *= 2.0f; 63 | } 64 | 65 | float4 color = colorList[4]; 66 | for (i = 1; i < 5; ++i) { 67 | if (value <= offsetList[i]) { 68 | float range = offsetList[i] - offsetList[i - 1]; 69 | color = lerp(colorList[i - 1], colorList[i], (value - offsetList[i - 1]) / range); 70 | if (value > offsetList[1] && value < valueLeft) { 71 | color *= 1.0f + (value - valueLeft) * 50.0f; 72 | } 73 | break; 74 | } 75 | } 76 | return color; 77 | //return value + t0.Sample(s0, input.texcoord) * input.color; 78 | } -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/Objects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Res/Objects.png -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/PixelShader.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | struct PSInput 5 | { 6 | float4 position : SV_POSITION; 7 | float4 color : COLOR; 8 | float2 texcoord : TEXCOORD; 9 | }; 10 | 11 | float4 main(PSInput input) : SV_TARGET 12 | { 13 | return t0.Sample(s0, input.texcoord) * input.color; 14 | } -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/SE/Bomb.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Res/SE/Bomb.wav -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/SE/MainGame.xwm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Res/SE/MainGame.xwm -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/SE/PlayerShot.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Res/SE/PlayerShot.wav -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/SE/Start.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Res/SE/Start.wav -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/SE/bgm.xwm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Res/SE/bgm.xwm -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/TextFont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Res/TextFont.png -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/TextFont.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Res/TextFont.xcf -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/Title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Res/Title.png -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/Title.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Res/Title.xcf -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/UnknownPlanet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Res/UnknownPlanet.png -------------------------------------------------------------------------------- /10/DX12Tutorial10/Res/VertexShader.hlsl: -------------------------------------------------------------------------------- 1 | /** 2 | * VertexShader.hlsl 3 | */ 4 | 5 | struct PSInput 6 | { 7 | float4 position : SV_POSITION; 8 | float4 color : COLOR; 9 | float2 texcoord : TEXCOORD; 10 | }; 11 | 12 | cbuffer RootConstants : register(b0) 13 | { 14 | float4x4 matViewProjection; 15 | }; 16 | 17 | PSInput main(float3 pos : POSITION, float4 color : COLOR, float2 texcoord : TEXCOORD) 18 | { 19 | PSInput input; 20 | input.position = mul(float4(pos, 1.0f), matViewProjection); 21 | input.color = color; 22 | input.texcoord = texcoord; 23 | return input; 24 | } -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Action.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Action.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Action.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Action.h -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Animation.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Animation.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Animation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Animation.h -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Audio.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Audio.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Audio.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Audio.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_AUDIO_H_ 5 | #define DX12TUTORIAL_SRC_AUDIO_H_ 6 | #include 7 | 8 | namespace Audio { 9 | 10 | enum State { 11 | State_Create = 0x01, 12 | State_Preparing = 0x02, 13 | State_Prepared = 0x04, 14 | State_Playing = 0x08, 15 | State_Stopped = 0x10, 16 | State_Pausing = 0x20, 17 | State_Failed = 0x40, 18 | }; 19 | 20 | enum Flag 21 | { 22 | Flag_None = 0, 23 | Flag_Loop = 0x01, 24 | }; 25 | 26 | class Sound 27 | { 28 | public: 29 | virtual ~Sound() = default; 30 | virtual bool Play(int flags = 0) = 0; 31 | virtual bool Pause() = 0; 32 | virtual bool Seek() = 0; 33 | virtual bool Stop() = 0; 34 | virtual float SetVolume(float) = 0; 35 | virtual float SetPitch(float) = 0; 36 | virtual int GetState() const = 0; 37 | }; 38 | typedef std::shared_ptr SoundPtr; 39 | 40 | class Engine 41 | { 42 | public: 43 | static Engine& Get(); 44 | 45 | Engine() = default; 46 | 47 | virtual ~Engine() = default; 48 | virtual bool Initialize() = 0; 49 | virtual void Destroy() = 0; 50 | virtual bool Update() = 0; 51 | virtual SoundPtr Prepare(const wchar_t*) = 0; 52 | virtual SoundPtr PrepareStream(const wchar_t*) = 0; 53 | virtual void SetMasterVolume(float) = 0; 54 | 55 | private: 56 | Engine(const Engine&) = delete; 57 | Engine& operator=(const Engine&) = delete; 58 | }; 59 | 60 | } // namespace Audio 61 | 62 | #endif // DX12TUTORIAL_SRC_AUDIO_H_ -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Collision.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Collision.cpp 3 | */ 4 | #include "Collision.h" 5 | #include 6 | 7 | using namespace DirectX; 8 | 9 | namespace Collision { 10 | 11 | namespace /* unnamed */ { 12 | 13 | bool CircleCircle(const Shape& sa, const XMFLOAT2& pa, const Shape& sb, const XMFLOAT2& pb) 14 | { 15 | const float dx = pa.x - pb.x; 16 | const float dy = pa.y - pb.y; 17 | const float ra = sa.circle.radius; 18 | const float rb = sb.circle.radius; 19 | return (dx * dx + dy + dy) < (ra * ra + rb * rb); 20 | } 21 | 22 | bool RectCircle(const Shape& sa, const XMFLOAT2& pa, const Shape& sb, const XMFLOAT2& pb) 23 | { 24 | const XMFLOAT2 aLT(pa.x + sa.rect.leftTop.x, pa.y + sa.rect.leftTop.y); 25 | const XMFLOAT2 aRB(pa.x + sa.rect.rightBottom.x, pa.y + sa.rect.rightBottom.y); 26 | XMFLOAT2 p; 27 | p.x = std::min(std::max(pb.x, aLT.x), aRB.x); 28 | p.y = std::min(std::max(pb.y, aLT.y), aRB.y); 29 | const float dx = p.x - pb.x; 30 | const float dy = p.y - pb.y; 31 | const float rb = sb.circle.radius; 32 | return (dx * dx + dy * dy) < (rb * rb); 33 | } 34 | bool CircleRect(const Shape& sa, const XMFLOAT2& pa, const Shape& sb, const XMFLOAT2& pb) { return RectCircle(sb, pb, sa, pa); } 35 | 36 | bool RectRect(const Shape& sa, const XMFLOAT2& pa, const Shape& sb, const XMFLOAT2& pb) 37 | { 38 | const XMFLOAT2 aLT(pa.x + sa.rect.leftTop.x, pa.y + sa.rect.leftTop.y); 39 | const XMFLOAT2 aRB(pa.x + sa.rect.rightBottom.x, pa.y + sa.rect.rightBottom.y); 40 | const XMFLOAT2 bLT(pb.x + sb.rect.leftTop.x, pb.y + sb.rect.leftTop.y); 41 | const XMFLOAT2 bRB(pb.x + sb.rect.rightBottom.x, pb.y + sb.rect.rightBottom.y); 42 | if (aRB.x < bLT.x || aLT.x > bRB.x) return false; 43 | if (aRB.y < bLT.y || aLT.y > bRB.y) return false; 44 | return true; 45 | } 46 | 47 | } // unnamed namespace 48 | 49 | bool IsCollision(const Shape& sa, const XMFLOAT2& pa, const Shape& sb, const XMFLOAT2& pb) 50 | { 51 | static bool(*const funcList[2][2])(const Shape&, const XMFLOAT2&, const Shape&, const XMFLOAT2&) = { 52 | { CircleCircle, CircleRect }, 53 | { RectCircle, RectRect }, 54 | }; 55 | return funcList[static_cast(sa.type)][static_cast(sb.type)](sa, pa, sb, pb); 56 | } 57 | 58 | } // namespace Collision 59 | -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Collision.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Collision.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_COLLISION_H_ 5 | #define DX12TUTORIAL_SRC_COLLISION_H_ 6 | #include 7 | #include 8 | #include 9 | 10 | namespace Collision { 11 | 12 | enum class ShapeType 13 | { 14 | Circle, 15 | Rectangle, 16 | }; 17 | 18 | struct Shape 19 | { 20 | Shape() : type(ShapeType::Circle), circle{ 0.1f } {} 21 | Shape(const Shape& src) : type(src.type) 22 | { 23 | switch (type) { 24 | case ShapeType::Circle: 25 | circle.radius = src.circle.radius; 26 | break; 27 | case ShapeType::Rectangle: 28 | rect.leftTop = src.rect.leftTop; 29 | rect.rightBottom = src.rect.rightBottom; 30 | break; 31 | } 32 | } 33 | ~Shape() {} 34 | 35 | Shape& operator=(const Shape& src) 36 | { 37 | this->~Shape(); 38 | new(this) Shape(src); 39 | return *this; 40 | } 41 | 42 | static Shape MakeCircle(float r) 43 | { 44 | Shape shape; 45 | shape.type = ShapeType::Circle; 46 | shape.circle.radius = r; 47 | return shape; 48 | } 49 | static Shape MakeRectangle(const DirectX::XMFLOAT2& lt, const DirectX::XMFLOAT2& rb) 50 | { 51 | Shape shape; 52 | shape.type = ShapeType::Rectangle; 53 | shape.rect.leftTop = lt; 54 | shape.rect.rightBottom = rb; 55 | return shape; 56 | } 57 | 58 | ShapeType type; 59 | int groupId; 60 | union { 61 | struct Circle 62 | { 63 | float radius; 64 | } circle; 65 | struct Rect 66 | { 67 | DirectX::XMFLOAT2 leftTop; 68 | DirectX::XMFLOAT2 rightBottom; 69 | } rect; 70 | }; 71 | }; 72 | 73 | bool IsCollision(const Shape&, const DirectX::XMFLOAT2&, const Shape&, const DirectX::XMFLOAT2&); 74 | 75 | } // namespace Collision 76 | 77 | #endif // DX12TUTORIAL_SRC_COLLISION_H_ -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/GamePad.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/GamePad.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/GamePad.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/GamePad.h -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Graphics.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Graphics.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Graphics.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Graphics.h -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Json.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Json.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Json.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Json.h -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Main.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/PSO.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/PSO.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/PSO.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/PSO.h -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Scene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Scene.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Scene.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Scene.h -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Scene/EndingScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Scene/EndingScene.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Scene/EndingScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file EndingScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_ENDINGSCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_ENDINGSCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | 11 | class EndingScene : public Scene::Scene 12 | { 13 | public: 14 | static ::Scene::ScenePtr Create(); 15 | 16 | virtual bool Load(); 17 | virtual bool Unload(); 18 | virtual int Update(double delta); 19 | virtual void Draw(Graphics::Graphics& graphics) const; 20 | 21 | private: 22 | EndingScene(); 23 | EndingScene(const EndingScene&) = delete; 24 | EndingScene& operator=(const EndingScene&) = delete; 25 | 26 | Resource::Texture texBackground; 27 | Resource::Texture texLogo; 28 | Resource::Texture texFont; 29 | std::vector sprBackground; 30 | std::vector sprLogo; 31 | std::vector sprFont; 32 | Sprite::FilePtr cellFile; 33 | AnimationFile animationFile; 34 | double time; 35 | }; 36 | 37 | #endif // DX12TUTORIAL_SRC_SCENE_ENDINGSCENE_H_ 38 | -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Scene/GameOverScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Scene/GameOverScene.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Scene/GameOverScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file GameOverScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_GAMEOVERSCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_GAMEOVERSCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | 11 | class GameOverScene : public Scene::Scene 12 | { 13 | public: 14 | static ::Scene::ScenePtr Create(); 15 | 16 | virtual bool Load(); 17 | virtual bool Unload(); 18 | virtual int Update(double delta); 19 | virtual void Draw(Graphics::Graphics& graphics) const; 20 | 21 | private: 22 | GameOverScene(); 23 | GameOverScene(const GameOverScene&) = delete; 24 | GameOverScene& operator=(const GameOverScene&) = delete; 25 | 26 | Resource::Texture texBackground; 27 | Resource::Texture texFont; 28 | std::vector sprBackground; 29 | std::vector sprFont; 30 | Sprite::FilePtr cellFile; 31 | AnimationFile animationFile; 32 | double time; 33 | }; 34 | 35 | #endif // DX12TUTORIAL_SRC_SCENE_GAMEOVERSCENE_H_ 36 | -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Scene/MainGameScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Scene/MainGameScene.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Scene/MainGameScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file MainGameScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_MAINGAMESCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_MAINGAMESCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | #include "../Action.h" 11 | #include "../Audio.h" 12 | 13 | class MainGameScene : public Scene::Scene 14 | { 15 | public: 16 | enum ExitCode 17 | { 18 | ExitCode_Ending = ExitCode_User, 19 | ExitCode_Pause, 20 | ExitCode_GameOver, 21 | }; 22 | 23 | static ::Scene::ScenePtr Create(); 24 | 25 | virtual bool Load() override; 26 | virtual bool Unload() override; 27 | virtual int Update(double delta) override; 28 | virtual void Draw(Graphics::Graphics& graphics) const override; 29 | 30 | struct Occurrence; 31 | struct FormationData; 32 | 33 | private: 34 | MainGameScene(); 35 | MainGameScene(const MainGameScene&) = delete; 36 | MainGameScene& operator=(const MainGameScene&) = delete; 37 | 38 | void UpdatePlayer(double); 39 | void GenerateEnemy(double); 40 | void UpdateEnemy(double); 41 | void UpdateScore(); 42 | void SolveCollision(); 43 | 44 | Resource::Texture texBackground; 45 | Resource::Texture texObjects; 46 | Resource::Texture texFont; 47 | std::vector sprBackground; 48 | std::vector sprPlayer; 49 | std::vector sprEnemy; 50 | std::vector sprFont; 51 | Sprite::FilePtr cellFile[2]; 52 | Sprite::FilePtr cellPlayer; 53 | AnimationFile anmObjects; 54 | AnimationFile anmOthers; 55 | Action::FilePtr actionFile; 56 | const Occurrence* pCurOccurrence; 57 | const Occurrence* pEndOccurrence; 58 | 59 | struct Formation { 60 | float time; 61 | DirectX::XMFLOAT3 pos; 62 | const FormationData* cur; 63 | const FormationData* end; 64 | }; 65 | std::vector formationList; 66 | std::vector freePlayerShotList; 67 | std::vector freeEnemyList; 68 | std::vector freeEnemyShotList; 69 | double time; 70 | uint32_t score; 71 | 72 | Audio::SoundPtr seBomb; 73 | Audio::SoundPtr sePlayerShot; 74 | Audio::SoundPtr bgm; 75 | 76 | int playerShotCycle = 0; 77 | float playerShotInterval = 0; 78 | }; 79 | 80 | #endif // DX12TUTORIAL_SRC_SCENE_MAINGAMESCENE_H_ 81 | -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Scene/PauseScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Scene/PauseScene.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Scene/PauseScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file PauseScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_PAUSESCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_PAUSESCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | 11 | class PauseScene : public Scene::Scene 12 | { 13 | public: 14 | static ::Scene::ScenePtr Create(); 15 | 16 | virtual bool Load(); 17 | virtual bool Unload(); 18 | virtual int Update(double delta); 19 | virtual void Draw(Graphics::Graphics& graphics) const; 20 | 21 | private: 22 | PauseScene(); 23 | PauseScene(const PauseScene&) = delete; 24 | PauseScene& operator=(const PauseScene&) = delete; 25 | 26 | Resource::Texture texFont; 27 | std::vector sprFont; 28 | Sprite::FilePtr cellFile; 29 | AnimationFile animationFile; 30 | double time; 31 | }; 32 | 33 | #endif // DX12TUTORIAL_SRC_SCENE_PAUSESCENE_H_ 34 | -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Scene/TitleScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Scene/TitleScene.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Scene/TitleScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file TitleScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_TITLESCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_TITLESCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | #include "../Audio.h" 11 | 12 | class TitleScene : public Scene::Scene 13 | { 14 | public: 15 | enum ExitCode 16 | { 17 | ExitCode_MainGame, 18 | ExitCode_Option, 19 | }; 20 | 21 | static ::Scene::ScenePtr Create(); 22 | 23 | virtual bool Load() override; 24 | virtual bool Unload() override; 25 | virtual int Update(double delta) override; 26 | virtual void Draw(Graphics::Graphics& graphics) const override; 27 | 28 | private: 29 | TitleScene(); 30 | TitleScene(const TitleScene&) = delete; 31 | TitleScene& operator=(const TitleScene&) = delete; 32 | 33 | Resource::Texture texBackground; 34 | Resource::Texture texLogo; 35 | Resource::Texture texFont; 36 | std::vector sprBackground; 37 | std::vector sprLogo; 38 | std::vector sprFont; 39 | Sprite::FilePtr cellFile; 40 | AnimationFile animationFile; 41 | double time; 42 | bool started; 43 | Audio::SoundPtr seStart; 44 | }; 45 | 46 | #endif // DX12TUTORIAL_SRC_SCENE_TITLESCENE_H_ -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Sprite.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Sprite.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Sprite.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Sprite.h -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Texture.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Texture.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Texture.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Texture.h -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Timer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Timer.cpp -------------------------------------------------------------------------------- /10/DX12Tutorial10/Src/Timer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12Tutorial10/Src/Timer.h -------------------------------------------------------------------------------- /10/DX12講義10.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/10/DX12講義10.doc -------------------------------------------------------------------------------- /11/DX12Tutorial11/DX12Tutorial11.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DX12Tutorial11", "DX12Tutorial11.vcxproj", "{C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.ActiveCfg = Debug|Win32 17 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.Build.0 = Debug|Win32 18 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.ActiveCfg = Debug|Win32 19 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.Build.0 = Debug|Win32 20 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.ActiveCfg = Release|x64 21 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.Build.0 = Release|x64 22 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.ActiveCfg = Release|Win32 23 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/Cell/CellEnemy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Enemy", 4 | "texsize": [ 32, 32 ], 5 | "list": [ 6 | { "uv": [ 2.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 7 | { "uv": [ 0.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 8 | { "uv": [ 4.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 9 | { "uv": [ 6.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 10 | 11 | { "uv": [ 0.0, 2.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 12 | { "uv": [ 1.0, 2.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 13 | { "uv": [ 2.0, 2.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 14 | 15 | { "uv": [ 4.0, 2.0 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 16 | { "uv": [ 5.0, 2.0 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 17 | { "uv": [ 3.0, 2.0 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 18 | 19 | { "uv": [ 0.0, 3.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 20 | 21 | { "uv": [ 0.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 22 | { "uv": [ 2.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 23 | { "uv": [ 4.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 24 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 25 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 0, 0 ] }, 26 | 27 | { "uv": [ 8, 0 ], "tsize": [ 2, 3 ], "ssize": [ 64, 96 ] }, 28 | { "uv": [10, 0 ], "tsize": [ 2, 3 ], "ssize": [ 64, 96 ] }, 29 | 30 | { "uv": [12, 0 ], "tsize": [ 2, 3 ], "ssize": [ 64, 96 ] }, 31 | { "uv": [14, 0 ], "tsize": [ 2, 3 ], "ssize": [ 64, 96 ] }, 32 | 33 | { "uv": [16, 0 ], "tsize": [ 2, 3 ], "ssize": [ 64, 96 ] }, 34 | { "uv": [18, 0 ], "tsize": [ 2, 3 ], "ssize": [ 64, 96 ] }, 35 | { "uv": [20, 0 ], "tsize": [ 2, 3 ], "ssize": [ 64, 96 ] }, 36 | 37 | { "uv": [22, 0 ], "tsize": [ 4, 4 ], "ssize": [ 128, 128 ] }, 38 | { "uv": [26, 0 ], "tsize": [ 4, 4 ], "ssize": [ 128, 128 ] }, 39 | 40 | { "uv": [ 8, 4 ], "tsize": [16, 8 ], "ssize": [ 512, 256 ] }, 41 | { "uv": [ 8, 4 ], "tsize": [16, 8 ], "ssize": [ 512, 256 ] }, 42 | { "uv": [ 8, 4 ], "tsize": [16, 8 ], "ssize": [ 512, 256 ] } 43 | ] 44 | } 45 | ] -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/Cell/CellFont.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Font", 4 | "texsize": [ 16, 16 ], 5 | "list": [ 6 | { "uv": [ 0.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 7 | { "uv": [ 1.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 8 | { "uv": [ 2.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 9 | { "uv": [ 3.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 10 | { "uv": [ 4.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 11 | { "uv": [ 5.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 12 | { "uv": [ 6.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 13 | { "uv": [ 7.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 14 | { "uv": [ 8.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 15 | { "uv": [ 9.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 16 | { "uv": [10.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 17 | { "uv": [11.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 18 | { "uv": [12.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 19 | { "uv": [13.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 20 | { "uv": [14.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 21 | { "uv": [15.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 22 | 23 | { "uv": [ 0.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 24 | { "uv": [ 1.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 25 | { "uv": [ 2.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 26 | { "uv": [ 3.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 27 | { "uv": [ 4.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 28 | { "uv": [ 5.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 29 | { "uv": [ 6.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 30 | { "uv": [ 7.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 31 | { "uv": [ 8.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 32 | { "uv": [ 9.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 33 | { "uv": [10.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 34 | { "uv": [11.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 35 | { "uv": [12.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 36 | { "uv": [13.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 37 | { "uv": [14.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 38 | { "uv": [15.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 39 | 40 | { "uv": [ 0.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 41 | { "uv": [ 1.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 42 | { "uv": [ 2.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 43 | { "uv": [ 3.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 44 | { "uv": [ 4.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 45 | { "uv": [ 5.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 46 | { "uv": [ 6.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 47 | { "uv": [ 7.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 48 | { "uv": [ 8.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 49 | { "uv": [ 9.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 50 | { "uv": [10.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 51 | { "uv": [11.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 52 | { "uv": [12.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 53 | { "uv": [13.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 54 | { "uv": [14.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 55 | { "uv": [15.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 56 | 57 | { "uv": [ 0.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 58 | { "uv": [ 1.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 59 | { "uv": [ 2.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 60 | { "uv": [ 3.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 61 | { "uv": [ 4.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 62 | { "uv": [ 5.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 63 | { "uv": [ 6.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 64 | { "uv": [ 7.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 65 | { "uv": [ 8.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 66 | { "uv": [ 9.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 67 | { "uv": [10.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 68 | { "uv": [11.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 69 | { "uv": [12.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 70 | { "uv": [13.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 71 | { "uv": [14.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 72 | { "uv": [15.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 73 | 74 | { "uv": [ 0.0, 8.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] } 75 | ] 76 | } 77 | ] -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/Cell/CellPlayer.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Player", 4 | "texsize": [ 32, 32 ], 5 | "list": [ 6 | { "uv": [ 0, 30 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 7 | { "uv": [ 2, 30 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 8 | { "uv": [ 4, 30 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 9 | 10 | { "uv": [ 0, 28 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 11 | 12 | { "uv": [ 0.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 13 | { "uv": [ 2.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 14 | { "uv": [ 4.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 15 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 16 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 0, 0 ] } 17 | ] 18 | } 19 | ] -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/NoiseTexture.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | struct PSInput 5 | { 6 | float4 position : SV_POSITION; 7 | float4 color : COLOR; 8 | float2 texcoord : TEXCOORD; 9 | }; 10 | 11 | cbuffer Constant : register(b0) 12 | { 13 | float scrollOffset; 14 | } 15 | 16 | float NoiseSeed(float2 st) 17 | { 18 | return frac(sin(st.x * 12.9898f + st.y * 78.233f) * 43758.5453123f); 19 | } 20 | 21 | float Noise(float2 st) 22 | { 23 | float2 i = floor(st); 24 | float2 f = frac(st); 25 | float2 u = f * f * (3.0f - 2.0f * f); 26 | const float a = NoiseSeed(i + float2(0, 0)); 27 | const float b = NoiseSeed(i + float2(1, 0)); 28 | const float c = NoiseSeed(i + float2(0, 1)); 29 | const float d = NoiseSeed(i + float2(1, 1)); 30 | return (a * (1.0f - u.x) + b * u.x) + (c - a) * u.y * (1.0f - u.x) + (d - b) * u.y * u.x; 31 | } 32 | 33 | float4 main(PSInput input) : SV_TARGET 34 | { 35 | 36 | const float4 colorList[] = { 37 | float4(0.1f, 0.2f, 0.5f, 1.0f), 38 | float4(0.7f, 0.9f, 1.0f, 1.0f), 39 | float4(0.7f, 0.5f, 0.1f, 1.0f), 40 | float4(0.3f, 0.65f, 0.1f, 1.0f), 41 | float4(0.95f, 1.0f, 1.0f, 1.0f) 42 | }; 43 | 44 | const float offsetList[] = { 0.0f, 0.4f, 0.43f, 0.65f, 1.0f }; 45 | 46 | float value = 0.0f; 47 | float scale = 0.5f; 48 | float freq = 3.0f; 49 | float2 pos = input.texcoord + float2(0, scrollOffset); 50 | for (int i = 0; i <= 4; ++i) { 51 | value += Noise(pos * freq) * scale;; 52 | scale *= 0.5f; 53 | freq *= 2.0f; 54 | } 55 | float valueLeft = 0.0f; 56 | scale = 0.5f; 57 | freq = 3.0f; 58 | pos.x -= 1.0f / 800.0f; 59 | for (i = 0; i <= 4; ++i) { 60 | valueLeft += Noise(pos * freq) * scale;; 61 | scale *= 0.5f; 62 | freq *= 2.0f; 63 | } 64 | 65 | float4 color = colorList[4]; 66 | for (i = 1; i < 5; ++i) { 67 | if (value <= offsetList[i]) { 68 | float range = offsetList[i] - offsetList[i - 1]; 69 | color = lerp(colorList[i - 1], colorList[i], (value - offsetList[i - 1]) / range); 70 | if (value > offsetList[1] && value < valueLeft) { 71 | color *= 1.0f + (value - valueLeft) * 50.0f; 72 | } 73 | break; 74 | } 75 | } 76 | return color; 77 | //return value + t0.Sample(s0, input.texcoord) * input.color; 78 | } -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/Objects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Res/Objects.png -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/PixelShader.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | struct PSInput 5 | { 6 | float4 position : SV_POSITION; 7 | float4 color : COLOR; 8 | float2 texcoord : TEXCOORD; 9 | }; 10 | 11 | float4 main(PSInput input) : SV_TARGET 12 | { 13 | return t0.Sample(s0, input.texcoord) * input.color; 14 | } -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/SE/Bomb.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Res/SE/Bomb.wav -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/SE/BombBoss.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Res/SE/BombBoss.wav -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/SE/Boss1st.xwm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Res/SE/Boss1st.xwm -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/SE/Hit.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Res/SE/Hit.wav -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/SE/MainGame.xwm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Res/SE/MainGame.xwm -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/SE/PlayerShot.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Res/SE/PlayerShot.wav -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/SE/Start.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Res/SE/Start.wav -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/TextFont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Res/TextFont.png -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/Title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Res/Title.png -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/UnknownPlanet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Res/UnknownPlanet.png -------------------------------------------------------------------------------- /11/DX12Tutorial11/Res/VertexShader.hlsl: -------------------------------------------------------------------------------- 1 | /** 2 | * VertexShader.hlsl 3 | */ 4 | 5 | struct PSInput 6 | { 7 | float4 position : SV_POSITION; 8 | float4 color : COLOR; 9 | float2 texcoord : TEXCOORD; 10 | }; 11 | 12 | cbuffer RootConstants : register(b0) 13 | { 14 | float4x4 matViewProjection; 15 | }; 16 | 17 | PSInput main(float3 pos : POSITION, float4 color : COLOR, float2 texcoord : TEXCOORD) 18 | { 19 | PSInput input; 20 | input.position = mul(float4(pos, 1.0f), matViewProjection); 21 | input.color = color; 22 | input.texcoord = texcoord; 23 | return input; 24 | } -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Action.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Action.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Action.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Action.h -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Animation.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Animation.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Animation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Animation.h -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Audio.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Audio.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Audio.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Audio.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_AUDIO_H_ 5 | #define DX12TUTORIAL_SRC_AUDIO_H_ 6 | #include 7 | 8 | namespace Audio { 9 | 10 | enum State { 11 | State_Create = 0x01, 12 | State_Preparing = 0x02, 13 | State_Prepared = 0x04, 14 | State_Playing = 0x08, 15 | State_Stopped = 0x10, 16 | State_Pausing = 0x20, 17 | State_Failed = 0x40, 18 | }; 19 | 20 | enum Flag 21 | { 22 | Flag_None = 0, 23 | Flag_Loop = 0x01, 24 | }; 25 | 26 | class Sound 27 | { 28 | public: 29 | virtual ~Sound() = default; 30 | virtual bool Play(int flags = 0) = 0; 31 | virtual bool Pause() = 0; 32 | virtual bool Seek() = 0; 33 | virtual bool Stop() = 0; 34 | virtual float SetVolume(float) = 0; 35 | virtual float SetPitch(float) = 0; 36 | virtual int GetState() const = 0; 37 | }; 38 | typedef std::shared_ptr SoundPtr; 39 | 40 | class Engine 41 | { 42 | public: 43 | static Engine& Get(); 44 | 45 | Engine() = default; 46 | 47 | virtual ~Engine() = default; 48 | virtual bool Initialize() = 0; 49 | virtual void Destroy() = 0; 50 | virtual bool Update() = 0; 51 | virtual SoundPtr Prepare(const wchar_t*) = 0; 52 | virtual SoundPtr PrepareStream(const wchar_t*) = 0; 53 | virtual void SetMasterVolume(float) = 0; 54 | 55 | private: 56 | Engine(const Engine&) = delete; 57 | Engine& operator=(const Engine&) = delete; 58 | }; 59 | 60 | } // namespace Audio 61 | 62 | #endif // DX12TUTORIAL_SRC_AUDIO_H_ -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Collision.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Collision.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Collision.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Collision.h -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/GamePad.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/GamePad.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/GamePad.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/GamePad.h -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Graphics.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Graphics.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Graphics.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Graphics.h -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Json.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Json.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Json.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Json.h -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Main - Copy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Main - Copy.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Main.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/PSO.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/PSO.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/PSO.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/PSO.h -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Scene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Scene.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Scene.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Scene.h -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Scene/EndingScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Scene/EndingScene.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Scene/EndingScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file EndingScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_ENDINGSCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_ENDINGSCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | 11 | class EndingScene : public Scene::Scene 12 | { 13 | public: 14 | static ::Scene::ScenePtr Create(); 15 | 16 | virtual bool Load(::Scene::Context&) override; 17 | virtual bool Unload(::Scene::Context&) override; 18 | virtual int Update(::Scene::Context&, double delta) override; 19 | virtual void Draw(Graphics::Graphics& graphics) const override; 20 | 21 | private: 22 | EndingScene(); 23 | EndingScene(const EndingScene&) = delete; 24 | EndingScene& operator=(const EndingScene&) = delete; 25 | 26 | Resource::Texture texBackground; 27 | Resource::Texture texLogo; 28 | Resource::Texture texFont; 29 | std::vector sprBackground; 30 | std::vector sprLogo; 31 | std::vector sprFont; 32 | Sprite::FilePtr cellFile; 33 | AnimationFile animationFile; 34 | double time; 35 | }; 36 | 37 | #endif // DX12TUTORIAL_SRC_SCENE_ENDINGSCENE_H_ 38 | -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Scene/GameOverScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Scene/GameOverScene.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Scene/GameOverScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file GameOverScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_GAMEOVERSCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_GAMEOVERSCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | 11 | class GameOverScene : public Scene::Scene 12 | { 13 | public: 14 | static ::Scene::ScenePtr Create(); 15 | 16 | virtual bool Load(::Scene::Context&) override; 17 | virtual bool Unload(::Scene::Context&) override; 18 | virtual int Update(::Scene::Context&, double delta) override; 19 | virtual void Draw(Graphics::Graphics& graphics) const override; 20 | 21 | private: 22 | GameOverScene(); 23 | GameOverScene(const GameOverScene&) = delete; 24 | GameOverScene& operator=(const GameOverScene&) = delete; 25 | 26 | Resource::Texture texBackground; 27 | Resource::Texture texFont; 28 | std::vector sprBackground; 29 | std::vector sprFont; 30 | Sprite::FilePtr cellFile; 31 | AnimationFile animationFile; 32 | double time; 33 | }; 34 | 35 | #endif // DX12TUTORIAL_SRC_SCENE_GAMEOVERSCENE_H_ 36 | -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Scene/MainGameScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Scene/MainGameScene.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Scene/MainGameScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file MainGameScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_MAINGAMESCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_MAINGAMESCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | #include "../Action.h" 11 | #include "../Audio.h" 12 | 13 | class MainGameScene : public Scene::Scene 14 | { 15 | public: 16 | enum ExitCode 17 | { 18 | ExitCode_Ending = ExitCode_User, 19 | ExitCode_Pause, 20 | ExitCode_GameOver, 21 | }; 22 | 23 | static ::Scene::ScenePtr Create(); 24 | 25 | virtual bool Load(::Scene::Context&) override; 26 | virtual bool Unload(::Scene::Context&) override; 27 | virtual int Update(::Scene::Context&, double delta) override; 28 | virtual void Draw(Graphics::Graphics& graphics) const override; 29 | 30 | struct Occurrence; 31 | struct FormationData; 32 | 33 | private: 34 | MainGameScene(); 35 | MainGameScene(const MainGameScene&) = delete; 36 | MainGameScene& operator=(const MainGameScene&) = delete; 37 | 38 | void UpdatePlayer(double); 39 | void GenerateEnemy(double); 40 | void UpdateEnemy(double); 41 | void UpdateScore(uint32_t); 42 | void SolveCollision(::Scene::Context&); 43 | 44 | Resource::Texture texBackground; 45 | Resource::Texture texObjects; 46 | Resource::Texture texFont; 47 | std::vector sprBackground; 48 | std::vector sprPlayer; 49 | std::vector sprEnemy; 50 | std::vector sprFont; 51 | Sprite::FilePtr cellFile[2]; 52 | Sprite::FilePtr cellPlayer; 53 | AnimationFile anmObjects; 54 | AnimationFile anmOthers; 55 | Action::FilePtr actionFile; 56 | const Occurrence* pCurOccurrence; 57 | const Occurrence* pEndOccurrence; 58 | 59 | struct Formation { 60 | float time; 61 | DirectX::XMFLOAT3 pos; 62 | const FormationData* cur; 63 | const FormationData* end; 64 | }; 65 | std::vector formationList; 66 | std::vector freePlayerShotList; 67 | std::vector freeEnemyList; 68 | std::vector freeEnemyShotList; 69 | double time; 70 | double clearTime; 71 | 72 | Audio::SoundPtr seBomb; 73 | Audio::SoundPtr seBombBoss; 74 | Audio::SoundPtr seHit; 75 | Audio::SoundPtr sePlayerShot; 76 | Audio::SoundPtr bgm; 77 | bool bgmFadeOut = false; 78 | float bgmVolume = 1.0f; 79 | 80 | int playerShotCycle = 0; 81 | float playerShotInterval = 0; 82 | }; 83 | 84 | #endif // DX12TUTORIAL_SRC_SCENE_MAINGAMESCENE_H_ 85 | -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Scene/PauseScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Scene/PauseScene.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Scene/PauseScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file PauseScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_PAUSESCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_PAUSESCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | 11 | class PauseScene : public Scene::Scene 12 | { 13 | public: 14 | static ::Scene::ScenePtr Create(); 15 | 16 | virtual bool Load(::Scene::Context&) override; 17 | virtual bool Unload(::Scene::Context&) override; 18 | virtual int Update(::Scene::Context&, double delta) override; 19 | virtual void Draw(Graphics::Graphics& graphics) const override; 20 | 21 | private: 22 | PauseScene(); 23 | PauseScene(const PauseScene&) = delete; 24 | PauseScene& operator=(const PauseScene&) = delete; 25 | 26 | Resource::Texture texFont; 27 | std::vector sprFont; 28 | Sprite::FilePtr cellFile; 29 | AnimationFile animationFile; 30 | double time; 31 | }; 32 | 33 | #endif // DX12TUTORIAL_SRC_SCENE_PAUSESCENE_H_ 34 | -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Scene/TitleScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Scene/TitleScene.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Scene/TitleScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file TitleScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_TITLESCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_TITLESCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | #include "../Audio.h" 11 | 12 | class TitleScene : public Scene::Scene 13 | { 14 | public: 15 | enum ExitCode 16 | { 17 | ExitCode_MainGame, 18 | ExitCode_Option, 19 | }; 20 | 21 | static ::Scene::ScenePtr Create(); 22 | 23 | virtual bool Load(::Scene::Context&) override; 24 | virtual bool Unload(::Scene::Context&) override; 25 | virtual int Update(::Scene::Context&, double delta) override; 26 | virtual void Draw(Graphics::Graphics& graphics) const override; 27 | 28 | private: 29 | TitleScene(); 30 | TitleScene(const TitleScene&) = delete; 31 | TitleScene& operator=(const TitleScene&) = delete; 32 | 33 | Resource::Texture texBackground; 34 | Resource::Texture texLogo; 35 | Resource::Texture texFont; 36 | std::vector sprBackground; 37 | std::vector sprLogo; 38 | std::vector sprFont; 39 | Sprite::FilePtr cellFile; 40 | AnimationFile animationFile; 41 | double time; 42 | bool started; 43 | Audio::SoundPtr seStart; 44 | }; 45 | 46 | #endif // DX12TUTORIAL_SRC_SCENE_TITLESCENE_H_ -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Sprite.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Sprite.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Sprite.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Sprite.h -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Texture.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Texture.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Texture.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Texture.h -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Timer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Timer.cpp -------------------------------------------------------------------------------- /11/DX12Tutorial11/Src/Timer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12Tutorial11/Src/Timer.h -------------------------------------------------------------------------------- /11/DX12講義11.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/11/DX12講義11.doc -------------------------------------------------------------------------------- /12/DX12Tutorial12/DX12Tutorial12.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DX12Tutorial12", "DX12Tutorial12.vcxproj", "{C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.ActiveCfg = Debug|Win32 17 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x64.Build.0 = Debug|Win32 18 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.ActiveCfg = Debug|Win32 19 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Debug|x86.Build.0 = Debug|Win32 20 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.ActiveCfg = Release|x64 21 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x64.Build.0 = Release|x64 22 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.ActiveCfg = Release|Win32 23 | {C2341BBD-8E2B-404D-8EEF-9D26E5FD5354}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/Cell/CellEnemy.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Enemy", 4 | "texsize": [ 32, 32 ], 5 | "list": [ 6 | { "uv": [ 2.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 7 | { "uv": [ 0.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 8 | { "uv": [ 4.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 9 | { "uv": [ 6.0, 0.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 10 | 11 | { "uv": [ 0.0, 2.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 12 | { "uv": [ 1.0, 2.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 13 | { "uv": [ 2.0, 2.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 14 | 15 | { "uv": [ 4.0, 2.0 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 16 | { "uv": [ 5.0, 2.0 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 17 | { "uv": [ 3.0, 2.0 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 18 | 19 | { "uv": [ 0.0, 3.0 ], "tsize": [ 1.0, 1.0 ], "ssize": [ 32, 32 ] }, 20 | 21 | { "uv": [ 0.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 22 | { "uv": [ 2.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 23 | { "uv": [ 4.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 24 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 25 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 0, 0 ] }, 26 | 27 | { "uv": [ 8, 0 ], "tsize": [ 2, 3 ], "ssize": [ 64, 96 ] }, 28 | { "uv": [10, 0 ], "tsize": [ 2, 3 ], "ssize": [ 64, 96 ] }, 29 | 30 | { "uv": [12, 0 ], "tsize": [ 2, 3 ], "ssize": [ 64, 96 ] }, 31 | { "uv": [14, 0 ], "tsize": [ 2, 3 ], "ssize": [ 64, 96 ] }, 32 | 33 | { "uv": [16, 0 ], "tsize": [ 2, 3 ], "ssize": [ 64, 96 ] }, 34 | { "uv": [18, 0 ], "tsize": [ 2, 3 ], "ssize": [ 64, 96 ] }, 35 | { "uv": [20, 0 ], "tsize": [ 2, 3 ], "ssize": [ 64, 96 ] }, 36 | 37 | { "uv": [22, 0 ], "tsize": [ 4, 4 ], "ssize": [ 128, 128 ] }, 38 | { "uv": [26, 0 ], "tsize": [ 4, 4 ], "ssize": [ 128, 128 ] }, 39 | 40 | { "uv": [ 8, 4 ], "tsize": [16, 8 ], "ssize": [ 512, 256 ] }, 41 | { "uv": [ 8, 4 ], "tsize": [16, 8 ], "ssize": [ 512, 256 ] }, 42 | { "uv": [ 8, 4 ], "tsize": [16, 8 ], "ssize": [ 512, 256 ] } 43 | ] 44 | } 45 | ] -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/Cell/CellFont.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Font", 4 | "texsize": [ 16, 16 ], 5 | "list": [ 6 | { "uv": [ 0.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 7 | { "uv": [ 1.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 8 | { "uv": [ 2.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 9 | { "uv": [ 3.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 10 | { "uv": [ 4.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 11 | { "uv": [ 5.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 12 | { "uv": [ 6.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 13 | { "uv": [ 7.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 14 | { "uv": [ 8.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 15 | { "uv": [ 9.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 16 | { "uv": [10.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 17 | { "uv": [11.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 18 | { "uv": [12.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 19 | { "uv": [13.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 20 | { "uv": [14.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 21 | { "uv": [15.0, 0.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 22 | 23 | { "uv": [ 0.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 24 | { "uv": [ 1.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 25 | { "uv": [ 2.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 26 | { "uv": [ 3.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 27 | { "uv": [ 4.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 28 | { "uv": [ 5.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 29 | { "uv": [ 6.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 30 | { "uv": [ 7.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 31 | { "uv": [ 8.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 32 | { "uv": [ 9.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 33 | { "uv": [10.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 34 | { "uv": [11.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 35 | { "uv": [12.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 36 | { "uv": [13.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 37 | { "uv": [14.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 38 | { "uv": [15.0, 2.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 39 | 40 | { "uv": [ 0.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 41 | { "uv": [ 1.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 42 | { "uv": [ 2.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 43 | { "uv": [ 3.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 44 | { "uv": [ 4.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 45 | { "uv": [ 5.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 46 | { "uv": [ 6.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 47 | { "uv": [ 7.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 48 | { "uv": [ 8.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 49 | { "uv": [ 9.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 50 | { "uv": [10.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 51 | { "uv": [11.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 52 | { "uv": [12.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 53 | { "uv": [13.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 54 | { "uv": [14.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 55 | { "uv": [15.0, 4.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 56 | 57 | { "uv": [ 0.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 58 | { "uv": [ 1.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 59 | { "uv": [ 2.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 60 | { "uv": [ 3.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 61 | { "uv": [ 4.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 62 | { "uv": [ 5.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 63 | { "uv": [ 6.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 64 | { "uv": [ 7.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 65 | { "uv": [ 8.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 66 | { "uv": [ 9.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 67 | { "uv": [10.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 68 | { "uv": [11.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 69 | { "uv": [12.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 70 | { "uv": [13.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 71 | { "uv": [14.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 72 | { "uv": [15.0, 6.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] }, 73 | 74 | { "uv": [ 0.0, 8.0 ], "tsize": [1.0, 2.0 ], "ssize": [ 32, 64 ] } 75 | ] 76 | } 77 | ] -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/Cell/CellPlayer.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Player", 4 | "texsize": [ 32, 32 ], 5 | "list": [ 6 | { "uv": [ 0, 30 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 7 | { "uv": [ 2, 30 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 8 | { "uv": [ 4, 30 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 9 | 10 | { "uv": [ 0, 28 ], "tsize": [ 1.0, 2.0 ], "ssize": [ 32, 64 ] }, 11 | 12 | { "uv": [ 0.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 13 | { "uv": [ 2.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 14 | { "uv": [ 4.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 15 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 64, 64 ] }, 16 | { "uv": [ 6.0, 4.0 ], "tsize": [ 2.0, 2.0 ], "ssize": [ 0, 0 ] } 17 | ] 18 | } 19 | ] -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/FontPhenomena.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Res/FontPhenomena.png -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/NoiseTexture.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | struct PSInput 5 | { 6 | float4 position : SV_POSITION; 7 | float4 color : COLOR; 8 | float2 texcoord : TEXCOORD; 9 | }; 10 | 11 | cbuffer Constant : register(b0) 12 | { 13 | float scrollOffset; 14 | } 15 | 16 | float NoiseSeed(float2 st) 17 | { 18 | return frac(sin(st.x * 12.9898f + st.y * 78.233f) * 43758.5453123f); 19 | } 20 | 21 | float Noise(float2 st) 22 | { 23 | float2 i = floor(st); 24 | float2 f = frac(st); 25 | float2 u = f * f * (3.0f - 2.0f * f); 26 | const float a = NoiseSeed(i + float2(0, 0)); 27 | const float b = NoiseSeed(i + float2(1, 0)); 28 | const float c = NoiseSeed(i + float2(0, 1)); 29 | const float d = NoiseSeed(i + float2(1, 1)); 30 | return (a * (1.0f - u.x) + b * u.x) + (c - a) * u.y * (1.0f - u.x) + (d - b) * u.y * u.x; 31 | } 32 | 33 | float4 main(PSInput input) : SV_TARGET 34 | { 35 | 36 | const float4 colorList[] = { 37 | float4(0.1f, 0.2f, 0.5f, 1.0f), 38 | float4(0.7f, 0.9f, 1.0f, 1.0f), 39 | float4(0.7f, 0.5f, 0.1f, 1.0f), 40 | float4(0.3f, 0.65f, 0.1f, 1.0f), 41 | float4(0.95f, 1.0f, 1.0f, 1.0f) 42 | }; 43 | 44 | const float offsetList[] = { 0.0f, 0.4f, 0.43f, 0.65f, 1.0f }; 45 | 46 | float value = 0.0f; 47 | float scale = 0.5f; 48 | float freq = 3.0f; 49 | float2 pos = input.texcoord + float2(0, scrollOffset); 50 | for (int i = 0; i <= 4; ++i) { 51 | value += Noise(pos * freq) * scale;; 52 | scale *= 0.5f; 53 | freq *= 2.0f; 54 | } 55 | float valueLeft = 0.0f; 56 | scale = 0.5f; 57 | freq = 3.0f; 58 | pos.x -= 1.0f / 800.0f; 59 | for (i = 0; i <= 4; ++i) { 60 | valueLeft += Noise(pos * freq) * scale;; 61 | scale *= 0.5f; 62 | freq *= 2.0f; 63 | } 64 | 65 | float4 color = colorList[4]; 66 | for (i = 1; i < 5; ++i) { 67 | if (value <= offsetList[i]) { 68 | float range = offsetList[i] - offsetList[i - 1]; 69 | color = lerp(colorList[i - 1], colorList[i], (value - offsetList[i - 1]) / range); 70 | if (value > offsetList[1] && value < valueLeft) { 71 | color *= 1.0f + (value - valueLeft) * 50.0f; 72 | } 73 | break; 74 | } 75 | } 76 | return color; 77 | //return value + t0.Sample(s0, input.texcoord) * input.color; 78 | } -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/Objects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Res/Objects.png -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/PixelShader.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D t0 : register(t0); 2 | SamplerState s0 : register(s0); 3 | 4 | struct PSInput 5 | { 6 | float4 position : SV_POSITION; 7 | float4 color : COLOR; 8 | float2 texcoord : TEXCOORD; 9 | }; 10 | 11 | float4 main(PSInput input) : SV_TARGET 12 | { 13 | float4 tex = t0.Sample(s0, input.texcoord); 14 | tex.a = smoothstep(0.4, 0.6, tex.a); 15 | if (tex.a == 0) { 16 | discard; 17 | } 18 | return tex * input.color; 19 | } -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/SE/Bomb.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Res/SE/Bomb.wav -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/SE/BombBoss.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Res/SE/BombBoss.wav -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/SE/Boss1st.xwm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Res/SE/Boss1st.xwm -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/SE/Hit.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Res/SE/Hit.wav -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/SE/MainGame.xwm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Res/SE/MainGame.xwm -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/SE/PlayerShot.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Res/SE/PlayerShot.wav -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/SE/Start.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Res/SE/Start.wav -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/TextFont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Res/TextFont.png -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/Title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Res/Title.png -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/UnknownPlanet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Res/UnknownPlanet.png -------------------------------------------------------------------------------- /12/DX12Tutorial12/Res/VertexShader.hlsl: -------------------------------------------------------------------------------- 1 | /** 2 | * VertexShader.hlsl 3 | */ 4 | 5 | struct PSInput 6 | { 7 | float4 position : SV_POSITION; 8 | float4 color : COLOR; 9 | float2 texcoord : TEXCOORD; 10 | }; 11 | 12 | cbuffer RootConstants : register(b0) 13 | { 14 | float4x4 matViewProjection; 15 | }; 16 | 17 | PSInput main(float3 pos : POSITION, float4 color : COLOR, float2 texcoord : TEXCOORD) 18 | { 19 | PSInput input; 20 | input.position = mul(float4(pos, 1.0f), matViewProjection); 21 | input.color = color; 22 | input.texcoord = texcoord; 23 | return input; 24 | } -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Action.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Action.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Action.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Action.h -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Animation.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Animation.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Animation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Animation.h -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Audio.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Audio.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Audio.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Audio.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_AUDIO_H_ 5 | #define DX12TUTORIAL_SRC_AUDIO_H_ 6 | #include 7 | 8 | namespace Audio { 9 | 10 | enum State { 11 | State_Create = 0x01, 12 | State_Preparing = 0x02, 13 | State_Prepared = 0x04, 14 | State_Playing = 0x08, 15 | State_Stopped = 0x10, 16 | State_Pausing = 0x20, 17 | State_Failed = 0x40, 18 | }; 19 | 20 | enum Flag 21 | { 22 | Flag_None = 0, 23 | Flag_Loop = 0x01, 24 | }; 25 | 26 | class Sound 27 | { 28 | public: 29 | virtual ~Sound() = default; 30 | virtual bool Play(int flags = 0) = 0; 31 | virtual bool Pause() = 0; 32 | virtual bool Seek() = 0; 33 | virtual bool Stop() = 0; 34 | virtual float SetVolume(float) = 0; 35 | virtual float SetPitch(float) = 0; 36 | virtual int GetState() const = 0; 37 | }; 38 | typedef std::shared_ptr SoundPtr; 39 | 40 | class Engine 41 | { 42 | public: 43 | static Engine& Get(); 44 | 45 | Engine() = default; 46 | 47 | virtual ~Engine() = default; 48 | virtual bool Initialize() = 0; 49 | virtual void Destroy() = 0; 50 | virtual bool Update() = 0; 51 | virtual SoundPtr Prepare(const wchar_t*) = 0; 52 | virtual SoundPtr PrepareStream(const wchar_t*) = 0; 53 | virtual void SetMasterVolume(float) = 0; 54 | 55 | private: 56 | Engine(const Engine&) = delete; 57 | Engine& operator=(const Engine&) = delete; 58 | }; 59 | 60 | } // namespace Audio 61 | 62 | #endif // DX12TUTORIAL_SRC_AUDIO_H_ -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Collision.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Collision.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Collision.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Collision.h -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/GamePad.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/GamePad.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/GamePad.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/GamePad.h -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Graphics.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Graphics.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Graphics.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Graphics.h -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Json.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Json.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Json.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Json.h -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Main.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/PSO.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/PSO.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/PSO.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/PSO.h -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Scene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Scene.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Scene.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Scene.h -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Scene/EndingScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Scene/EndingScene.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Scene/EndingScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file EndingScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_ENDINGSCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_ENDINGSCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | 11 | class EndingScene : public Scene::Scene 12 | { 13 | public: 14 | static ::Scene::ScenePtr Create(); 15 | 16 | virtual bool Load(::Scene::Context&) override; 17 | virtual bool Unload(::Scene::Context&) override; 18 | virtual int Update(::Scene::Context&, double delta) override; 19 | virtual void Draw(Graphics::Graphics& graphics) const override; 20 | 21 | private: 22 | EndingScene(); 23 | EndingScene(const EndingScene&) = delete; 24 | EndingScene& operator=(const EndingScene&) = delete; 25 | 26 | Resource::Texture texBackground; 27 | Resource::Texture texLogo; 28 | Resource::Texture texFont; 29 | std::vector sprBackground; 30 | std::vector sprLogo; 31 | std::vector sprFont; 32 | Sprite::FilePtr cellFile; 33 | AnimationFile animationFile; 34 | double time; 35 | }; 36 | 37 | #endif // DX12TUTORIAL_SRC_SCENE_ENDINGSCENE_H_ 38 | -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Scene/GameOverScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Scene/GameOverScene.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Scene/GameOverScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file GameOverScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_GAMEOVERSCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_GAMEOVERSCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | 11 | class GameOverScene : public Scene::Scene 12 | { 13 | public: 14 | static ::Scene::ScenePtr Create(); 15 | 16 | virtual bool Load(::Scene::Context&) override; 17 | virtual bool Unload(::Scene::Context&) override; 18 | virtual int Update(::Scene::Context&, double delta) override; 19 | virtual void Draw(Graphics::Graphics& graphics) const override; 20 | 21 | private: 22 | GameOverScene(); 23 | GameOverScene(const GameOverScene&) = delete; 24 | GameOverScene& operator=(const GameOverScene&) = delete; 25 | 26 | Resource::Texture texBackground; 27 | Resource::Texture texFont; 28 | std::vector sprBackground; 29 | std::vector sprFont; 30 | Sprite::FilePtr cellFile; 31 | AnimationFile animationFile; 32 | double time; 33 | }; 34 | 35 | #endif // DX12TUTORIAL_SRC_SCENE_GAMEOVERSCENE_H_ 36 | -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Scene/MainGameScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Scene/MainGameScene.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Scene/MainGameScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file MainGameScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_MAINGAMESCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_MAINGAMESCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | #include "../Action.h" 11 | #include "../Audio.h" 12 | 13 | class MainGameScene : public Scene::Scene 14 | { 15 | public: 16 | enum ExitCode 17 | { 18 | ExitCode_Ending = ExitCode_User, 19 | ExitCode_Pause, 20 | ExitCode_GameOver, 21 | }; 22 | 23 | static ::Scene::ScenePtr Create(); 24 | 25 | virtual bool Load(::Scene::Context&) override; 26 | virtual bool Unload(::Scene::Context&) override; 27 | virtual int Update(::Scene::Context&, double delta) override; 28 | virtual void Draw(Graphics::Graphics& graphics) const override; 29 | 30 | struct Occurrence; 31 | struct FormationData; 32 | 33 | private: 34 | MainGameScene(); 35 | MainGameScene(const MainGameScene&) = delete; 36 | MainGameScene& operator=(const MainGameScene&) = delete; 37 | 38 | void UpdatePlayer(double); 39 | void GenerateEnemy(double); 40 | void UpdateEnemy(double); 41 | void UpdateScore(uint32_t); 42 | void SolveCollision(::Scene::Context&); 43 | 44 | Resource::Texture texBackground; 45 | Resource::Texture texObjects; 46 | Resource::Texture texFont; 47 | std::vector sprBackground; 48 | std::vector sprPlayer; 49 | std::vector sprEnemy; 50 | std::vector sprFont; 51 | Sprite::FilePtr cellFile[2]; 52 | Sprite::FilePtr cellPlayer; 53 | AnimationFile anmObjects; 54 | AnimationFile anmOthers; 55 | Action::FilePtr actionFile; 56 | const Occurrence* pCurOccurrence; 57 | const Occurrence* pEndOccurrence; 58 | 59 | struct Formation { 60 | float time; 61 | DirectX::XMFLOAT3 pos; 62 | const FormationData* cur; 63 | const FormationData* end; 64 | }; 65 | std::vector formationList; 66 | std::vector freePlayerShotList; 67 | std::vector freeEnemyList; 68 | std::vector freeEnemyShotList; 69 | double time; 70 | double clearTime; 71 | 72 | Audio::SoundPtr seBomb; 73 | Audio::SoundPtr seBombBoss; 74 | Audio::SoundPtr seHit; 75 | Audio::SoundPtr sePlayerShot; 76 | Audio::SoundPtr bgm; 77 | bool bgmFadeOut = false; 78 | float bgmVolume = 1.0f; 79 | 80 | int playerShotCycle = 0; 81 | float playerShotInterval = 0; 82 | }; 83 | 84 | #endif // DX12TUTORIAL_SRC_SCENE_MAINGAMESCENE_H_ 85 | -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Scene/PauseScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Scene/PauseScene.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Scene/PauseScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file PauseScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_PAUSESCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_PAUSESCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | 11 | class PauseScene : public Scene::Scene 12 | { 13 | public: 14 | static ::Scene::ScenePtr Create(); 15 | 16 | virtual bool Load(::Scene::Context&) override; 17 | virtual bool Unload(::Scene::Context&) override; 18 | virtual int Update(::Scene::Context&, double delta) override; 19 | virtual void Draw(Graphics::Graphics& graphics) const override; 20 | 21 | private: 22 | PauseScene(); 23 | PauseScene(const PauseScene&) = delete; 24 | PauseScene& operator=(const PauseScene&) = delete; 25 | 26 | Resource::Texture texFont; 27 | std::vector sprFont; 28 | Sprite::FilePtr cellFile; 29 | AnimationFile animationFile; 30 | double time; 31 | }; 32 | 33 | #endif // DX12TUTORIAL_SRC_SCENE_PAUSESCENE_H_ 34 | -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Scene/TitleScene.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Scene/TitleScene.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Scene/TitleScene.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file TitleScene.h 3 | */ 4 | #ifndef DX12TUTORIAL_SRC_SCENE_TITLESCENE_H_ 5 | #define DX12TUTORIAL_SRC_SCENE_TITLESCENE_H_ 6 | #include "../Scene.h" 7 | #include "../Texture.h" 8 | #include "../Sprite.h" 9 | #include "../Animation.h" 10 | #include "../Audio.h" 11 | #include 12 | 13 | class TitleScene : public Scene::Scene 14 | { 15 | public: 16 | enum ExitCode 17 | { 18 | ExitCode_MainGame, 19 | ExitCode_Option, 20 | }; 21 | 22 | static ::Scene::ScenePtr Create(); 23 | 24 | virtual bool Load(::Scene::Context&) override; 25 | virtual bool Unload(::Scene::Context&) override; 26 | virtual int Update(::Scene::Context&, double delta) override; 27 | virtual void Draw(Graphics::Graphics& graphics) const override; 28 | 29 | private: 30 | TitleScene(); 31 | TitleScene(const TitleScene&) = delete; 32 | TitleScene& operator=(const TitleScene&) = delete; 33 | void UpdatePlayer(double delta); 34 | void UpdatePlayerShot(double delta); 35 | void UpdateEnemy(double delta); 36 | void UpdateEnemyShot(double delta); 37 | void GenerateEnemy(double delta); 38 | void CollisionPlayerShotAndEnemy(); 39 | 40 | Resource::Texture texBackground; 41 | Resource::Texture texLogo; 42 | Resource::Texture texFont; 43 | std::vector sprBackground; 44 | std::vector sprLogo; 45 | std::vector sprFont; 46 | Sprite::FilePtr cellFile; 47 | Sprite::CellList fontCellList; 48 | AnimationFile animationFile; 49 | double time; 50 | bool started; 51 | Audio::SoundPtr seStart; 52 | 53 | Audio::SoundPtr sePlayerShot; 54 | Audio::SoundPtr seBlast; 55 | Resource::Texture texCharacter; 56 | std::mt19937 rnd; 57 | std::vector sprPlayer; 58 | std::vector sprPlayerShotFree; 59 | std::vector sprEnemy; 60 | std::vector sprEnemyFree; 61 | std::vector sprEnemyShotFree; 62 | double entryTimer; 63 | }; 64 | 65 | #endif // DX12TUTORIAL_SRC_SCENE_TITLESCENE_H_ -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Sprite.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Sprite.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Sprite.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Sprite.h -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Texture.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Texture.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Texture.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Texture.h -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Timer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Timer.cpp -------------------------------------------------------------------------------- /12/DX12Tutorial12/Src/Timer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12Tutorial12/Src/Timer.h -------------------------------------------------------------------------------- /12/DX12講義12.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/12/DX12講義12.doc -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 tanaka mai(mai.tanaka.cpper@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /ScreenShots/GamePlay00.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/ScreenShots/GamePlay00.jpg -------------------------------------------------------------------------------- /ScreenShots/GamePlay01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/ScreenShots/GamePlay01.jpg -------------------------------------------------------------------------------- /ScreenShots/GamePlay02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/ScreenShots/GamePlay02.jpg -------------------------------------------------------------------------------- /ScreenShots/Title.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/ScreenShots/Title.jpg -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | #2D Shooting Game by DirectX 12 2 | 3 | 某所の「DirectX 12による2Dゲーム作成」講義に使った資料置き場です。 4 | ウィンドウの作成から始めて、少しずつゲームの部品を実装していきます。 5 | 6 | ソースコードは資料のコードそのままではないです。 7 | 各ドキュメントの最後にある「やってみよう」の項目を実装し、回によってはさらにいくつかの機能を追加しています。 8 | 9 | ##ビルド環境 10 | - Windows 10 Anniversary Update 11 | - Microsoft Visual Studio 2015 Community Edition 12 | - Microsoft Windows SDK 10.0.14393.0 13 | 14 | おかしなところを見つけたらPull-Requestください。 15 | 16 | ##スクリーンショット 17 | ![Title](ScreenShots/Title.jpg) 18 | ![Trivial Enemies](ScreenShots/GamePlay00.jpg) 19 | ![Other Enemies](ScreenShots/GamePlay01.jpg) 20 | ![Boss](ScreenShots/GamePlay02.jpg) 21 | -------------------------------------------------------------------------------- /田中講師後期シラバス.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tn-mai/DX12Tutorial/9976b8bf069351b9479475d60e25808ad79fc230/田中講師後期シラバス.xls --------------------------------------------------------------------------------