├── 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