Compare commits
119 Commits
Cel-Shadin
...
V11.2.0
Author | SHA1 | Date | |
---|---|---|---|
315d259acd | |||
2a1b474df0 | |||
d364517633 | |||
ce51c11b31 | |||
0e11ead55b | |||
1af71960c3 | |||
f20adee22f | |||
eb2cd17ec3 | |||
dbd27d1fe7 | |||
d6b7626446 | |||
f9d4523f09 | |||
24203060be | |||
8b77b189a8 | |||
e5ee8fdad3 | |||
3a2d19dff4 | |||
dbc7003569 | |||
c5bfa2e621 | |||
32b71ac97f | |||
5c3c6d944c | |||
8d32f51e8c | |||
644fc57762 | |||
f8bfb62e98 | |||
94fd900ce8 | |||
2744c809d3 | |||
b80f66fec3 | |||
8bcd3eed48 | |||
2b1e64ffbd | |||
96aa41f649 | |||
00e6749d01 | |||
5a3a4f73a8 | |||
c442a87883 | |||
e681943aa8 | |||
e68f1d5dd0 | |||
8e6b7409d9 | |||
7dbd735416 | |||
6014c9034c | |||
bf6131af55 | |||
41519f7154 | |||
74151de6f7 | |||
f8503e5a2a | |||
c15cb2956d | |||
96b0d0e72d | |||
f1c13a3c8c | |||
e34b44996a | |||
0e45e0688c | |||
9c6db5c76d | |||
3ea5c92028 | |||
4d23c481d4 | |||
d8bda97819 | |||
ede5080c10 | |||
1ea77c909f | |||
73727ab45a | |||
e991d069fe | |||
648fc887d6 | |||
63482923bb | |||
987ad6784e | |||
f2a8bb6b5b | |||
606aaa76e9 | |||
3930c5eff7 | |||
eea7b4c067 | |||
6583f74a5f | |||
7eb6ed72e6 | |||
8b9e860c00 | |||
5e68105fe1 | |||
af01f223c1 | |||
118e967412 | |||
452e84aa16 | |||
151ea9b191 | |||
0d5e26266b | |||
425224a96c | |||
d8851cc679 | |||
c355509870 | |||
51b29f77aa | |||
d8552d3f91 | |||
261df5e257 | |||
172db0b96d | |||
296e04692a | |||
fec593205b | |||
161166837f | |||
a88ed06198 | |||
cb3f10b7d5 | |||
4ae55e73b2 | |||
15217a5df8 | |||
06efdf6f6c | |||
b029018552 | |||
39fa32603f | |||
c707e49561 | |||
58cafd7682 | |||
c5de18a9b3 | |||
f337e58dcc | |||
![]() |
af98e5edc7 | ||
01a9c940f0 | |||
ab0355ed97 | |||
915c0cdd7f | |||
bce659e55d | |||
79f266b479 | |||
b4804c2df2 | |||
7d2b962420 | |||
d7965fec64 | |||
7f84ab39a1 | |||
975edf0e62 | |||
b3af9f4ce7 | |||
8f20397130 | |||
3aafec5bf8 | |||
79558eed4f | |||
3e3620d925 | |||
c9ece7b9b9 | |||
97e4a62f20 | |||
64ae50814f | |||
9f3b4c4f1a | |||
0ce02071bb | |||
48624a2135 | |||
fa2544d596 | |||
68e460c5df | |||
bbbea117c3 | |||
c4b4ef83e3 | |||
6e6db2cf87 | |||
b45707c620 | |||
e20a2aa365 |
2
.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
enginecustom/assets/Model/OBJ/*.obj filter=lfs diff=lfs merge=lfs -text
|
||||
enginecustom/assets/Model/OBJ/*.mtl filter=lfs diff=lfs merge=lfs -text
|
8
.gitignore
vendored
@@ -9,14 +9,6 @@
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
# Don't ignore 3d model in OBJ
|
||||
!enginecustom/monke.obj
|
||||
!enginecustom/isosphere.obj
|
||||
!enginecustom/cone.obj
|
||||
!enginecustom/vaisseau.obj
|
||||
!enginecustom/86.obj
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
|
1
.idea/.idea.KhaoticEngineReborn/.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
||||
KhaoticEngineReborn
|
6
.idea/.idea.KhaoticEngineReborn/.idea/AndroidProjectSystem.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AndroidProjectSystem">
|
||||
<option name="providerId" value="RiderAndroidProjectSystem" />
|
||||
</component>
|
||||
</project>
|
14
.idea/.idea.KhaoticEngineReborn/.idea/discord.xml
generated
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DiscordProjectSettings">
|
||||
<option name="show" value="PROJECT_FILES" />
|
||||
<option name="description" value="" />
|
||||
<option name="applicationTheme" value="default" />
|
||||
<option name="iconsTheme" value="default" />
|
||||
<option name="button1Title" value="" />
|
||||
<option name="button1Url" value="" />
|
||||
<option name="button2Title" value="" />
|
||||
<option name="button2Url" value="" />
|
||||
<option name="customApplicationId" value="" />
|
||||
</component>
|
||||
</project>
|
8
.idea/.idea.KhaoticEngineReborn/.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/enginecustom/src/src/system/application_class.cpp" charset="windows-1252" />
|
||||
<file url="file://$PROJECT_DIR$/enginecustom/src/src/system/imguiManager.cpp" charset="windows-1252" />
|
||||
<file url="PROJECT" charset="windows-1252" />
|
||||
</component>
|
||||
</project>
|
6
.idea/.idea.KhaoticEngineReborn/.idea/git_toolbox_blame.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxBlameSettings">
|
||||
<option name="version" value="2" />
|
||||
</component>
|
||||
</project>
|
15
.idea/.idea.KhaoticEngineReborn/.idea/git_toolbox_prj.xml
generated
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxProjectSettings">
|
||||
<option name="commitMessageIssueKeyValidationOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
<option name="commitMessageValidationEnabledOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
8
.idea/.idea.KhaoticEngineReborn/.idea/indexLayout.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
7
.idea/.idea.KhaoticEngineReborn/.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="LanguageDetectionInspection" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="ReassignedToPlainText" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
12
.idea/.idea.KhaoticEngineReborn/.idea/material_theme_project_new.xml
generated
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MaterialThemeProjectNewConfig">
|
||||
<option name="metadata">
|
||||
<MTProjectMetadataState>
|
||||
<option name="migrated" value="true" />
|
||||
<option name="pristineConfig" value="false" />
|
||||
<option name="userId" value="4025287c:194ad69ad19:-7ff7" />
|
||||
</MTProjectMetadataState>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
8
.idea/.idea.KhaoticEngineReborn/.idea/projectSettingsUpdater.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RiderProjectSettingsUpdater">
|
||||
<option name="singleClickDiffPreview" value="1" />
|
||||
<option name="unhandledExceptionsIgnoreList" value="1" />
|
||||
<option name="vcsConfiguration" value="3" />
|
||||
</component>
|
||||
</project>
|
6
.idea/.idea.KhaoticEngineReborn/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
286
.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,286 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e81d6e08-efc7-40a0-909d-ec4943d948e9" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/application_class.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/application_class.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/imguiManager.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/imguiManager.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/stats.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/stats.h" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/application_class.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/application_class.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/imguiManager.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/imguiManager.cpp" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/stats.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/stats.cpp" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="DpaMonitoringSettings">
|
||||
<option name="firstShow" value="false" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="HighlightingSettingsPerFile">
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="cidr-memory-view://2" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="file://C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um/d3d11.h" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um/dinput.h" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/include/Inc/VertexTypes.h" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/enginecustom/include/Vulkan/Include/vulkan/vulkan_core.h" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/../../IDE_VS/VC/Tools/MSVC/14.38.33130/include/type_traits" root0="SKIP_HIGHLIGHTING" />
|
||||
</component>
|
||||
<component name="KubernetesApiPersistence">{}</component>
|
||||
<component name="KubernetesApiProvider">{
|
||||
"isMigrated": true
|
||||
}</component>
|
||||
<component name="MetaFilesCheckinStateConfiguration" checkMetaFiles="true" />
|
||||
<component name="ProblemsViewState">
|
||||
<option name="selectedTabId" value="CurrentFile" />
|
||||
</component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 6
|
||||
}</component>
|
||||
<component name="ProjectId" id="2sGIWDeT5ixyzDQ0he4A3RFpG9W" />
|
||||
<component name="ProjectLevelVcsManager">
|
||||
<ConfirmationsSetting value="2" id="Add" />
|
||||
</component>
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"C++ Project.enginecustom.executor": "Run",
|
||||
"C/C++ Project.KhaoticDemo.executor": "Run",
|
||||
"C/C++ Project.enginecustom.executor": "Debug",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.git.unshallow": "true",
|
||||
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
||||
"git-widget-placeholder": "main",
|
||||
"ignore.virus.scanning.warn.message": "true",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"node.js.selected.package.tslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"settings.editor.selected.configurable": "preferences.pluginManager",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
}
|
||||
}]]></component>
|
||||
<component name="RunManager" selected="C/C++ Project.enginecustom">
|
||||
<configuration name="KhaoticDemo" type="CppProject" factoryName="C++ Project">
|
||||
<configuration_1 setup="1">
|
||||
<option name="CONFIGURATION" value="Debug" />
|
||||
<option name="PLATFORM" value="x64" />
|
||||
<option name="CURRENT_LAUNCH_PROFILE" value="Local" />
|
||||
<option name="EXE_PATH" value="$(LocalDebuggerCommand)" />
|
||||
<option name="PROGRAM_PARAMETERS" value="$(LocalDebuggerCommandArguments)" />
|
||||
<option name="WORKING_DIRECTORY" value="$(LocalDebuggerWorkingDirectory)" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="TERMINAL_INTERACTION_BEHAVIOR" value="AUTO_DETECT" />
|
||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/KhaoticDemo/KhaoticDemo.vcxproj" />
|
||||
</configuration_1>
|
||||
<option name="DEFAULT_PROJECT_PATH" value="$PROJECT_DIR$/KhaoticDemo/KhaoticDemo.vcxproj" />
|
||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/KhaoticDemo/KhaoticDemo.vcxproj" />
|
||||
<option name="AUTO_SELECT_PRIORITY" value="0" />
|
||||
<method v="2">
|
||||
<option name="Build" />
|
||||
</method>
|
||||
</configuration>
|
||||
<configuration name="enginecustom" type="CppProject" factoryName="C++ Project">
|
||||
<configuration_1 setup="1">
|
||||
<option name="CONFIGURATION" value="Debug" />
|
||||
<option name="PLATFORM" value="x64" />
|
||||
<option name="CURRENT_LAUNCH_PROFILE" value="Local" />
|
||||
<option name="EXE_PATH" value="$(LocalDebuggerCommand)" />
|
||||
<option name="PROGRAM_PARAMETERS" value="$(LocalDebuggerCommandArguments)" />
|
||||
<option name="WORKING_DIRECTORY" value="$(LocalDebuggerWorkingDirectory)" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="TERMINAL_INTERACTION_BEHAVIOR" value="AUTO_DETECT" />
|
||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
||||
</configuration_1>
|
||||
<configuration_2 setup="1">
|
||||
<option name="CONFIGURATION" value="Release" />
|
||||
<option name="PLATFORM" value="x64" />
|
||||
<option name="CURRENT_LAUNCH_PROFILE" value="Local" />
|
||||
<option name="EXE_PATH" value="$(TargetPath)" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$(ProjectDir)" />
|
||||
<option name="PASS_PARENT_ENVS" value="1" />
|
||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||
<option name="TERMINAL_INTERACTION_BEHAVIOR" value="AUTO_DETECT" />
|
||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
||||
</configuration_2>
|
||||
<option name="DEFAULT_PROJECT_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
||||
<option name="PROJECT_FILE_PATH" value="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" />
|
||||
<option name="AUTO_SELECT_PRIORITY" value="0" />
|
||||
<method v="2">
|
||||
<option name="Build" />
|
||||
</method>
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="e81d6e08-efc7-40a0-909d-ec4943d948e9" name="Changes" comment="" />
|
||||
<created>1738075515913</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1738075515913</updated>
|
||||
<workItem from="1738075517746" duration="553000" />
|
||||
<workItem from="1738076088229" duration="80000" />
|
||||
<workItem from="1738076192788" duration="19000" />
|
||||
<workItem from="1738076222547" duration="6131000" />
|
||||
<workItem from="1738171504772" duration="876000" />
|
||||
<workItem from="1738172392786" duration="67000" />
|
||||
<workItem from="1738173151768" duration="2361000" />
|
||||
<workItem from="1738175535254" duration="279000" />
|
||||
<workItem from="1738178991872" duration="2736000" />
|
||||
<workItem from="1738244577624" duration="3000" />
|
||||
<workItem from="1738321399968" duration="689000" />
|
||||
<workItem from="1738358054789" duration="9000" />
|
||||
<workItem from="1738358091089" duration="6675000" />
|
||||
<workItem from="1738364887298" duration="2275000" />
|
||||
<workItem from="1738515031789" duration="14018000" />
|
||||
<workItem from="1741705445392" duration="138000" />
|
||||
<workItem from="1741706018301" duration="5499000" />
|
||||
<workItem from="1742198713923" duration="31000" />
|
||||
<workItem from="1742198792655" duration="4618000" />
|
||||
<workItem from="1742203643675" duration="600000" />
|
||||
<workItem from="1742206836574" duration="258000" />
|
||||
<workItem from="1742207107802" duration="5340000" />
|
||||
<workItem from="1742228751298" duration="38000" />
|
||||
<workItem from="1742228870107" duration="1198000" />
|
||||
<workItem from="1742314944369" duration="79000" />
|
||||
<workItem from="1742318452773" duration="2258000" />
|
||||
<workItem from="1742331065936" duration="3030000" />
|
||||
<workItem from="1742371397157" duration="13355000" />
|
||||
<workItem from="1742425863119" duration="231000" />
|
||||
<workItem from="1742474596806" duration="67000" />
|
||||
<workItem from="1742474683111" duration="689000" />
|
||||
<workItem from="1742574318953" duration="552000" />
|
||||
<workItem from="1742581210996" duration="681000" />
|
||||
<workItem from="1742651501885" duration="47000" />
|
||||
<workItem from="1742664377329" duration="746000" />
|
||||
<workItem from="1742665243312" duration="310000" />
|
||||
<workItem from="1742667326806" duration="95000" />
|
||||
<workItem from="1743185728805" duration="15000" />
|
||||
<workItem from="1743185754182" duration="815000" />
|
||||
<workItem from="1743355100472" duration="708000" />
|
||||
<workItem from="1743355837694" duration="1514000" />
|
||||
<workItem from="1743370106270" duration="901000" />
|
||||
<workItem from="1743505399891" duration="2361000" />
|
||||
<workItem from="1746106963725" duration="5888000" />
|
||||
<workItem from="1746112904421" duration="75000" />
|
||||
<workItem from="1746113092234" duration="1477000" />
|
||||
<workItem from="1746117455914" duration="5976000" />
|
||||
<workItem from="1746126812110" duration="180000" />
|
||||
<workItem from="1746188920194" duration="1870000" />
|
||||
<workItem from="1746274246641" duration="89000" />
|
||||
<workItem from="1746274352144" duration="8039000" />
|
||||
<workItem from="1746444660572" duration="7742000" />
|
||||
<workItem from="1746456965664" duration="13000" />
|
||||
<workItem from="1746469494034" duration="799000" />
|
||||
<workItem from="1746526901276" duration="2023000" />
|
||||
<workItem from="1746536290167" duration="1908000" />
|
||||
<workItem from="1746538260893" duration="5781000" />
|
||||
<workItem from="1746546014271" duration="1814000" />
|
||||
<workItem from="1746619988287" duration="12282000" />
|
||||
<workItem from="1746711806997" duration="6736000" />
|
||||
<workItem from="1746719840054" duration="991000" />
|
||||
<workItem from="1746795732153" duration="33000" />
|
||||
<workItem from="1746795828588" duration="592000" />
|
||||
<workItem from="1747049871967" duration="9350000" />
|
||||
<workItem from="1747136509645" duration="3939000" />
|
||||
<workItem from="1747258663152" duration="835000" />
|
||||
<workItem from="1747826758888" duration="3587000" />
|
||||
<workItem from="1747830379222" duration="7954000" />
|
||||
<workItem from="1748254142068" duration="10499000" />
|
||||
<workItem from="1748267553700" duration="654000" />
|
||||
<workItem from="1748429087202" duration="7421000" />
|
||||
<workItem from="1748521606678" duration="5300000" />
|
||||
<workItem from="1748859894056" duration="1431000" />
|
||||
<workItem from="1748861785837" duration="357000" />
|
||||
<workItem from="1748865625274" duration="797000" />
|
||||
<workItem from="1748869642637" duration="3049000" />
|
||||
<workItem from="1748954607174" duration="13379000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="Minor update - viewport window tweak">
|
||||
<option name="closed" value="true" />
|
||||
<created>1738175474520</created>
|
||||
<option name="number" value="00001" />
|
||||
<option name="presentableId" value="LOCAL-00001" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1738175474520</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00002" summary="Patch update - add menu button">
|
||||
<option name="closed" value="true" />
|
||||
<created>1738181617050</created>
|
||||
<option name="number" value="00002" />
|
||||
<option name="presentableId" value="LOCAL-00002" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1738181617050</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="3" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="UnityCheckinConfiguration" checkUnsavedScenes="true" />
|
||||
<component name="UnityProjectConfiguration" hasMinimizedUI="false" />
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="true" />
|
||||
<MESSAGE value="Minor update - viewport window tweak" />
|
||||
<MESSAGE value="Patch update - add menu button" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="Patch update - add menu button" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<breakpoint enabled="true" type="DotNet_Exception_Breakpoints">
|
||||
<properties exception="System.OperationCanceledException" breakIfHandledByOtherCode="false" displayValue="System.OperationCanceledException" />
|
||||
<option name="timeStamp" value="1" />
|
||||
</breakpoint>
|
||||
<breakpoint enabled="true" type="DotNet_Exception_Breakpoints">
|
||||
<properties exception="System.Threading.Tasks.TaskCanceledException" breakIfHandledByOtherCode="false" displayValue="System.Threading.Tasks.TaskCanceledException" />
|
||||
<option name="timeStamp" value="2" />
|
||||
</breakpoint>
|
||||
<breakpoint enabled="true" type="DotNet_Exception_Breakpoints">
|
||||
<properties exception="System.Threading.ThreadAbortException" breakIfHandledByOtherCode="false" displayValue="System.Threading.ThreadAbortException" />
|
||||
<option name="timeStamp" value="3" />
|
||||
</breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
<watches-manager>
|
||||
<configuration name="CppProject">
|
||||
<watch expression="((class ModelClass &) (*(*(*this).m_Application).m_object[0]))" />
|
||||
</configuration>
|
||||
</watches-manager>
|
||||
</component>
|
||||
<component name="XSLT-Support.FileAssociations.UIState">
|
||||
<expand />
|
||||
<select />
|
||||
</component>
|
||||
</project>
|
@@ -1,140 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{9e5ef415-5337-4eed-ae23-edc4b1fff455}</ProjectGuid>
|
||||
<RootNamespace>KhaoticDemo</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\enginecustom\enginecustom.vcxproj">
|
||||
<Project>{92cf56c4-76bb-40d4-8fe5-36c15f5f127a}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Fichiers sources">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Fichiers d%27en-tête">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Fichiers de ressources">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
@@ -1,4 +0,0 @@
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
@@ -1,72 +0,0 @@
|
||||
/////////////
|
||||
// GLOBALS //
|
||||
/////////////
|
||||
SamplerState SampleType : register(s0);
|
||||
|
||||
Texture2D reflectionTexture : register(t0);
|
||||
Texture2D refractionTexture : register(t1);
|
||||
Texture2D normalTexture : register(t2);
|
||||
|
||||
cbuffer WaterBuffer
|
||||
{
|
||||
float waterTranslation;
|
||||
float reflectRefractScale;
|
||||
float2 padding;
|
||||
};
|
||||
|
||||
|
||||
//////////////
|
||||
// TYPEDEFS //
|
||||
//////////////
|
||||
struct PixelInputType
|
||||
{
|
||||
float4 position : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float4 reflectionPosition : TEXCOORD1;
|
||||
float4 refractionPosition : TEXCOORD2;
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Pixel Shader
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
float4 WaterPixelShader(PixelInputType input) : SV_TARGET
|
||||
{
|
||||
float2 reflectTexCoord;
|
||||
float2 refractTexCoord;
|
||||
float4 normalMap;
|
||||
float3 normal;
|
||||
float4 reflectionColor;
|
||||
float4 refractionColor;
|
||||
float4 color;
|
||||
|
||||
// Move the position the water normal is sampled from to simulate moving water.
|
||||
input.tex.y += waterTranslation;
|
||||
|
||||
// Calculate the projected reflection texture coordinates.
|
||||
reflectTexCoord.x = input.reflectionPosition.x / input.reflectionPosition.w / 2.0f + 0.5f;
|
||||
reflectTexCoord.y = -input.reflectionPosition.y / input.reflectionPosition.w / 2.0f + 0.5f;
|
||||
|
||||
// Calculate the projected refraction texture coordinates.
|
||||
refractTexCoord.x = input.refractionPosition.x / input.refractionPosition.w / 2.0f + 0.5f;
|
||||
refractTexCoord.y = -input.refractionPosition.y / input.refractionPosition.w / 2.0f + 0.5f;
|
||||
|
||||
// Sample the normal from the normal map texture.
|
||||
normalMap = normalTexture.Sample(SampleType, input.tex);
|
||||
|
||||
// Expand the range of the normal from (0,1) to (-1,+1).
|
||||
normal = (normalMap.xyz * 2.0f) - 1.0f;
|
||||
|
||||
// Re-position the texture coordinate sampling position by the normal map value to simulate the rippling wave effect.
|
||||
reflectTexCoord = reflectTexCoord + (normal.xy * reflectRefractScale);
|
||||
refractTexCoord = refractTexCoord + (normal.xy * reflectRefractScale);
|
||||
|
||||
// Sample the texture pixels from the textures using the updated texture coordinates.
|
||||
reflectionColor = reflectionTexture.Sample(SampleType, reflectTexCoord);
|
||||
refractionColor = refractionTexture.Sample(SampleType, refractTexCoord);
|
||||
|
||||
// Combine the reflection and refraction results for the final color.
|
||||
color = lerp(reflectionColor, refractionColor, 0.6f);
|
||||
|
||||
return color;
|
||||
}
|
@@ -3,9 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.9.34607.119
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "enginecustom", "enginecustom\enginecustom.vcxproj", "{92CF56C4-76BB-40D4-8FE5-36C15F5F127A}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KhaoticDemo", "KhaoticDemo\KhaoticDemo.vcxproj", "{9E5EF415-5337-4EED-AE23-EDC4B1FFF455}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KhaoticCore", "enginecustom\enginecustom.vcxproj", "{92CF56C4-76BB-40D4-8FE5-36C15F5F127A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -23,14 +21,6 @@ Global
|
||||
{92CF56C4-76BB-40D4-8FE5-36C15F5F127A}.Release|x64.Build.0 = Release|x64
|
||||
{92CF56C4-76BB-40D4-8FE5-36C15F5F127A}.Release|x86.ActiveCfg = Release|Win32
|
||||
{92CF56C4-76BB-40D4-8FE5-36C15F5F127A}.Release|x86.Build.0 = Release|Win32
|
||||
{9E5EF415-5337-4EED-AE23-EDC4B1FFF455}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{9E5EF415-5337-4EED-AE23-EDC4B1FFF455}.Debug|x64.Build.0 = Debug|x64
|
||||
{9E5EF415-5337-4EED-AE23-EDC4B1FFF455}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{9E5EF415-5337-4EED-AE23-EDC4B1FFF455}.Debug|x86.Build.0 = Debug|Win32
|
||||
{9E5EF415-5337-4EED-AE23-EDC4B1FFF455}.Release|x64.ActiveCfg = Release|x64
|
||||
{9E5EF415-5337-4EED-AE23-EDC4B1FFF455}.Release|x64.Build.0 = Release|x64
|
||||
{9E5EF415-5337-4EED-AE23-EDC4B1FFF455}.Release|x86.ActiveCfg = Release|Win32
|
||||
{9E5EF415-5337-4EED-AE23-EDC4B1FFF455}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
33
README.md
@@ -2,13 +2,13 @@
|
||||
|
||||
Khaotic Engine Reborn reprend comme base le moteur Khaotic Engine pour lui ajouter plus de fonctionalité.
|
||||
|
||||
Ce moteur est basé sur **DirectX11** utilise **ImGui** avec une couche d'abstraction pour permetre son usage avec d'autres API.
|
||||
Ce moteur est basé sur **DirectX11** et utilise **ImGui** pour son interface graphique.
|
||||
|
||||
---
|
||||
|
||||
Khaotic Engine is a rendering engine made in **C++** by a small team with the aim of learning how to use rendering APIs (OpenGL, DirectX 11/12 and Vulkan).
|
||||
|
||||
This **DirectX11** based engine uses **ImGui** with an abstraction layer to enable its use with other APIs.
|
||||
This **DirectX11** based engine uses **ImGui** for the user interface.
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -35,15 +35,36 @@ This **DirectX11** based engine uses **ImGui** with an abstraction layer to enab
|
||||
|
||||
**SHADER** :
|
||||
|
||||
- Cel Shading
|
||||
+ Sunlight shader
|
||||
+ Cel Shading
|
||||
+ Skysphere
|
||||
|
||||
**Interface Graphique** :
|
||||
|
||||
- Shader Manager
|
||||
+ Console link to the Logger object
|
||||
+ Shader Manager
|
||||
+ Engine Settings
|
||||
+ Sunlight Settings
|
||||
|
||||
**Save And Load of a Scene** :
|
||||
|
||||
+ Save All Custom object
|
||||
+ Save All Custom Texture for Custom Object
|
||||
|
||||
**Texture File** :
|
||||
|
||||
+ All the format supported by Windows Imaging Component (WIC)
|
||||
|
||||
**Optimization** :
|
||||
|
||||
- Shader rendering
|
||||
- Frustum culling
|
||||
- Object rendering
|
||||
- Terrain Instancing
|
||||
|
||||
## Demo :
|
||||
|
||||
[](https://www.youtube.com/watch?v=qCOCTyB_97c)
|
||||
[](https://youtu.be/CbK1a0Ar94Q)
|
||||
|
||||
## Engine Build by :
|
||||
|
||||
@@ -56,7 +77,7 @@ This **DirectX11** based engine uses **ImGui** with an abstraction layer to enab
|
||||
- [@Harpie94](https://github.com/Harpie94)
|
||||
- [@axelpicou](https://github.com/axelpicou)
|
||||
- [@GolfOcean334](https://github.com/GolfOcean334)
|
||||
- [@sutabasuto](https://github.com/sutabasuto)
|
||||
- [@sutabasuto](https://github.com/sutabasuto)
|
||||
|
||||
|
||||
**Moteur Reborn** :
|
||||
|
18
enginecustom/.vscode/c_cpp_properties.json
vendored
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"configurations": [
|
||||
{
|
||||
"name": "windows-gcc-x64",
|
||||
"includePath": [
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"compilerPath": "gcc",
|
||||
"cStandard": "${default}",
|
||||
"cppStandard": "${default}",
|
||||
"intelliSenseMode": "windows-gcc-x64",
|
||||
"compilerArgs": [
|
||||
""
|
||||
]
|
||||
}
|
||||
],
|
||||
"version": 4
|
||||
}
|
724122
enginecustom/86.obj
@@ -1,46 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Filename: cameraclass.h
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _CAMERACLASS_H_
|
||||
#define _CAMERACLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include <directxmath.h>
|
||||
using namespace DirectX;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: CameraClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class CameraClass
|
||||
{
|
||||
public:
|
||||
CameraClass();
|
||||
CameraClass(const CameraClass&);
|
||||
~CameraClass();
|
||||
|
||||
void SetPosition(float, float, float);
|
||||
void SetRotation(float, float, float);
|
||||
|
||||
XMFLOAT3 GetPosition();
|
||||
XMFLOAT3 GetRotation();
|
||||
|
||||
|
||||
void Render();
|
||||
XMMATRIX GetViewMatrix(XMMATRIX& viewMatrix) const;
|
||||
|
||||
void RenderReflection(float);
|
||||
void GetReflectionViewMatrix(XMMATRIX&) const;
|
||||
|
||||
private:
|
||||
float m_positionX, m_positionY, m_positionZ;
|
||||
float m_rotationX, m_rotationY, m_rotationZ;
|
||||
XMMATRIX m_viewMatrix;
|
||||
XMMATRIX m_reflectionViewMatrix;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@@ -1,410 +0,0 @@
|
||||
#include "CelShadingShader.h"
|
||||
#include <iostream>
|
||||
|
||||
CelShadingShader::CelShadingShader()
|
||||
{
|
||||
m_vertexShader = 0;
|
||||
m_pixelShader = 0;
|
||||
m_layout = 0;
|
||||
m_matrixBuffer = 0;
|
||||
m_sampleState = 0;
|
||||
m_lightBuffer = 0;
|
||||
}
|
||||
|
||||
CelShadingShader::CelShadingShader(const CelShadingShader& other)
|
||||
{
|
||||
}
|
||||
|
||||
CelShadingShader::~CelShadingShader()
|
||||
{
|
||||
}
|
||||
|
||||
bool CelShadingShader::Initialize(ID3D11Device* device, HWND hwnd)
|
||||
{
|
||||
Logger::Get().Log("Initializing CelShadingShader", __FILE__, __LINE__, Logger::LogLevel::Initialize);
|
||||
|
||||
bool result;
|
||||
wchar_t vsFilename[128];
|
||||
wchar_t psFilename[128];
|
||||
int error;
|
||||
|
||||
// Set the filename of the vertex shader.
|
||||
error = wcscpy_s(vsFilename, 128, L"celshading.vs");
|
||||
if (error != 0)
|
||||
{
|
||||
Logger::Get().Log("Failed to set the filename of the vertex shader", __FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the filename of the pixel shader.
|
||||
error = wcscpy_s(psFilename, 128, L"celshading.ps");
|
||||
if (error != 0)
|
||||
{
|
||||
Logger::Get().Log("Failed to set the filename of the pixel shader", __FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Initialize the vertex and pixel shaders.
|
||||
result = InitializeShader(device, hwnd, vsFilename, psFilename);
|
||||
if (!result)
|
||||
{
|
||||
Logger::Get().Log("Failed to initialize the vertex and pixel shaders", __FILE__, __LINE__);
|
||||
return false;
|
||||
}
|
||||
|
||||
Logger::Get().Log("Successfully initialized CelShadingShader", __FILE__, __LINE__, Logger::LogLevel::Initialize);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CelShadingShader::Shutdown()
|
||||
{
|
||||
// Shutdown the vertex and pixel shaders as well as the related objects.
|
||||
ShutdownShader();
|
||||
}
|
||||
|
||||
bool CelShadingShader::Render(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
|
||||
ID3D11ShaderResourceView* texture, XMFLOAT3 lightDirection, XMFLOAT4 diffuseColor, XMFLOAT3 lightPosition)
|
||||
{
|
||||
bool result;
|
||||
// Set the shader parameters that it will use for rendering.
|
||||
result = SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix, texture, lightDirection, diffuseColor, lightPosition);
|
||||
if (!result)
|
||||
{
|
||||
Logger::Get().Log("CelShading Error", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Now render the prepared buffers with the shader.
|
||||
RenderShader(deviceContext, indexCount);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CelShadingShader::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* vsFilename, WCHAR* psFilename)
|
||||
{
|
||||
HRESULT result;
|
||||
ID3D10Blob* errorMessage = nullptr;
|
||||
ID3D10Blob* vertexShaderBuffer = nullptr;
|
||||
ID3D10Blob* pixelShaderBuffer = nullptr;
|
||||
D3D11_INPUT_ELEMENT_DESC polygonLayout[3];
|
||||
unsigned int numElements;
|
||||
D3D11_BUFFER_DESC matrixBufferDesc;
|
||||
D3D11_SAMPLER_DESC samplerDesc;
|
||||
D3D11_BUFFER_DESC lightBufferDesc;
|
||||
|
||||
// Compile the vertex shader code.
|
||||
result = D3DCompileFromFile(vsFilename, nullptr, nullptr, "CelShadingVertexShader", "vs_5_0", D3D10_SHADER_ENABLE_STRICTNESS, 0, &vertexShaderBuffer, &errorMessage);
|
||||
if (FAILED(result))
|
||||
{
|
||||
// If the shader failed to compile it should have written something to the error message.
|
||||
if (errorMessage)
|
||||
{
|
||||
OutputShaderErrorMessage(errorMessage, hwnd, vsFilename);
|
||||
}
|
||||
// If there was nothing in the error message then it simply could not find the shader file itself.
|
||||
else
|
||||
{
|
||||
MessageBox(hwnd, vsFilename, L"Missing Shader File", MB_OK);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Compile the pixel shader code.
|
||||
result = D3DCompileFromFile(psFilename, nullptr, nullptr, "CelShadingPixelShader", "ps_5_0", D3D10_SHADER_ENABLE_STRICTNESS, 0, &pixelShaderBuffer, &errorMessage);
|
||||
if (FAILED(result))
|
||||
{
|
||||
// If the shader failed to compile it should have written something to the error message.
|
||||
if (errorMessage)
|
||||
{
|
||||
OutputShaderErrorMessage(errorMessage, hwnd, psFilename);
|
||||
}
|
||||
// If there was nothing in the error message then it simply could not find the file itself.
|
||||
else
|
||||
{
|
||||
MessageBox(hwnd, psFilename, L"Missing Shader File", MB_OK);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create the vertex shader from the buffer.
|
||||
result = device->CreateVertexShader(vertexShaderBuffer->GetBufferPointer(), vertexShaderBuffer->GetBufferSize(), nullptr, &m_vertexShader);
|
||||
if (FAILED(result))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create the pixel shader from the buffer.
|
||||
result = device->CreatePixelShader(pixelShaderBuffer->GetBufferPointer(), pixelShaderBuffer->GetBufferSize(), nullptr, &m_pixelShader);
|
||||
if (FAILED(result))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create the vertex input layout description.
|
||||
// This setup needs to match the VertexType structure in the ModelClass and in the shader.
|
||||
polygonLayout[0].SemanticName = "POSITION";
|
||||
polygonLayout[0].SemanticIndex = 0;
|
||||
polygonLayout[0].Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
|
||||
polygonLayout[0].InputSlot = 0;
|
||||
polygonLayout[0].AlignedByteOffset = 0;
|
||||
polygonLayout[0].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
|
||||
polygonLayout[0].InstanceDataStepRate = 0;
|
||||
|
||||
polygonLayout[1].SemanticName = "NORMAL";
|
||||
polygonLayout[1].SemanticIndex = 0;
|
||||
polygonLayout[1].Format = DXGI_FORMAT_R32G32B32_FLOAT;
|
||||
polygonLayout[1].InputSlot = 0;
|
||||
polygonLayout[1].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
|
||||
polygonLayout[1].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
|
||||
polygonLayout[1].InstanceDataStepRate = 0;
|
||||
|
||||
polygonLayout[2].SemanticName = "TEXCOORD";
|
||||
polygonLayout[2].SemanticIndex = 0;
|
||||
polygonLayout[2].Format = DXGI_FORMAT_R32G32_FLOAT;
|
||||
polygonLayout[2].InputSlot = 0;
|
||||
polygonLayout[2].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
|
||||
polygonLayout[2].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
|
||||
polygonLayout[2].InstanceDataStepRate = 0;
|
||||
|
||||
// Get a count of the elements in the layout.
|
||||
numElements = sizeof(polygonLayout) / sizeof(polygonLayout[0]);
|
||||
|
||||
// Create the vertex input layout.
|
||||
result = device->CreateInputLayout(polygonLayout, numElements, vertexShaderBuffer->GetBufferPointer(), vertexShaderBuffer->GetBufferSize(), &m_layout);
|
||||
if (FAILED(result))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Release the vertex shader buffer and pixel shader buffer since they are no longer needed.
|
||||
vertexShaderBuffer->Release();
|
||||
vertexShaderBuffer = nullptr;
|
||||
|
||||
pixelShaderBuffer->Release();
|
||||
pixelShaderBuffer = nullptr;
|
||||
|
||||
// Setup the description of the dynamic matrix constant buffer that is in the vertex shader.
|
||||
matrixBufferDesc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
matrixBufferDesc.ByteWidth = sizeof(MatrixBufferType);
|
||||
matrixBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
|
||||
matrixBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
matrixBufferDesc.MiscFlags = 0;
|
||||
matrixBufferDesc.StructureByteStride = 0;
|
||||
|
||||
// Create the constant buffer pointer so we can access the vertex shader constant buffer from within this class.
|
||||
result = device->CreateBuffer(&matrixBufferDesc, nullptr, &m_matrixBuffer);
|
||||
if (FAILED(result))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create a texture sampler state description.
|
||||
samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
|
||||
samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
|
||||
samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
|
||||
samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
|
||||
samplerDesc.MipLODBias = 0.0f;
|
||||
samplerDesc.MaxAnisotropy = 1;
|
||||
samplerDesc.ComparisonFunc = D3D11_COMPARISON_ALWAYS;
|
||||
samplerDesc.BorderColor[0] = 0;
|
||||
samplerDesc.BorderColor[1] = 0;
|
||||
samplerDesc.BorderColor[2] = 0;
|
||||
samplerDesc.BorderColor[3] = 0;
|
||||
samplerDesc.MinLOD = 0;
|
||||
samplerDesc.MaxLOD = D3D11_FLOAT32_MAX;
|
||||
|
||||
// Create the texture sampler state.
|
||||
result = device->CreateSamplerState(&samplerDesc, &m_sampleState);
|
||||
if (FAILED(result))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Setup the description of the light dynamic constant buffer that is in the pixel shader.
|
||||
lightBufferDesc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
lightBufferDesc.ByteWidth = sizeof(LightBufferType);
|
||||
lightBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
|
||||
lightBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
lightBufferDesc.MiscFlags = 0;
|
||||
lightBufferDesc.StructureByteStride = 0;
|
||||
|
||||
// Create the constant buffer pointer so we can access the pixel shader constant buffer from within this class.
|
||||
result = device->CreateBuffer(&lightBufferDesc, nullptr, &m_lightBuffer);
|
||||
if (FAILED(result))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void CelShadingShader::ShutdownShader()
|
||||
{
|
||||
// Release the light constant buffer.
|
||||
if (m_lightBuffer)
|
||||
{
|
||||
m_lightBuffer->Release();
|
||||
m_lightBuffer = nullptr;
|
||||
}
|
||||
|
||||
// Release the sampler state.
|
||||
if (m_sampleState)
|
||||
{
|
||||
m_sampleState->Release();
|
||||
m_sampleState = nullptr;
|
||||
}
|
||||
|
||||
// Release the matrix constant buffer.
|
||||
if (m_matrixBuffer)
|
||||
{
|
||||
m_matrixBuffer->Release();
|
||||
m_matrixBuffer = nullptr;
|
||||
}
|
||||
|
||||
// Release the layout.
|
||||
if (m_layout)
|
||||
{
|
||||
m_layout->Release();
|
||||
m_layout = nullptr;
|
||||
}
|
||||
|
||||
// Release the pixel shader.
|
||||
if (m_pixelShader)
|
||||
{
|
||||
m_pixelShader->Release();
|
||||
m_pixelShader = nullptr;
|
||||
}
|
||||
|
||||
// Release the vertex shader.
|
||||
if (m_vertexShader)
|
||||
{
|
||||
m_vertexShader->Release();
|
||||
m_vertexShader = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void CelShadingShader::OutputShaderErrorMessage(ID3D10Blob* errorMessage, HWND hwnd, WCHAR* shaderFilename)
|
||||
{
|
||||
char* compileErrors;
|
||||
unsigned long bufferSize, i;
|
||||
std::ofstream fout;
|
||||
|
||||
// Get a pointer to the error message text buffer.
|
||||
compileErrors = (char*)(errorMessage->GetBufferPointer());
|
||||
|
||||
// Get the length of the message.
|
||||
bufferSize = errorMessage->GetBufferSize();
|
||||
|
||||
// Open a file to write the error message to.
|
||||
fout.open("shader-error.txt");
|
||||
|
||||
// Write out the error message.
|
||||
for (i = 0; i < bufferSize; i++)
|
||||
{
|
||||
fout << compileErrors[i];
|
||||
}
|
||||
|
||||
// Close the file.
|
||||
fout.close();
|
||||
|
||||
// Release the error message.
|
||||
errorMessage->Release();
|
||||
errorMessage = nullptr;
|
||||
|
||||
// Pop a message up on the screen to notify the user to check the text file for compile errors.
|
||||
MessageBox(hwnd, L"Error compiling shader. Check shader-error.txt for message.", shaderFilename, MB_OK);
|
||||
}
|
||||
|
||||
|
||||
bool CelShadingShader::SetShaderParameters(ID3D11DeviceContext* deviceContext, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
|
||||
ID3D11ShaderResourceView* texture, XMFLOAT3 lightDirection, XMFLOAT4 diffuseColor, XMFLOAT3 lightPosition)
|
||||
{
|
||||
HRESULT result;
|
||||
D3D11_MAPPED_SUBRESOURCE mappedResource;
|
||||
MatrixBufferType* dataPtr;
|
||||
LightBufferType* dataPtr2;
|
||||
unsigned int bufferNumber;
|
||||
|
||||
// Transpose the matrices to prepare them for the shader.
|
||||
worldMatrix = XMMatrixTranspose(worldMatrix);
|
||||
viewMatrix = XMMatrixTranspose(viewMatrix);
|
||||
projectionMatrix = XMMatrixTranspose(projectionMatrix);
|
||||
|
||||
// Lock the constant buffer so it can be written to.
|
||||
result = deviceContext->Map(m_matrixBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
|
||||
if (FAILED(result))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get a pointer to the data in the constant buffer.
|
||||
dataPtr = (MatrixBufferType*)mappedResource.pData;
|
||||
|
||||
// Copy the matrices into the constant buffer.
|
||||
dataPtr->world = worldMatrix;
|
||||
dataPtr->view = viewMatrix;
|
||||
dataPtr->projection = projectionMatrix;
|
||||
|
||||
// Unlock the constant buffer.
|
||||
deviceContext->Unmap(m_matrixBuffer, 0);
|
||||
|
||||
// Set the position of the constant buffer in the vertex shader.
|
||||
bufferNumber = 0;
|
||||
|
||||
// Finally set the constant buffer in the vertex shader with the updated values.
|
||||
deviceContext->VSSetConstantBuffers(bufferNumber, 1, &m_matrixBuffer);
|
||||
|
||||
// Lock the light constant buffer so it can be written to.
|
||||
result = deviceContext->Map(m_lightBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
|
||||
if (FAILED(result))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get a pointer to the data in the constant buffer.
|
||||
dataPtr2 = (LightBufferType*)mappedResource.pData;
|
||||
|
||||
// Copy the lighting variables into the constant buffer.
|
||||
dataPtr2->diffuseColor = diffuseColor;
|
||||
dataPtr2->lightDirection = lightDirection;
|
||||
dataPtr2->lightPosition = lightPosition;
|
||||
dataPtr2->constantAttenuation = 0.5f; // Set your attenuation values here
|
||||
dataPtr2->linearAttenuation = 0.1f;
|
||||
dataPtr2->quadraticAttenuation = 0.01f;
|
||||
|
||||
// Unlock the constant buffer.
|
||||
deviceContext->Unmap(m_lightBuffer, 0);
|
||||
|
||||
// Set the position of the light constant buffer in the pixel shader.
|
||||
bufferNumber = 0;
|
||||
|
||||
// Finally set the light constant buffer in the pixel shader with the updated values.
|
||||
deviceContext->PSSetConstantBuffers(bufferNumber, 1, &m_lightBuffer);
|
||||
|
||||
// Set shader texture resource in the pixel shader.
|
||||
deviceContext->PSSetShaderResources(0, 1, &texture);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CelShadingShader::RenderShader(ID3D11DeviceContext* deviceContext, int indexCount)
|
||||
{
|
||||
// Set the vertex input layout.
|
||||
deviceContext->IASetInputLayout(m_layout);
|
||||
|
||||
// Set the vertex and pixel shaders that will be used to render this triangle.
|
||||
deviceContext->VSSetShader(m_vertexShader, nullptr, 0);
|
||||
deviceContext->PSSetShader(m_pixelShader, nullptr, 0);
|
||||
|
||||
// Set the sampler state in the pixel shader.
|
||||
deviceContext->PSSetSamplers(0, 1, &m_sampleState);
|
||||
|
||||
// Render the triangle.
|
||||
deviceContext->DrawIndexed(indexCount, 0, 0);
|
||||
}
|
@@ -1,68 +0,0 @@
|
||||
#ifndef _CELSHADINGSHADER_H_
|
||||
#define _CELSHADINGSHADER_H_
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: CelShadingShader
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class CelShadingShader
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct LightBufferType
|
||||
{
|
||||
XMFLOAT4 diffuseColor;
|
||||
XMFLOAT3 lightDirection;
|
||||
float padding; // Padding to ensure the structure is a multiple of 16 bytes.
|
||||
XMFLOAT3 lightPosition; // Add light position
|
||||
float padding2; // Padding to ensure the structure is a multiple of 16 bytes.
|
||||
float constantAttenuation;
|
||||
float linearAttenuation;
|
||||
float quadraticAttenuation;
|
||||
float padding3; // Padding to ensure the structure is a multiple of 16 bytes.
|
||||
};
|
||||
|
||||
|
||||
public:
|
||||
CelShadingShader();
|
||||
CelShadingShader(const CelShadingShader&);
|
||||
~CelShadingShader();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4, XMFLOAT3);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4, XMFLOAT3);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_lightBuffer;
|
||||
};
|
||||
|
||||
#endif
|
1
enginecustom/DemoScene_V10.1.2.ker
Normal file
@@ -0,0 +1 @@
|
||||
1 isosphere 0 10 0 0 -0 0 1 1 1 Content/Assets/Kobject/isosphere.obj ALPHA_MAPPING 1 Unknown 1 0 2 assets/Texture/Bricks2K.png F:\Github_Repo\khaotic-engine-Reborn\enginecustom\assets\Texture\moss01.png 1 assets/Texture/BricksNRM2K.png 1 assets/Texture/BricksGLOSS2K.png 1 F:\Github_Repo\khaotic-engine-Reborn\enginecustom\assets\Texture\alpha01.png
|
1
enginecustom/DemoScene_V10.8.1.ker
Normal file
@@ -0,0 +1 @@
|
||||
0 vaisseautri 0 50 0 0 -0 0 1 1 1 Content/Assets/Kobject/vaisseautri.obj CEL_SHADING 1 Unknown 1 0 1 F:\Github_Repo\khaotic-engine-Reborn\enginecustom\assets\Texture\marble01.png 1 assets/Texture/BricksNRM2K.png 1 assets/Texture/BricksGLOSS2K.png 0
|
@@ -1,84 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Filename: light.ps
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////
|
||||
// DEFINES //
|
||||
/////////////
|
||||
#define NUM_LIGHTS 4
|
||||
|
||||
/////////////
|
||||
// GLOBALS //
|
||||
/////////////
|
||||
Texture2D shaderTexture : register(t0);
|
||||
SamplerState SampleType : register(s0);
|
||||
cbuffer LightBuffer
|
||||
{
|
||||
float4 ambientColor;
|
||||
float3 lightDirection;
|
||||
float padding;
|
||||
float specularPower;
|
||||
float4 specularColor;
|
||||
};
|
||||
|
||||
cbuffer LightColorBuffer
|
||||
{
|
||||
float4 diffuseColor[NUM_LIGHTS];
|
||||
};
|
||||
|
||||
|
||||
//////////////
|
||||
// TYPEDEFS //
|
||||
//////////////
|
||||
struct PixelInputType
|
||||
{
|
||||
float4 position : SV_POSITION;
|
||||
float2 tex : TEXCOORD0;
|
||||
float3 normal : NORMAL;
|
||||
float3 lightPos[NUM_LIGHTS] : TEXCOORD1;
|
||||
};
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Pixel Shader
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
float4 LightPixelShader(PixelInputType input) : SV_TARGET
|
||||
{
|
||||
float4 textureColor;
|
||||
float3 lightDir;
|
||||
float4 color;
|
||||
float3 reflection;
|
||||
float4 specular;
|
||||
float lightIntensity[NUM_LIGHTS];
|
||||
float4 colorArray[NUM_LIGHTS];
|
||||
float4 colorSum;
|
||||
int i;
|
||||
|
||||
// Sample the pixel color from the texture using the sampler at this texture coordinate location.
|
||||
textureColor = shaderTexture.Sample(SampleType, input.tex);
|
||||
|
||||
for(i=0; i<NUM_LIGHTS; i++)
|
||||
{
|
||||
// Calculate the different amounts of light on this pixel based on the positions of the lights.
|
||||
lightIntensity[i] = saturate(dot(input.normal, input.lightPos[i]));
|
||||
|
||||
// Determine the diffuse color amount of each of the four lights.
|
||||
colorArray[i] = diffuseColor[i] * lightIntensity[i];
|
||||
}
|
||||
|
||||
// Initialize the sum of colors.
|
||||
colorSum = float4(0.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
// Add all of the light colors up.
|
||||
for(i=0; i<NUM_LIGHTS; i++)
|
||||
{
|
||||
colorSum.r += colorArray[i].r;
|
||||
colorSum.g += colorArray[i].g;
|
||||
colorSum.b += colorArray[i].b;
|
||||
}
|
||||
|
||||
// Multiply the texture pixel by the combination of all four light colors to get the final result.
|
||||
color = saturate(colorSum) * textureColor;
|
||||
|
||||
return color;
|
||||
}
|
@@ -1,91 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Filename: lightclass.cpp
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#include "lightclass.h"
|
||||
|
||||
|
||||
LightClass::LightClass()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
LightClass::LightClass(const LightClass& other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
LightClass::~LightClass()
|
||||
{
|
||||
}
|
||||
|
||||
void LightClass::SetAmbientColor(float red, float green, float blue, float alpha)
|
||||
{
|
||||
m_ambientColor = XMFLOAT4(red, green, blue, alpha);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LightClass::SetDiffuseColor(float red, float green, float blue, float alpha)
|
||||
{
|
||||
m_diffuseColor = XMFLOAT4(red, green, blue, alpha);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void LightClass::SetDirection(float x, float y, float z)
|
||||
{
|
||||
m_direction = XMFLOAT3(x, y, z);
|
||||
return;
|
||||
}
|
||||
|
||||
void LightClass::SetSpecularColor(float red, float green, float blue, float alpha)
|
||||
{
|
||||
m_specularColor = XMFLOAT4(red, green, blue, alpha);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void LightClass::SetSpecularPower(float power)
|
||||
{
|
||||
m_specularPower = power;
|
||||
return;
|
||||
}
|
||||
|
||||
void LightClass::SetPosition(float x, float y, float z)
|
||||
{
|
||||
m_position = XMFLOAT4(x, y, z, 1.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
XMFLOAT4 LightClass::GetAmbientColor()
|
||||
{
|
||||
return m_ambientColor;
|
||||
}
|
||||
|
||||
|
||||
XMFLOAT4 LightClass::GetDiffuseColor()
|
||||
{
|
||||
return m_diffuseColor;
|
||||
}
|
||||
|
||||
XMFLOAT3 LightClass::GetDirection()
|
||||
{
|
||||
return m_direction;
|
||||
}
|
||||
|
||||
XMFLOAT4 LightClass::GetSpecularColor()
|
||||
{
|
||||
return m_specularColor;
|
||||
}
|
||||
|
||||
|
||||
float LightClass::GetSpecularPower()
|
||||
{
|
||||
return m_specularPower;
|
||||
}
|
||||
|
||||
XMFLOAT4 LightClass::GetPosition()
|
||||
{
|
||||
return m_position;
|
||||
}
|
@@ -1,544 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Filename: lightshaderclass.cpp
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#include "lightshaderclass.h"
|
||||
|
||||
|
||||
LightShaderClass::LightShaderClass()
|
||||
{
|
||||
m_vertexShader = 0;
|
||||
m_pixelShader = 0;
|
||||
m_layout = 0;
|
||||
m_sampleState = 0;
|
||||
m_matrixBuffer = 0;
|
||||
m_cameraBuffer = 0;
|
||||
m_lightBuffer = 0;
|
||||
m_lightColorBuffer = 0;
|
||||
m_lightPositionBuffer = 0;
|
||||
}
|
||||
|
||||
|
||||
LightShaderClass::LightShaderClass(const LightShaderClass& other)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
LightShaderClass::~LightShaderClass()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool LightShaderClass::Initialize(ID3D11Device* device, HWND hwnd)
|
||||
{
|
||||
Logger::Get().Log("Initializing LightShaderClass", __FILE__, __LINE__, Logger::LogLevel::Initialize);
|
||||
|
||||
wchar_t vsFilename[128];
|
||||
wchar_t psFilename[128];
|
||||
int error;
|
||||
bool result;
|
||||
|
||||
// Set the filename of the vertex shader.
|
||||
error = wcscpy_s(vsFilename, 128, L"light.vs");
|
||||
if (error != 0)
|
||||
{
|
||||
Logger::Get().Log("Failed to copy string", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the filename of the pixel shader.
|
||||
error = wcscpy_s(psFilename, 128, L"light.ps");
|
||||
if (error != 0)
|
||||
{
|
||||
Logger::Get().Log("Failed to copy string", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
// Initialize the vertex and pixel shaders.
|
||||
result = InitializeShader(device, hwnd, vsFilename, psFilename);
|
||||
if (!result)
|
||||
{
|
||||
Logger::Get().Log("Failed to initialize shader", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
Logger::Get().Log("LightShaderClass initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void LightShaderClass::Shutdown()
|
||||
{
|
||||
// Shutdown the vertex and pixel shaders as well as the related objects.
|
||||
ShutdownShader();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
bool LightShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
|
||||
ID3D11ShaderResourceView* texture, XMFLOAT4 diffuseColor[], XMFLOAT4 lightPosition[], XMFLOAT4 ambientClor[])
|
||||
{
|
||||
bool result;
|
||||
|
||||
|
||||
// Set the shader parameters that it will use for rendering.
|
||||
result = SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix, texture, diffuseColor, lightPosition, ambientClor);
|
||||
if(!result)
|
||||
{
|
||||
Logger::Get().Log("Failed to set shader parameters", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Now render the prepared buffers with the shader.
|
||||
RenderShader(deviceContext, indexCount);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool LightShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* vsFilename, WCHAR* psFilename)
|
||||
{
|
||||
Logger::Get().Log("Initializing shader", __FILE__, __LINE__, Logger::LogLevel::Initialize);
|
||||
|
||||
HRESULT result;
|
||||
ID3D10Blob* errorMessage;
|
||||
ID3D10Blob* vertexShaderBuffer;
|
||||
ID3D10Blob* pixelShaderBuffer;
|
||||
D3D11_INPUT_ELEMENT_DESC polygonLayout[3];
|
||||
unsigned int numElements;
|
||||
D3D11_SAMPLER_DESC samplerDesc;
|
||||
D3D11_BUFFER_DESC matrixBufferDesc;
|
||||
D3D11_BUFFER_DESC cameraBufferDesc;
|
||||
D3D11_BUFFER_DESC lightColorBufferDesc;
|
||||
D3D11_BUFFER_DESC lightPositionBufferDesc;
|
||||
|
||||
|
||||
// Initialize the pointers this function will use to null.
|
||||
errorMessage = 0;
|
||||
vertexShaderBuffer = 0;
|
||||
pixelShaderBuffer = 0;
|
||||
|
||||
// Compile the vertex shader code.
|
||||
result = D3DCompileFromFile(vsFilename, NULL, NULL, "LightVertexShader", "vs_5_0", D3D10_SHADER_ENABLE_STRICTNESS, 0, &vertexShaderBuffer, &errorMessage);
|
||||
if (FAILED(result))
|
||||
{
|
||||
// If the shader failed to compile it should have writen something to the error message.
|
||||
if (errorMessage)
|
||||
{
|
||||
OutputShaderErrorMessage(errorMessage, hwnd, vsFilename);
|
||||
}
|
||||
// If there was nothing in the error message then it simply could not find the shader file itself.
|
||||
else
|
||||
{
|
||||
Logger::Get().Log("Failed to compile shader", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Compile the pixel shader code.
|
||||
result = D3DCompileFromFile(psFilename, NULL, NULL, "LightPixelShader", "ps_5_0", D3D10_SHADER_ENABLE_STRICTNESS, 0, &pixelShaderBuffer, &errorMessage);
|
||||
if (FAILED(result))
|
||||
{
|
||||
// If the shader failed to compile it should have writen something to the error message.
|
||||
if (errorMessage)
|
||||
{
|
||||
OutputShaderErrorMessage(errorMessage, hwnd, psFilename);
|
||||
}
|
||||
// If there was nothing in the error message then it simply could not find the file itself.
|
||||
else
|
||||
{
|
||||
Logger::Get().Log("Failed to compile shader", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create the vertex shader from the buffer.
|
||||
result = device->CreateVertexShader(vertexShaderBuffer->GetBufferPointer(), vertexShaderBuffer->GetBufferSize(), NULL, &m_vertexShader);
|
||||
if (FAILED(result))
|
||||
{
|
||||
Logger::Get().Log("Failed to create vertex shader", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create the pixel shader from the buffer.
|
||||
result = device->CreatePixelShader(pixelShaderBuffer->GetBufferPointer(), pixelShaderBuffer->GetBufferSize(), NULL, &m_pixelShader);
|
||||
if (FAILED(result))
|
||||
{
|
||||
Logger::Get().Log("Failed to create pixel shader", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create the vertex input layout description.
|
||||
// This setup needs to match the VertexType stucture in the ModelClass and in the shader.
|
||||
polygonLayout[0].SemanticName = "POSITION";
|
||||
polygonLayout[0].SemanticIndex = 0;
|
||||
polygonLayout[0].Format = DXGI_FORMAT_R32G32B32_FLOAT;
|
||||
polygonLayout[0].InputSlot = 0;
|
||||
polygonLayout[0].AlignedByteOffset = 0;
|
||||
polygonLayout[0].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
|
||||
polygonLayout[0].InstanceDataStepRate = 0;
|
||||
|
||||
polygonLayout[1].SemanticName = "TEXCOORD";
|
||||
polygonLayout[1].SemanticIndex = 0;
|
||||
polygonLayout[1].Format = DXGI_FORMAT_R32G32_FLOAT;
|
||||
polygonLayout[1].InputSlot = 0;
|
||||
polygonLayout[1].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
|
||||
polygonLayout[1].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
|
||||
polygonLayout[1].InstanceDataStepRate = 0;
|
||||
|
||||
polygonLayout[2].SemanticName = "NORMAL";
|
||||
polygonLayout[2].SemanticIndex = 0;
|
||||
polygonLayout[2].Format = DXGI_FORMAT_R32G32B32_FLOAT;
|
||||
polygonLayout[2].InputSlot = 0;
|
||||
polygonLayout[2].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT;
|
||||
polygonLayout[2].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA;
|
||||
polygonLayout[2].InstanceDataStepRate = 0;
|
||||
|
||||
// Get a count of the elements in the layout.
|
||||
numElements = sizeof(polygonLayout) / sizeof(polygonLayout[0]);
|
||||
|
||||
// Create the vertex input layout.
|
||||
result = device->CreateInputLayout(polygonLayout, numElements, vertexShaderBuffer->GetBufferPointer(), vertexShaderBuffer->GetBufferSize(),
|
||||
&m_layout);
|
||||
if (FAILED(result))
|
||||
{
|
||||
Logger::Get().Log("Failed to create input layout", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Release the vertex shader buffer and pixel shader buffer since they are no longer needed.
|
||||
vertexShaderBuffer->Release();
|
||||
vertexShaderBuffer = 0;
|
||||
|
||||
pixelShaderBuffer->Release();
|
||||
pixelShaderBuffer = 0;
|
||||
|
||||
// Create a texture sampler state description.
|
||||
samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
|
||||
samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
|
||||
samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
|
||||
samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
|
||||
samplerDesc.MipLODBias = 0.0f;
|
||||
samplerDesc.MaxAnisotropy = 1;
|
||||
samplerDesc.ComparisonFunc = D3D11_COMPARISON_ALWAYS;
|
||||
samplerDesc.BorderColor[0] = 0;
|
||||
samplerDesc.BorderColor[1] = 0;
|
||||
samplerDesc.BorderColor[2] = 0;
|
||||
samplerDesc.BorderColor[3] = 0;
|
||||
samplerDesc.MinLOD = 0;
|
||||
samplerDesc.MaxLOD = D3D11_FLOAT32_MAX;
|
||||
|
||||
// Create the texture sampler state.
|
||||
result = device->CreateSamplerState(&samplerDesc, &m_sampleState);
|
||||
if (FAILED(result))
|
||||
{
|
||||
Logger::Get().Log("Failed to create sampler state", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Setup the description of the dynamic matrix constant buffer that is in the vertex shader.
|
||||
matrixBufferDesc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
matrixBufferDesc.ByteWidth = sizeof(MatrixBufferType);
|
||||
matrixBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
|
||||
matrixBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
matrixBufferDesc.MiscFlags = 0;
|
||||
matrixBufferDesc.StructureByteStride = 0;
|
||||
|
||||
// Create the constant buffer pointer so we can access the vertex shader constant buffer from within this class.
|
||||
result = device->CreateBuffer(&matrixBufferDesc, NULL, &m_matrixBuffer);
|
||||
if (FAILED(result))
|
||||
{
|
||||
Logger::Get().Log("Failed to create matrix buffer", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Setup the description of the camera dynamic constant buffer that is in the vertex shader.
|
||||
cameraBufferDesc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
cameraBufferDesc.ByteWidth = sizeof(CameraBufferType);
|
||||
cameraBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
|
||||
cameraBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
cameraBufferDesc.MiscFlags = 0;
|
||||
cameraBufferDesc.StructureByteStride = 0;
|
||||
|
||||
// Create the camera constant buffer pointer so we can access the vertex shader constant buffer from within this class.
|
||||
result = device->CreateBuffer(&cameraBufferDesc, NULL, &m_cameraBuffer);
|
||||
if (FAILED(result))
|
||||
{
|
||||
Logger::Get().Log("Failed to create camera buffer", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Setup the description of the dynamic constant buffer that is in the pixel shader.
|
||||
lightColorBufferDesc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
lightColorBufferDesc.ByteWidth = sizeof(LightColorBufferType);
|
||||
lightColorBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
|
||||
lightColorBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
lightColorBufferDesc.MiscFlags = 0;
|
||||
lightColorBufferDesc.StructureByteStride = 0;
|
||||
|
||||
// Create the constant buffer pointer so we can access the pixel shader constant buffer from within this class.
|
||||
result = device->CreateBuffer(&lightColorBufferDesc, NULL, &m_lightColorBuffer);
|
||||
if (FAILED(result))
|
||||
{
|
||||
Logger::Get().Log("Failed to create light color buffer", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Setup the description of the dynamic constant buffer that is in the vertex shader.
|
||||
lightPositionBufferDesc.Usage = D3D11_USAGE_DYNAMIC;
|
||||
lightPositionBufferDesc.ByteWidth = sizeof(LightPositionBufferType);
|
||||
lightPositionBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
|
||||
lightPositionBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
|
||||
lightPositionBufferDesc.MiscFlags = 0;
|
||||
lightPositionBufferDesc.StructureByteStride = 0;
|
||||
|
||||
// Create the constant buffer pointer so we can access the vertex shader constant buffer from within this class.
|
||||
result = device->CreateBuffer(&lightPositionBufferDesc, NULL, &m_lightPositionBuffer);
|
||||
if (FAILED(result))
|
||||
{
|
||||
Logger::Get().Log("Failed to create light position buffer", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
Logger::Get().Log("Shader initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void LightShaderClass::ShutdownShader()
|
||||
{
|
||||
Logger::Get().Log("Shutting down LightShaderClass", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
|
||||
|
||||
// Release the light constant buffers.
|
||||
if (m_lightColorBuffer)
|
||||
{
|
||||
m_lightColorBuffer->Release();
|
||||
m_lightColorBuffer = 0;
|
||||
}
|
||||
|
||||
if (m_lightPositionBuffer)
|
||||
{
|
||||
m_lightPositionBuffer->Release();
|
||||
m_lightPositionBuffer = 0;
|
||||
}
|
||||
|
||||
// Release the light constant buffer.
|
||||
if (m_lightBuffer)
|
||||
{
|
||||
m_lightBuffer->Release();
|
||||
m_lightBuffer = 0;
|
||||
}
|
||||
|
||||
// Release the camera constant buffer.
|
||||
if (m_cameraBuffer)
|
||||
{
|
||||
m_cameraBuffer->Release();
|
||||
m_cameraBuffer = 0;
|
||||
}
|
||||
|
||||
// Release the matrix constant buffer.
|
||||
if (m_matrixBuffer)
|
||||
{
|
||||
m_matrixBuffer->Release();
|
||||
m_matrixBuffer = 0;
|
||||
}
|
||||
|
||||
// Release the sampler state.
|
||||
if (m_sampleState)
|
||||
{
|
||||
m_sampleState->Release();
|
||||
m_sampleState = 0;
|
||||
}
|
||||
|
||||
// Release the layout.
|
||||
if (m_layout)
|
||||
{
|
||||
m_layout->Release();
|
||||
m_layout = 0;
|
||||
}
|
||||
|
||||
// Release the pixel shader.
|
||||
if (m_pixelShader)
|
||||
{
|
||||
m_pixelShader->Release();
|
||||
m_pixelShader = 0;
|
||||
}
|
||||
|
||||
// Release the vertex shader.
|
||||
if (m_vertexShader)
|
||||
{
|
||||
m_vertexShader->Release();
|
||||
m_vertexShader = 0;
|
||||
}
|
||||
|
||||
Logger::Get().Log("LightShaderClass shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void LightShaderClass::OutputShaderErrorMessage(ID3D10Blob* errorMessage, HWND hwnd, WCHAR* shaderFilename)
|
||||
{
|
||||
char* compileErrors;
|
||||
unsigned __int64 bufferSize, i;
|
||||
ofstream fout;
|
||||
|
||||
|
||||
// Get a pointer to the error message text buffer.
|
||||
compileErrors = (char*)(errorMessage->GetBufferPointer());
|
||||
|
||||
// Get the length of the message.
|
||||
bufferSize = errorMessage->GetBufferSize();
|
||||
|
||||
// Open a file to write the error message to.
|
||||
fout.open("shader-error.txt");
|
||||
|
||||
// Write out the error message.
|
||||
for (i = 0; i < bufferSize; i++)
|
||||
{
|
||||
fout << compileErrors[i];
|
||||
}
|
||||
|
||||
// Close the file.
|
||||
fout.close();
|
||||
|
||||
// Release the error message.
|
||||
errorMessage->Release();
|
||||
errorMessage = 0;
|
||||
|
||||
// Pop a message up on the screen to notify the user to check the text file for compile errors.
|
||||
MessageBox(hwnd, L"Error compiling shader. Check shader-error.txt for message.", shaderFilename, MB_OK);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
bool LightShaderClass::SetShaderParameters(ID3D11DeviceContext* deviceContext, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
|
||||
ID3D11ShaderResourceView* texture, XMFLOAT4 diffuseColor[], XMFLOAT4 lightPosition[], XMFLOAT4 ambientColor[])
|
||||
{
|
||||
HRESULT result;
|
||||
D3D11_MAPPED_SUBRESOURCE mappedResource;
|
||||
unsigned int bufferNumber;
|
||||
MatrixBufferType* dataPtr;
|
||||
LightPositionBufferType* dataPtr2;
|
||||
LightColorBufferType* dataPtr3;
|
||||
|
||||
// Transpose the matrices to prepare them for the shader.
|
||||
worldMatrix = XMMatrixTranspose(worldMatrix);
|
||||
viewMatrix = XMMatrixTranspose(viewMatrix);
|
||||
projectionMatrix = XMMatrixTranspose(projectionMatrix);
|
||||
|
||||
// Lock the constant buffer so it can be written to.
|
||||
result = deviceContext->Map(m_matrixBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
|
||||
if (FAILED(result))
|
||||
{
|
||||
Logger::Get().Log("Failed to map matrix buffer", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get a pointer to the data in the constant buffer.
|
||||
dataPtr = (MatrixBufferType*)mappedResource.pData;
|
||||
|
||||
// Copy the matrices into the constant buffer.
|
||||
dataPtr->world = worldMatrix;
|
||||
dataPtr->view = viewMatrix;
|
||||
dataPtr->projection = projectionMatrix;
|
||||
|
||||
// Unlock the constant buffer.
|
||||
deviceContext->Unmap(m_matrixBuffer, 0);
|
||||
|
||||
// Set the position of the constant buffer in the vertex shader.
|
||||
bufferNumber = 0;
|
||||
|
||||
// Now set the constant buffer in the vertex shader with the updated values.
|
||||
deviceContext->VSSetConstantBuffers(bufferNumber, 1, &m_matrixBuffer);
|
||||
|
||||
// Lock the camera constant buffer so it can be written to.
|
||||
result = deviceContext->Map(m_cameraBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
|
||||
if (FAILED(result))
|
||||
{
|
||||
Logger::Get().Log("Failed to map camera buffer", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Lock the light position constant buffer so it can be written to.
|
||||
result = deviceContext->Map(m_lightPositionBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
|
||||
if (FAILED(result))
|
||||
{
|
||||
Logger::Get().Log("Failed to map light position buffer", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get a pointer to the data in the constant buffer.
|
||||
dataPtr2 = (LightPositionBufferType*)mappedResource.pData;
|
||||
|
||||
// Copy the light position variables into the constant buffer.
|
||||
for (int i = 0; i < NUM_LIGHTS; i++)
|
||||
{
|
||||
dataPtr2->lightPosition[i] = lightPosition[i];
|
||||
}
|
||||
|
||||
// Unlock the constant buffer.
|
||||
deviceContext->Unmap(m_lightPositionBuffer, 0);
|
||||
|
||||
// Set the position of the constant buffer in the vertex shader.
|
||||
bufferNumber = 1;
|
||||
|
||||
// Finally set the constant buffer in the vertex shader with the updated values.
|
||||
deviceContext->VSSetConstantBuffers(bufferNumber, 1, &m_lightPositionBuffer);
|
||||
|
||||
// Set shader texture resource in the pixel shader.
|
||||
deviceContext->PSSetShaderResources(0, 1, &texture);
|
||||
|
||||
// Lock the light color constant buffer so it can be written to.
|
||||
result = deviceContext->Map(m_lightColorBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
|
||||
if (FAILED(result))
|
||||
{
|
||||
Logger::Get().Log("Failed to map light color buffer", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get a pointer to the data in the constant buffer.
|
||||
dataPtr3 = (LightColorBufferType*)mappedResource.pData;
|
||||
|
||||
// Copy the light color variables into the constant buffer.
|
||||
for (int i = 0; i < NUM_LIGHTS; i++)
|
||||
{
|
||||
dataPtr3->diffuseColor[i] = diffuseColor[i];
|
||||
}
|
||||
|
||||
// Unlock the constant buffer.
|
||||
deviceContext->Unmap(m_lightColorBuffer, 0);
|
||||
|
||||
// Set the position of the constant buffer in the pixel shader.
|
||||
bufferNumber = 0;
|
||||
|
||||
// Finally set the constant buffer in the pixel shader with the updated values.
|
||||
deviceContext->PSSetConstantBuffers(bufferNumber, 1, &m_lightColorBuffer);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void LightShaderClass::RenderShader(ID3D11DeviceContext* deviceContext, int indexCount)
|
||||
{
|
||||
// Set the vertex input layout.
|
||||
deviceContext->IASetInputLayout(m_layout);
|
||||
|
||||
// Set the vertex and pixel shaders that will be used to render this triangle.
|
||||
deviceContext->VSSetShader(m_vertexShader, NULL, 0);
|
||||
deviceContext->PSSetShader(m_pixelShader, NULL, 0);
|
||||
|
||||
// Set the sampler state in the pixel shader.
|
||||
deviceContext->PSSetSamplers(0, 1, &m_sampleState);
|
||||
|
||||
// Render the triangle.
|
||||
deviceContext->DrawIndexed(indexCount, 0, 0);
|
||||
|
||||
return;
|
||||
}
|
@@ -1,92 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Filename: lightshaderclass.h
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _LIGHTSHADERCLASS_H_
|
||||
#define _LIGHTSHADERCLASS_H_
|
||||
|
||||
|
||||
/////////////
|
||||
// GLOBALS //
|
||||
/////////////
|
||||
const int NUM_LIGHTS = 4;
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: LightShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class LightShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct CameraBufferType
|
||||
{
|
||||
XMFLOAT3 cameraPosition;
|
||||
float padding;
|
||||
};
|
||||
|
||||
struct LightBufferType
|
||||
{
|
||||
XMFLOAT4 ambientColor;
|
||||
XMFLOAT4 diffuseColor;
|
||||
XMFLOAT3 lightDirection;
|
||||
float padding; // Added extra padding so structure is a multiple of 16 for CreateBuffer function requirements.
|
||||
float specularPower;
|
||||
XMFLOAT4 specularColor;
|
||||
};
|
||||
|
||||
struct LightColorBufferType
|
||||
{
|
||||
XMFLOAT4 diffuseColor[NUM_LIGHTS];
|
||||
};
|
||||
|
||||
struct LightPositionBufferType
|
||||
{
|
||||
XMFLOAT4 lightPosition[NUM_LIGHTS];
|
||||
};
|
||||
|
||||
public:
|
||||
LightShaderClass();
|
||||
LightShaderClass(const LightShaderClass&);
|
||||
~LightShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[]);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[]);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11Buffer* m_cameraBuffer;
|
||||
ID3D11Buffer* m_lightBuffer;
|
||||
ID3D11Buffer* m_lightColorBuffer;
|
||||
ID3D11Buffer* m_lightPositionBuffer;
|
||||
};
|
||||
|
||||
#endif
|
@@ -1,26 +0,0 @@
|
||||
#include "systemclass.h"
|
||||
|
||||
|
||||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, int iCmdshow)
|
||||
{
|
||||
SystemClass* System;
|
||||
bool result;
|
||||
|
||||
// Create the system object.
|
||||
System = new SystemClass;
|
||||
|
||||
// Initialize and run the system object.
|
||||
result = System->Initialize();
|
||||
if (result)
|
||||
{
|
||||
Logger::Get().Log("System initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize);
|
||||
System->Run();
|
||||
}
|
||||
|
||||
// Shutdown and release the system object.
|
||||
System->Shutdown();
|
||||
delete System;
|
||||
System = 0;
|
||||
|
||||
return 0;
|
||||
}
|
@@ -1,59 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Filename: multitextureshaderclass.h
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _MULTITEXTURESHADERCLASS_H_
|
||||
#define _MULTITEXTURESHADERCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: MultiTextureShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class MultiTextureShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
public:
|
||||
MultiTextureShaderClass();
|
||||
MultiTextureShaderClass(const MultiTextureShaderClass&);
|
||||
~MultiTextureShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
8
enginecustom/TODO.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
- Scene Manager :
|
||||
|
||||
TODO : Save and Load Scene
|
||||
|
||||
- ImguiManager :
|
||||
|
||||
TODO : Add Save and Load Scene Button in the bar menu
|
||||
TODO : Add a preview of the game in a new window
|
Before Width: | Height: | Size: 1.0 MiB |
@@ -1,55 +0,0 @@
|
||||
#ifndef _ALPHAMAPSHADERCLASS_H_
|
||||
#define _ALPHAMAPSHADERCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: AlphaMapShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class AlphaMapShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
public:
|
||||
AlphaMapShaderClass();
|
||||
AlphaMapShaderClass(const AlphaMapShaderClass&);
|
||||
~AlphaMapShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
};
|
||||
|
||||
#endif
|
@@ -1,183 +0,0 @@
|
||||
#ifndef _APPLICATIONCLASS_H_
|
||||
#define _APPLICATIONCLASS_H_
|
||||
|
||||
|
||||
///////////////////////
|
||||
// MY CLASS INCLUDES //
|
||||
///////////////////////
|
||||
#include "d3dclass.h"
|
||||
#include "cameraclass.h"
|
||||
#include "object.h"
|
||||
#include "lightclass.h"
|
||||
#include <vector>
|
||||
#include <filesystem>
|
||||
|
||||
#include "bitmapclass.h"
|
||||
#include "spriteclass.h"
|
||||
#include "timerclass.h"
|
||||
#include "fontshaderclass.h"
|
||||
#include "fontclass.h"
|
||||
#include "textclass.h"
|
||||
#include "fpsclass.h"
|
||||
#include "inputclass.h"
|
||||
#include "shadermanagerclass.h"
|
||||
#include "modellistclass.h"
|
||||
#include "positionclass.h"
|
||||
#include "frustumclass.h"
|
||||
#include "rendertextureclass.h"
|
||||
#include "displayplaneclass.h"
|
||||
#include "translateshaderclass.h"
|
||||
#include "reflectionshaderclass.h"
|
||||
#include "physics.h"
|
||||
|
||||
|
||||
/////////////
|
||||
// GLOBALS //
|
||||
/////////////
|
||||
const bool FULL_SCREEN = false;
|
||||
const bool VSYNC_ENABLED = true;
|
||||
const float SCREEN_DEPTH = 1000.0f;
|
||||
const float SCREEN_NEAR = 0.3f;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: ApplicationClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class ApplicationClass
|
||||
{
|
||||
public:
|
||||
ApplicationClass();
|
||||
ApplicationClass(const ApplicationClass&);
|
||||
~ApplicationClass();
|
||||
D3DClass* GetDirect3D();
|
||||
|
||||
bool Initialize(int, int, HWND);
|
||||
void Shutdown();
|
||||
bool Frame(InputClass*);
|
||||
|
||||
int GetScreenWidth() const;
|
||||
int GetScreenHeight() const;
|
||||
|
||||
float GetSpeed() const { return m_speed; };
|
||||
void SetSpeed(float speed) { this->m_speed = speed; };
|
||||
|
||||
void AddCube();
|
||||
void DeleteKobject(int index);
|
||||
size_t GetCubeCount() const { return m_cubes.size(); };
|
||||
size_t GetTerrainCubeCount() const { return m_terrainChunk.size(); };
|
||||
std::vector<Object*> GetCubes() const { return m_cubes; };
|
||||
std::vector<Object*> GetTerrainCubes() const { return m_terrainChunk; };
|
||||
std::vector<Object*> GetKobjects() const { return m_object; };
|
||||
void AddKobject(WCHAR* filepath);
|
||||
|
||||
void GenerateTerrain();
|
||||
void DeleteTerrain();
|
||||
|
||||
XMVECTOR GetLightPosition(int index);
|
||||
XMVECTOR GetLightColor(int index);
|
||||
void SetLightPosition(int index, XMVECTOR color);
|
||||
void SetLightColor(int index, XMVECTOR color);
|
||||
void DeleteLight(int index);
|
||||
void AddLight();
|
||||
std::vector<LightClass*> GetLights() const { return m_Lights; };
|
||||
bool GetShouldQuit() const { return m_ShouldQuit; };
|
||||
void SetShouldQuit(bool shouldQuit) { m_ShouldQuit = shouldQuit; };
|
||||
|
||||
void SetCelShading(bool enable) { m_enableCelShading = enable; };
|
||||
|
||||
private:
|
||||
bool Render(float, float, float, float, float);
|
||||
bool UpdateMouseStrings(int, int, bool);
|
||||
bool UpdateFps();
|
||||
bool UpdateRenderCountString(int);
|
||||
bool RenderSceneToTexture(float);
|
||||
bool RenderRefractionToTexture();
|
||||
bool RenderReflectionToTexture();
|
||||
|
||||
ID3D11ShaderResourceView* LoadTexture(const std::string* filename);
|
||||
|
||||
private :
|
||||
|
||||
// ------------------------------------- //
|
||||
// ------------- DIRECT3D -------------- //
|
||||
// ------------------------------------- //
|
||||
|
||||
D3DClass* m_Direct3D;
|
||||
IDXGISwapChain* m_swapChain;
|
||||
ModelClass* m_Model,* m_GroundModel, * m_WallModel, * m_BathModel, * m_WaterModel;
|
||||
ModelListClass* m_ModelList;
|
||||
|
||||
// ------------------------------------- //
|
||||
// ------------- RENDERING ------------- //
|
||||
// ------------------------------------- //
|
||||
|
||||
XMMATRIX m_baseViewMatrix;
|
||||
RenderTextureClass* m_RenderTexture, * m_RefractionTexture, * m_ReflectionTexture;
|
||||
DisplayPlaneClass* m_DisplayPlane;
|
||||
int m_screenWidth, m_screenHeight;
|
||||
CameraClass* m_Camera;
|
||||
PositionClass* m_Position;
|
||||
FrustumClass* m_Frustum;
|
||||
|
||||
// ------------------------------------ //
|
||||
// ------------- OBJECTS -------------- //
|
||||
// ------------------------------------ //
|
||||
|
||||
Object* m_SelectedObject;
|
||||
std::vector<Object*> m_cubes;
|
||||
std::vector<Object*> m_terrainChunk;
|
||||
float m_speed = 0.1f; // speed for the demo spinning object
|
||||
std::vector<Object*> m_object;
|
||||
int m_ObjectId = 0;
|
||||
|
||||
// ----------------------------------- //
|
||||
// ------------- LIGHTS -------------- //
|
||||
// ----------------------------------- //
|
||||
|
||||
LightClass* m_Light;
|
||||
std::vector<LightClass*> m_Lights;
|
||||
int m_numLights;
|
||||
|
||||
XMFLOAT3 TrueLightPosition;
|
||||
ModelClass* m_LightModel;
|
||||
|
||||
// ----------------------------------- //
|
||||
// ------------- SHADERS ------------- //
|
||||
// ----------------------------------- //
|
||||
|
||||
ShaderManagerClass* m_ShaderManager;
|
||||
FontShaderClass* m_FontShader;
|
||||
BitmapClass* m_Bitmap;
|
||||
SpriteClass* m_Sprite;
|
||||
|
||||
bool m_enableCelShading;
|
||||
|
||||
// ----------------------------------- //
|
||||
// ------------ VARIABLES ------------ //
|
||||
// ----------------------------------- //
|
||||
|
||||
float m_waterHeight, m_waterTranslation;
|
||||
|
||||
// ------------------------------------------------- //
|
||||
// ------------- FPS AND INFO ON SCREEN ------------ //
|
||||
// ------------------------------------------------- //
|
||||
|
||||
TimerClass* m_Timer;
|
||||
TextClass* m_MouseStrings;
|
||||
TextClass* m_RenderCountString;
|
||||
FontClass* m_Font;
|
||||
FpsClass* m_Fps;
|
||||
TextClass* m_FpsString;
|
||||
int m_previousFps;
|
||||
|
||||
// ------------------------------------------------- //
|
||||
// ------------------- OTHER ----------------------- //
|
||||
// ------------------------------------------------- //
|
||||
|
||||
bool m_ShouldQuit;
|
||||
Physics* m_Physics;
|
||||
float m_gravity;
|
||||
XMVECTOR m_previousPosition;
|
||||
};
|
||||
|
||||
#endif
|
BIN
enginecustom/assets/Model/OBJ/86.obj
(Stored with Git LFS)
Normal file
BIN
enginecustom/assets/Model/OBJ/cone.obj
(Stored with Git LFS)
Normal file
BIN
enginecustom/assets/Model/OBJ/invertcube.obj
(Stored with Git LFS)
Normal file
BIN
enginecustom/assets/Model/OBJ/isosphere.obj
(Stored with Git LFS)
Normal file
BIN
enginecustom/assets/Model/OBJ/monke.obj
(Stored with Git LFS)
Normal file
BIN
enginecustom/assets/Model/OBJ/plane.obj
(Stored with Git LFS)
Normal file
BIN
enginecustom/assets/Model/OBJ/skysphere.obj
(Stored with Git LFS)
Normal file
BIN
enginecustom/assets/Model/OBJ/vaisseau.obj
(Stored with Git LFS)
Normal file
BIN
enginecustom/assets/Model/OBJ/vaisseautri.mtl
(Stored with Git LFS)
Normal file
BIN
enginecustom/assets/Model/OBJ/vaisseautri.obj
(Stored with Git LFS)
Normal file
24
enginecustom/assets/Model/imgui.ini
Normal file
@@ -0,0 +1,24 @@
|
||||
[Window][Debug##Default]
|
||||
Pos=60,60
|
||||
Size=400,400
|
||||
|
||||
[Window][Khaotic Engine]
|
||||
Pos=1120,51
|
||||
Size=392,273
|
||||
|
||||
[Window][Objects]
|
||||
Pos=930,39
|
||||
Size=457,294
|
||||
|
||||
[Window][Terrain]
|
||||
Pos=60,60
|
||||
Size=342,82
|
||||
|
||||
[Window][Light]
|
||||
Pos=1551,17
|
||||
Size=358,535
|
||||
|
||||
[Window][Shader Manager]
|
||||
Pos=30,255
|
||||
Size=172,284
|
||||
|
91
enginecustom/assets/Skybox/imgui.ini
Normal file
@@ -0,0 +1,91 @@
|
||||
[Window][Debug##Default]
|
||||
Pos=60,60
|
||||
Size=400,400
|
||||
Collapsed=0
|
||||
|
||||
[Window][Khaotic Engine]
|
||||
Pos=1180,27
|
||||
Size=396,826
|
||||
Collapsed=0
|
||||
DockId=0x00000005,0
|
||||
|
||||
[Window][Objects]
|
||||
Pos=8,442
|
||||
Size=290,411
|
||||
Collapsed=0
|
||||
DockId=0x0000000A,0
|
||||
|
||||
[Window][Terrain]
|
||||
Pos=8,27
|
||||
Size=290,413
|
||||
Collapsed=0
|
||||
DockId=0x00000009,0
|
||||
|
||||
[Window][Light]
|
||||
Pos=8,27
|
||||
Size=330,487
|
||||
Collapsed=0
|
||||
DockId=0x00000004,1
|
||||
|
||||
[Window][Shader Manager]
|
||||
Pos=8,27
|
||||
Size=330,487
|
||||
Collapsed=0
|
||||
DockId=0x00000004,2
|
||||
|
||||
[Window][Engine Settings]
|
||||
Pos=1180,27
|
||||
Size=396,826
|
||||
Collapsed=0
|
||||
DockId=0x00000005,1
|
||||
|
||||
[Window][DockSpace Demo]
|
||||
Size=1584,861
|
||||
Collapsed=0
|
||||
|
||||
[Window][Render Window]
|
||||
Pos=300,27
|
||||
Size=878,826
|
||||
Collapsed=0
|
||||
DockId=0x00000002,0
|
||||
|
||||
[Window][DockSpace]
|
||||
Pos=0,0
|
||||
Size=1584,861
|
||||
Collapsed=0
|
||||
|
||||
[Window][Add Object]
|
||||
Pos=1188,0
|
||||
Size=396,430
|
||||
Collapsed=0
|
||||
|
||||
[Window][Log]
|
||||
Pos=8,518
|
||||
Size=1568,335
|
||||
Collapsed=0
|
||||
DockId=0x0000000C,0
|
||||
|
||||
[Window][Log Window]
|
||||
Pos=8,627
|
||||
Size=1568,226
|
||||
Collapsed=0
|
||||
DockId=0x0000000E,0
|
||||
|
||||
[Docking][Data]
|
||||
DockSpace ID=0xC0DFADC4 Pos=8,27 Size=1568,826 Split=X
|
||||
DockNode ID=0x00000001 Parent=0xC0DFADC4 SizeRef=330,1094 Split=Y Selected=0x393905AB
|
||||
DockNode ID=0x00000004 Parent=0x00000001 SizeRef=330,487 Selected=0x393905AB
|
||||
DockNode ID=0x00000006 Parent=0x00000001 SizeRef=330,485 Selected=0x031DC75C
|
||||
DockNode ID=0x00000003 Parent=0xC0DFADC4 SizeRef=1700,1094 CentralNode=1
|
||||
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=8,27 Size=1568,826 Split=Y
|
||||
DockNode ID=0x0000000D Parent=0xCCBD8CF7 SizeRef=1568,598 Split=Y
|
||||
DockNode ID=0x0000000B Parent=0x0000000D SizeRef=1568,637 Split=X
|
||||
DockNode ID=0x00000007 Parent=0x0000000B SizeRef=290,826 Split=Y Selected=0x393905AB
|
||||
DockNode ID=0x00000009 Parent=0x00000007 SizeRef=395,413 Selected=0x393905AB
|
||||
DockNode ID=0x0000000A Parent=0x00000007 SizeRef=395,411 Selected=0x031DC75C
|
||||
DockNode ID=0x00000008 Parent=0x0000000B SizeRef=1276,826 Split=X
|
||||
DockNode ID=0x00000002 Parent=0x00000008 SizeRef=878,826 CentralNode=1 Selected=0x9204953B
|
||||
DockNode ID=0x00000005 Parent=0x00000008 SizeRef=396,826 Selected=0x9F035453
|
||||
DockNode ID=0x0000000C Parent=0x0000000D SizeRef=1568,335 Selected=0x139FDA3F
|
||||
DockNode ID=0x0000000E Parent=0xCCBD8CF7 SizeRef=1568,226 Selected=0xAB74BEE9
|
||||
|
BIN
enginecustom/assets/Skybox/skybox.png
Normal file
After Width: | Height: | Size: 11 MiB |
BIN
enginecustom/assets/Skybox/skybox_back.png
Normal file
After Width: | Height: | Size: 331 KiB |
BIN
enginecustom/assets/Skybox/skybox_bottom.png
Normal file
After Width: | Height: | Size: 273 KiB |
BIN
enginecustom/assets/Skybox/skybox_front.png
Normal file
After Width: | Height: | Size: 493 KiB |
BIN
enginecustom/assets/Skybox/skybox_left.png
Normal file
After Width: | Height: | Size: 510 KiB |
BIN
enginecustom/assets/Skybox/skybox_right.png
Normal file
After Width: | Height: | Size: 498 KiB |
BIN
enginecustom/assets/Skybox/skybox_top.png
Normal file
After Width: | Height: | Size: 422 KiB |
BIN
enginecustom/assets/Texture/Bricks2K.png
Normal file
After Width: | Height: | Size: 7.5 MiB |
BIN
enginecustom/assets/Texture/BricksGLOSS2K.png
Normal file
After Width: | Height: | Size: 2.1 MiB |
BIN
enginecustom/assets/Texture/BricksNRM2K.png
Normal file
After Width: | Height: | Size: 8.4 MiB |
BIN
enginecustom/assets/Texture/EmptyTexture.png
Normal file
After Width: | Height: | Size: 81 KiB |
BIN
enginecustom/assets/Texture/alpha01.png
Normal file
After Width: | Height: | Size: 128 KiB |
BIN
enginecustom/assets/Texture/dirt01.png
Normal file
After Width: | Height: | Size: 588 KiB |
BIN
enginecustom/assets/Texture/font01.png
Normal file
After Width: | Height: | Size: 3.5 KiB |
BIN
enginecustom/assets/Texture/ground01.png
Normal file
After Width: | Height: | Size: 2.6 MiB |
106
enginecustom/assets/Texture/imgui.ini
Normal file
@@ -0,0 +1,106 @@
|
||||
[Window][Debug##Default]
|
||||
Pos=60,60
|
||||
Size=400,400
|
||||
Collapsed=0
|
||||
|
||||
[Window][Khaotic Engine]
|
||||
Pos=1281,19
|
||||
Size=303,842
|
||||
Collapsed=0
|
||||
DockId=0x0000000F,0
|
||||
|
||||
[Window][Objects]
|
||||
Pos=0,19
|
||||
Size=281,842
|
||||
Collapsed=0
|
||||
DockId=0x00000011,0
|
||||
|
||||
[Window][Terrain]
|
||||
Pos=0,19
|
||||
Size=280,842
|
||||
Collapsed=0
|
||||
DockId=0x00000007,0
|
||||
|
||||
[Window][Light]
|
||||
Pos=0,19
|
||||
Size=281,842
|
||||
Collapsed=0
|
||||
DockId=0x00000012,0
|
||||
|
||||
[Window][Shader Manager]
|
||||
Pos=8,27
|
||||
Size=330,487
|
||||
Collapsed=0
|
||||
DockId=0x00000001,2
|
||||
|
||||
[Window][Engine Settings]
|
||||
Pos=1281,527
|
||||
Size=303,334
|
||||
Collapsed=0
|
||||
DockId=0x00000010,0
|
||||
|
||||
[Window][DockSpace Demo]
|
||||
Size=1584,861
|
||||
Collapsed=0
|
||||
|
||||
[Window][Render Window]
|
||||
Pos=8,27
|
||||
Size=1559,974
|
||||
Collapsed=0
|
||||
DockId=0x00000011,0
|
||||
|
||||
[Window][DockSpace]
|
||||
Pos=0,0
|
||||
Size=1584,861
|
||||
Collapsed=0
|
||||
|
||||
[Window][Add Object]
|
||||
Pos=1188,0
|
||||
Size=396,430
|
||||
Collapsed=0
|
||||
|
||||
[Window][Log]
|
||||
Pos=8,518
|
||||
Size=1568,335
|
||||
Collapsed=0
|
||||
DockId=0x0000000C,0
|
||||
|
||||
[Window][Log Window]
|
||||
Pos=0,636
|
||||
Size=1279,225
|
||||
Collapsed=0
|
||||
DockId=0x00000006,0
|
||||
|
||||
[Window][Render Stats]
|
||||
Pos=0,636
|
||||
Size=1279,225
|
||||
Collapsed=0
|
||||
DockId=0x00000004,0
|
||||
|
||||
[Window][render Window]
|
||||
Pos=16,718
|
||||
Size=997,758
|
||||
Collapsed=1
|
||||
|
||||
[Docking][Data]
|
||||
DockSpace ID=0xC0DFADC4 Pos=8,27 Size=1568,826 Split=X
|
||||
DockNode ID=0x00000001 Parent=0xC0DFADC4 SizeRef=330,1094 Selected=0x393905AB
|
||||
DockNode ID=0x00000003 Parent=0xC0DFADC4 SizeRef=1700,1094 CentralNode=1
|
||||
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,19 Size=1584,842 Split=X
|
||||
DockNode ID=0x00000002 Parent=0xCCBD8CF7 SizeRef=1743,826 Split=Y
|
||||
DockNode ID=0x0000000A Parent=0x00000002 SizeRef=1568,599 Split=X
|
||||
DockNode ID=0x00000009 Parent=0x0000000A SizeRef=281,974 Split=Y Selected=0x031DC75C
|
||||
DockNode ID=0x00000011 Parent=0x00000009 SizeRef=281,441 Selected=0x031DC75C
|
||||
DockNode ID=0x00000012 Parent=0x00000009 SizeRef=281,440 Selected=0x321620B2
|
||||
DockNode ID=0x0000000D Parent=0x0000000A SizeRef=1460,974 Split=Y
|
||||
DockNode ID=0x0000000B Parent=0x0000000D SizeRef=1568,637 Split=X Selected=0x321620B2
|
||||
DockNode ID=0x00000007 Parent=0x0000000B SizeRef=280,883 Selected=0x393905AB
|
||||
DockNode ID=0x00000008 Parent=0x0000000B SizeRef=1178,883 CentralNode=1 Selected=0x4FC83240
|
||||
DockNode ID=0x0000000C Parent=0x0000000D SizeRef=1568,335 Selected=0x139FDA3F
|
||||
DockNode ID=0x0000000E Parent=0x00000002 SizeRef=1568,225 Split=X Selected=0xD99DEA49
|
||||
DockNode ID=0x00000004 Parent=0x0000000E SizeRef=871,225 Selected=0xD99DEA49
|
||||
DockNode ID=0x00000006 Parent=0x0000000E SizeRef=870,225 Selected=0xAB74BEE9
|
||||
DockNode ID=0x00000005 Parent=0xCCBD8CF7 SizeRef=303,826 Split=Y Selected=0x9F035453
|
||||
DockNode ID=0x0000000F Parent=0x00000005 SizeRef=303,667 Selected=0x9F035453
|
||||
DockNode ID=0x00000010 Parent=0x00000005 SizeRef=303,441 Selected=0x0B098C4B
|
||||
|
BIN
enginecustom/assets/Texture/light01.png
Normal file
After Width: | Height: | Size: 164 KiB |
BIN
enginecustom/assets/Texture/marble01.png
Normal file
After Width: | Height: | Size: 1.7 MiB |
BIN
enginecustom/assets/Texture/moss01.png
Normal file
After Width: | Height: | Size: 2.9 MiB |
BIN
enginecustom/assets/Texture/normal01.png
Normal file
After Width: | Height: | Size: 599 KiB |
BIN
enginecustom/assets/Texture/spec02.png
Normal file
After Width: | Height: | Size: 148 KiB |
BIN
enginecustom/assets/Texture/sprite01.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
enginecustom/assets/Texture/sprite02.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
enginecustom/assets/Texture/sprite03.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
enginecustom/assets/Texture/sprite04.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
BIN
enginecustom/assets/Texture/stone01.png
Normal file
After Width: | Height: | Size: 917 KiB |
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
BIN
enginecustom/assets/Texture/wall.png
Normal file
After Width: | Height: | Size: 934 KiB |
BIN
enginecustom/assets/Texture/wall01.png
Normal file
After Width: | Height: | Size: 1.8 MiB |
BIN
enginecustom/assets/Texture/water01.png
Normal file
After Width: | Height: | Size: 161 KiB |
1
enginecustom/assets/empty.ker
Normal file
@@ -0,0 +1 @@
|
||||
0 isosphere 0 10 0 1 1 1 F:\Github_Repo\khaotic-engine-Reborn\enginecustom\assets\Model\OBJ\isosphere.obj
|
89
enginecustom/assets/imgui.ini
Normal file
@@ -0,0 +1,89 @@
|
||||
[Window][Debug##Default]
|
||||
Pos=60,60
|
||||
Size=400,400
|
||||
Collapsed=0
|
||||
|
||||
[Window][Khaotic Engine]
|
||||
Pos=1233,27
|
||||
Size=343,826
|
||||
Collapsed=0
|
||||
DockId=0x00000005,0
|
||||
|
||||
[Window][Objects]
|
||||
Pos=8,27
|
||||
Size=289,413
|
||||
Collapsed=0
|
||||
DockId=0x00000007,0
|
||||
|
||||
[Window][Terrain]
|
||||
Pos=8,442
|
||||
Size=289,411
|
||||
Collapsed=0
|
||||
DockId=0x00000008,0
|
||||
|
||||
[Window][Light]
|
||||
Pos=8,27
|
||||
Size=290,866
|
||||
Collapsed=0
|
||||
DockId=0x00000004,1
|
||||
|
||||
[Window][Shader Manager]
|
||||
Pos=8,27
|
||||
Size=330,487
|
||||
Collapsed=0
|
||||
DockId=0x00000001,2
|
||||
|
||||
[Window][Engine Settings]
|
||||
Pos=1233,27
|
||||
Size=343,826
|
||||
Collapsed=0
|
||||
DockId=0x00000005,1
|
||||
|
||||
[Window][DockSpace Demo]
|
||||
Size=1584,861
|
||||
Collapsed=0
|
||||
|
||||
[Window][Render Window]
|
||||
Pos=8,27
|
||||
Size=1559,974
|
||||
Collapsed=0
|
||||
DockId=0x00000007,0
|
||||
|
||||
[Window][DockSpace]
|
||||
Pos=0,0
|
||||
Size=1584,861
|
||||
Collapsed=0
|
||||
|
||||
[Window][Add Object]
|
||||
Pos=1188,0
|
||||
Size=396,430
|
||||
Collapsed=0
|
||||
|
||||
[Window][Log]
|
||||
Pos=8,518
|
||||
Size=1568,335
|
||||
Collapsed=0
|
||||
DockId=0x0000000C,0
|
||||
|
||||
[Window][Log Window]
|
||||
Pos=299,627
|
||||
Size=932,226
|
||||
Collapsed=0
|
||||
DockId=0x00000006,0
|
||||
|
||||
[Docking][Data]
|
||||
DockSpace ID=0xC0DFADC4 Pos=8,27 Size=1568,826 Split=X
|
||||
DockNode ID=0x00000001 Parent=0xC0DFADC4 SizeRef=330,1094 Selected=0x393905AB
|
||||
DockNode ID=0x00000003 Parent=0xC0DFADC4 SizeRef=1700,1094 CentralNode=1
|
||||
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=8,27 Size=1568,826 Split=X
|
||||
DockNode ID=0x00000009 Parent=0xCCBD8CF7 SizeRef=289,974 Split=Y Selected=0x031DC75C
|
||||
DockNode ID=0x00000007 Parent=0x00000009 SizeRef=289,299 Selected=0x031DC75C
|
||||
DockNode ID=0x00000008 Parent=0x00000009 SizeRef=289,297 Selected=0x393905AB
|
||||
DockNode ID=0x0000000D Parent=0xCCBD8CF7 SizeRef=1613,974 Split=X
|
||||
DockNode ID=0x00000002 Parent=0x0000000D SizeRef=1268,826 Split=Y
|
||||
DockNode ID=0x0000000B Parent=0x00000002 SizeRef=1568,637 Split=Y
|
||||
DockNode ID=0x00000004 Parent=0x0000000B SizeRef=932,598 CentralNode=1
|
||||
DockNode ID=0x00000006 Parent=0x0000000B SizeRef=932,226 Selected=0xAB74BEE9
|
||||
DockNode ID=0x0000000C Parent=0x00000002 SizeRef=1568,335 Selected=0x139FDA3F
|
||||
DockNode ID=0x00000005 Parent=0x0000000D SizeRef=343,826 Selected=0x0B098C4B
|
||||
|
0
enginecustom/assets/scene.ker
Normal file
@@ -1,59 +0,0 @@
|
||||
#ifndef _BITMAPCLASS_H_
|
||||
#define _BITMAPCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include <directxmath.h>
|
||||
using namespace DirectX;
|
||||
|
||||
|
||||
///////////////////////
|
||||
// MY CLASS INCLUDES //
|
||||
///////////////////////
|
||||
#include "textureclass.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: BitmapClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class BitmapClass
|
||||
{
|
||||
private:
|
||||
struct VertexType
|
||||
{
|
||||
XMFLOAT3 position;
|
||||
XMFLOAT2 texture;
|
||||
};
|
||||
|
||||
public:
|
||||
BitmapClass();
|
||||
BitmapClass(const BitmapClass&);
|
||||
~BitmapClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, ID3D11DeviceContext*, int, int, char*, int, int);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*);
|
||||
|
||||
int GetIndexCount();
|
||||
ID3D11ShaderResourceView* GetTexture();
|
||||
|
||||
void SetRenderLocation(int, int);
|
||||
|
||||
private:
|
||||
bool InitializeBuffers(ID3D11Device*);
|
||||
void ShutdownBuffers();
|
||||
bool UpdateBuffers(ID3D11DeviceContext*);
|
||||
void RenderBuffers(ID3D11DeviceContext*);
|
||||
|
||||
bool LoadTexture(ID3D11Device*, ID3D11DeviceContext*, char*);
|
||||
void ReleaseTexture();
|
||||
private:
|
||||
ID3D11Buffer* m_vertexBuffer, * m_indexBuffer;
|
||||
int m_vertexCount, m_indexCount, m_screenWidth, m_screenHeight, m_bitmapWidth, m_bitmapHeight, m_renderX, m_renderY, m_prevPosX, m_prevPosY;
|
||||
TextureClass* m_Texture;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@@ -1,89 +0,0 @@
|
||||
cbuffer LightBuffer
|
||||
{
|
||||
float4 diffuseColor;
|
||||
float3 lightDirection;
|
||||
float padding; // Padding to ensure the structure is a multiple of 16 bytes.
|
||||
float3 lightPosition; // Add light position
|
||||
float padding2; // Padding to ensure the structure is a multiple of 16 bytes.
|
||||
float constantAttenuation;
|
||||
float linearAttenuation;
|
||||
float quadraticAttenuation;
|
||||
float padding3; // Padding to ensure the structure is a multiple of 16 bytes.
|
||||
};
|
||||
|
||||
Texture2D shaderTexture;
|
||||
SamplerState SampleType;
|
||||
|
||||
struct PixelInputType
|
||||
{
|
||||
float4 position : SV_POSITION;
|
||||
float3 normal : NORMAL;
|
||||
float2 tex : TEXCOORD0;
|
||||
float3 worldPos : TEXCOORD1; // Add world position
|
||||
};
|
||||
|
||||
float4 CelShadingPixelShader(PixelInputType input) : SV_TARGET
|
||||
{
|
||||
float4 textureColor;
|
||||
float lightIntensity;
|
||||
float4 finalColor;
|
||||
|
||||
// Sample the pixel color from the texture.
|
||||
textureColor = shaderTexture.Sample(SampleType, input.tex);
|
||||
|
||||
float3 normal = normalize(input.normal);
|
||||
|
||||
// Calculate the light vector from the light position to the world position
|
||||
float3 lightVector = normalize(lightPosition - input.worldPos);
|
||||
|
||||
// Calculate the light intensity based on the light direction.
|
||||
float directionalLightIntensity = saturate(dot(normal, normalize(lightDirection)));
|
||||
|
||||
// Calculate the light intensity based on the light position.
|
||||
float positionalLightIntensity = saturate(dot(normal, lightVector));
|
||||
|
||||
// Combine the directional and positional light intensities.
|
||||
lightIntensity = max(directionalLightIntensity, positionalLightIntensity);
|
||||
|
||||
// Calculate the distance from the light to the fragment.
|
||||
float distance = length(lightPosition - input.worldPos);
|
||||
|
||||
// Apply an attenuation factor based on the distance.
|
||||
float attenuation = 1.0f / (constantAttenuation + linearAttenuation * distance + quadraticAttenuation * distance * distance);
|
||||
|
||||
// Combine the light intensity with the attenuation factor.
|
||||
lightIntensity *= attenuation;
|
||||
|
||||
// Apply a step function to create the cel shading effect.
|
||||
if (lightIntensity > 0.75f)
|
||||
{
|
||||
lightIntensity = 1.0f; // Brightest level
|
||||
}
|
||||
else if (lightIntensity > 0.5f)
|
||||
{
|
||||
lightIntensity = 0.7f; // Mid-bright level
|
||||
}
|
||||
else if (lightIntensity > 0.25f)
|
||||
{
|
||||
lightIntensity = 0.4f; // Mid-dark level
|
||||
}
|
||||
else
|
||||
{
|
||||
lightIntensity = 0.1f; // Darkest level
|
||||
}
|
||||
|
||||
// Simple shadow calculation: if the fragment is behind the light source, it is in shadow.
|
||||
float3 toLight = normalize(lightPosition - input.worldPos);
|
||||
float shadow = saturate(dot(normal, toLight));
|
||||
if (shadow < 0.1f)
|
||||
{
|
||||
lightIntensity *= 0.5f; // Darken the fragment if it is in shadow
|
||||
}
|
||||
|
||||
// Calculate the final color by combining the texture color with the light intensity and diffuse color.
|
||||
finalColor = textureColor * diffuseColor * lightIntensity;
|
||||
|
||||
//return finalColor;
|
||||
|
||||
return float4(normal * 0.5f + 0.5f, 1.0f);
|
||||
}
|
@@ -1,328 +0,0 @@
|
||||
# Blender 4.0.1
|
||||
# www.blender.org
|
||||
o Cone
|
||||
v 0.000000 -1.000000 -1.000000
|
||||
v 0.098017 -1.000000 -0.995185
|
||||
v 0.195090 -1.000000 -0.980785
|
||||
v 0.290285 -1.000000 -0.956940
|
||||
v 0.382683 -1.000000 -0.923880
|
||||
v 0.471397 -1.000000 -0.881921
|
||||
v 0.555570 -1.000000 -0.831470
|
||||
v 0.634393 -1.000000 -0.773010
|
||||
v 0.707107 -1.000000 -0.707107
|
||||
v 0.773010 -1.000000 -0.634393
|
||||
v 0.831470 -1.000000 -0.555570
|
||||
v 0.881921 -1.000000 -0.471397
|
||||
v 0.923880 -1.000000 -0.382683
|
||||
v 0.956940 -1.000000 -0.290285
|
||||
v 0.980785 -1.000000 -0.195090
|
||||
v 0.995185 -1.000000 -0.098017
|
||||
v 1.000000 -1.000000 0.000000
|
||||
v 0.995185 -1.000000 0.098017
|
||||
v 0.980785 -1.000000 0.195090
|
||||
v 0.956940 -1.000000 0.290285
|
||||
v 0.923880 -1.000000 0.382683
|
||||
v 0.881921 -1.000000 0.471397
|
||||
v 0.831470 -1.000000 0.555570
|
||||
v 0.773010 -1.000000 0.634393
|
||||
v 0.707107 -1.000000 0.707107
|
||||
v 0.634393 -1.000000 0.773010
|
||||
v 0.555570 -1.000000 0.831470
|
||||
v 0.471397 -1.000000 0.881921
|
||||
v 0.382683 -1.000000 0.923880
|
||||
v 0.290285 -1.000000 0.956940
|
||||
v 0.195090 -1.000000 0.980785
|
||||
v 0.098017 -1.000000 0.995185
|
||||
v 0.000000 -1.000000 1.000000
|
||||
v -0.098017 -1.000000 0.995185
|
||||
v -0.195090 -1.000000 0.980785
|
||||
v -0.290285 -1.000000 0.956940
|
||||
v -0.382683 -1.000000 0.923880
|
||||
v -0.471397 -1.000000 0.881921
|
||||
v -0.555570 -1.000000 0.831470
|
||||
v -0.634393 -1.000000 0.773010
|
||||
v -0.707107 -1.000000 0.707107
|
||||
v -0.773010 -1.000000 0.634393
|
||||
v -0.831470 -1.000000 0.555570
|
||||
v -0.881921 -1.000000 0.471397
|
||||
v -0.923880 -1.000000 0.382683
|
||||
v -0.956940 -1.000000 0.290285
|
||||
v -0.980785 -1.000000 0.195090
|
||||
v -0.995185 -1.000000 0.098017
|
||||
v -1.000000 -1.000000 0.000000
|
||||
v -0.995185 -1.000000 -0.098017
|
||||
v -0.980785 -1.000000 -0.195090
|
||||
v -0.956940 -1.000000 -0.290285
|
||||
v -0.923880 -1.000000 -0.382683
|
||||
v -0.881921 -1.000000 -0.471397
|
||||
v -0.831470 -1.000000 -0.555570
|
||||
v -0.773010 -1.000000 -0.634393
|
||||
v -0.707107 -1.000000 -0.707107
|
||||
v -0.634393 -1.000000 -0.773010
|
||||
v -0.555570 -1.000000 -0.831470
|
||||
v -0.471397 -1.000000 -0.881921
|
||||
v -0.382683 -1.000000 -0.923880
|
||||
v -0.290285 -1.000000 -0.956940
|
||||
v -0.195090 -1.000000 -0.980785
|
||||
v -0.098017 -1.000000 -0.995185
|
||||
v 0.000000 1.000000 0.000000
|
||||
vn 0.0439 0.4468 -0.8936
|
||||
vn 0.1313 0.4468 -0.8850
|
||||
vn 0.2174 0.4468 -0.8678
|
||||
vn 0.3014 0.4468 -0.8423
|
||||
vn 0.3825 0.4468 -0.8087
|
||||
vn 0.4599 0.4468 -0.7674
|
||||
vn 0.5329 0.4468 -0.7186
|
||||
vn 0.6008 0.4468 -0.6629
|
||||
vn 0.6629 0.4468 -0.6008
|
||||
vn 0.7186 0.4468 -0.5329
|
||||
vn 0.7674 0.4468 -0.4599
|
||||
vn 0.8087 0.4468 -0.3825
|
||||
vn 0.8423 0.4468 -0.3014
|
||||
vn 0.8678 0.4468 -0.2174
|
||||
vn 0.8850 0.4468 -0.1313
|
||||
vn 0.8936 0.4468 -0.0439
|
||||
vn 0.8936 0.4468 0.0439
|
||||
vn 0.8850 0.4468 0.1313
|
||||
vn 0.8678 0.4468 0.2174
|
||||
vn 0.8423 0.4468 0.3014
|
||||
vn 0.8087 0.4468 0.3825
|
||||
vn 0.7674 0.4468 0.4599
|
||||
vn 0.7186 0.4468 0.5329
|
||||
vn 0.6629 0.4468 0.6008
|
||||
vn 0.6008 0.4468 0.6629
|
||||
vn 0.5329 0.4468 0.7186
|
||||
vn 0.4599 0.4468 0.7674
|
||||
vn 0.3825 0.4468 0.8087
|
||||
vn 0.3014 0.4468 0.8423
|
||||
vn 0.2174 0.4468 0.8678
|
||||
vn 0.1313 0.4468 0.8850
|
||||
vn 0.0439 0.4468 0.8936
|
||||
vn -0.0439 0.4468 0.8936
|
||||
vn -0.1313 0.4468 0.8850
|
||||
vn -0.2174 0.4468 0.8678
|
||||
vn -0.3014 0.4468 0.8423
|
||||
vn -0.3825 0.4468 0.8087
|
||||
vn -0.4599 0.4468 0.7674
|
||||
vn -0.5329 0.4468 0.7186
|
||||
vn -0.6008 0.4468 0.6629
|
||||
vn -0.6629 0.4468 0.6008
|
||||
vn -0.7186 0.4468 0.5329
|
||||
vn -0.7674 0.4468 0.4599
|
||||
vn -0.8087 0.4468 0.3825
|
||||
vn -0.8423 0.4468 0.3014
|
||||
vn -0.8678 0.4468 0.2174
|
||||
vn -0.8850 0.4468 0.1313
|
||||
vn -0.8936 0.4468 0.0439
|
||||
vn -0.8936 0.4468 -0.0439
|
||||
vn -0.8850 0.4468 -0.1313
|
||||
vn -0.8678 0.4468 -0.2174
|
||||
vn -0.8423 0.4468 -0.3014
|
||||
vn -0.8087 0.4468 -0.3825
|
||||
vn -0.7674 0.4468 -0.4599
|
||||
vn -0.7186 0.4468 -0.5329
|
||||
vn -0.6629 0.4468 -0.6008
|
||||
vn -0.6008 0.4468 -0.6629
|
||||
vn -0.5329 0.4468 -0.7186
|
||||
vn -0.4599 0.4468 -0.7674
|
||||
vn -0.3825 0.4468 -0.8087
|
||||
vn -0.3014 0.4468 -0.8423
|
||||
vn -0.2174 0.4468 -0.8678
|
||||
vn -0.0000 -1.0000 -0.0000
|
||||
vn -0.1313 0.4468 -0.8850
|
||||
vn -0.0439 0.4468 -0.8936
|
||||
vt 0.250000 0.490000
|
||||
vt 0.250000 0.250000
|
||||
vt 0.273524 0.488844
|
||||
vt 0.296822 0.485388
|
||||
vt 0.319668 0.479666
|
||||
vt 0.341844 0.471731
|
||||
vt 0.363135 0.461661
|
||||
vt 0.383337 0.449553
|
||||
vt 0.402254 0.435522
|
||||
vt 0.419706 0.419706
|
||||
vt 0.435522 0.402254
|
||||
vt 0.449553 0.383337
|
||||
vt 0.461661 0.363135
|
||||
vt 0.471731 0.341844
|
||||
vt 0.479666 0.319668
|
||||
vt 0.485388 0.296822
|
||||
vt 0.488844 0.273524
|
||||
vt 0.490000 0.250000
|
||||
vt 0.488844 0.226476
|
||||
vt 0.485388 0.203178
|
||||
vt 0.479666 0.180332
|
||||
vt 0.471731 0.158156
|
||||
vt 0.461661 0.136865
|
||||
vt 0.449553 0.116663
|
||||
vt 0.435522 0.097746
|
||||
vt 0.419706 0.080294
|
||||
vt 0.402254 0.064478
|
||||
vt 0.383337 0.050447
|
||||
vt 0.363135 0.038339
|
||||
vt 0.341844 0.028269
|
||||
vt 0.319668 0.020334
|
||||
vt 0.296822 0.014612
|
||||
vt 0.273524 0.011156
|
||||
vt 0.250000 0.010000
|
||||
vt 0.226476 0.011156
|
||||
vt 0.203178 0.014612
|
||||
vt 0.180332 0.020334
|
||||
vt 0.158156 0.028269
|
||||
vt 0.136865 0.038339
|
||||
vt 0.116663 0.050447
|
||||
vt 0.097746 0.064478
|
||||
vt 0.080294 0.080294
|
||||
vt 0.064478 0.097746
|
||||
vt 0.050447 0.116663
|
||||
vt 0.038339 0.136865
|
||||
vt 0.028269 0.158156
|
||||
vt 0.020334 0.180332
|
||||
vt 0.014612 0.203178
|
||||
vt 0.011156 0.226476
|
||||
vt 0.010000 0.250000
|
||||
vt 0.011156 0.273524
|
||||
vt 0.014612 0.296822
|
||||
vt 0.020334 0.319668
|
||||
vt 0.028269 0.341844
|
||||
vt 0.038339 0.363135
|
||||
vt 0.050447 0.383337
|
||||
vt 0.064478 0.402254
|
||||
vt 0.080294 0.419706
|
||||
vt 0.097746 0.435522
|
||||
vt 0.116663 0.449553
|
||||
vt 0.136865 0.461661
|
||||
vt 0.158156 0.471731
|
||||
vt 0.180332 0.479666
|
||||
vt 0.203178 0.485388
|
||||
vt 0.750000 0.490000
|
||||
vt 0.773524 0.488844
|
||||
vt 0.796822 0.485388
|
||||
vt 0.819668 0.479666
|
||||
vt 0.841844 0.471731
|
||||
vt 0.863135 0.461661
|
||||
vt 0.883337 0.449553
|
||||
vt 0.902254 0.435522
|
||||
vt 0.919706 0.419706
|
||||
vt 0.935522 0.402254
|
||||
vt 0.949553 0.383337
|
||||
vt 0.961661 0.363135
|
||||
vt 0.971731 0.341844
|
||||
vt 0.979666 0.319668
|
||||
vt 0.985388 0.296822
|
||||
vt 0.988844 0.273524
|
||||
vt 0.990000 0.250000
|
||||
vt 0.988844 0.226476
|
||||
vt 0.985388 0.203178
|
||||
vt 0.979666 0.180332
|
||||
vt 0.971731 0.158156
|
||||
vt 0.961661 0.136865
|
||||
vt 0.949553 0.116663
|
||||
vt 0.935522 0.097746
|
||||
vt 0.919706 0.080294
|
||||
vt 0.902254 0.064478
|
||||
vt 0.883337 0.050447
|
||||
vt 0.863135 0.038339
|
||||
vt 0.841844 0.028269
|
||||
vt 0.819668 0.020334
|
||||
vt 0.796822 0.014612
|
||||
vt 0.773524 0.011156
|
||||
vt 0.750000 0.010000
|
||||
vt 0.726476 0.011156
|
||||
vt 0.703178 0.014612
|
||||
vt 0.680332 0.020334
|
||||
vt 0.658156 0.028269
|
||||
vt 0.636865 0.038339
|
||||
vt 0.616663 0.050447
|
||||
vt 0.597746 0.064478
|
||||
vt 0.580294 0.080294
|
||||
vt 0.564478 0.097746
|
||||
vt 0.550447 0.116663
|
||||
vt 0.538339 0.136865
|
||||
vt 0.528269 0.158156
|
||||
vt 0.520334 0.180332
|
||||
vt 0.514612 0.203178
|
||||
vt 0.511156 0.226476
|
||||
vt 0.510000 0.250000
|
||||
vt 0.511156 0.273524
|
||||
vt 0.514612 0.296822
|
||||
vt 0.520334 0.319668
|
||||
vt 0.528269 0.341844
|
||||
vt 0.538339 0.363135
|
||||
vt 0.550447 0.383337
|
||||
vt 0.564478 0.402254
|
||||
vt 0.580294 0.419706
|
||||
vt 0.597746 0.435522
|
||||
vt 0.616663 0.449553
|
||||
vt 0.636865 0.461661
|
||||
vt 0.658156 0.471731
|
||||
vt 0.680332 0.479666
|
||||
vt 0.703178 0.485388
|
||||
vt 0.726476 0.488844
|
||||
vt 0.226476 0.488844
|
||||
s 0
|
||||
f 1/1/1 65/2/1 2/3/1
|
||||
f 2/3/2 65/2/2 3/4/2
|
||||
f 3/4/3 65/2/3 4/5/3
|
||||
f 4/5/4 65/2/4 5/6/4
|
||||
f 5/6/5 65/2/5 6/7/5
|
||||
f 6/7/6 65/2/6 7/8/6
|
||||
f 7/8/7 65/2/7 8/9/7
|
||||
f 8/9/8 65/2/8 9/10/8
|
||||
f 9/10/9 65/2/9 10/11/9
|
||||
f 10/11/10 65/2/10 11/12/10
|
||||
f 11/12/11 65/2/11 12/13/11
|
||||
f 12/13/12 65/2/12 13/14/12
|
||||
f 13/14/13 65/2/13 14/15/13
|
||||
f 14/15/14 65/2/14 15/16/14
|
||||
f 15/16/15 65/2/15 16/17/15
|
||||
f 16/17/16 65/2/16 17/18/16
|
||||
f 17/18/17 65/2/17 18/19/17
|
||||
f 18/19/18 65/2/18 19/20/18
|
||||
f 19/20/19 65/2/19 20/21/19
|
||||
f 20/21/20 65/2/20 21/22/20
|
||||
f 21/22/21 65/2/21 22/23/21
|
||||
f 22/23/22 65/2/22 23/24/22
|
||||
f 23/24/23 65/2/23 24/25/23
|
||||
f 24/25/24 65/2/24 25/26/24
|
||||
f 25/26/25 65/2/25 26/27/25
|
||||
f 26/27/26 65/2/26 27/28/26
|
||||
f 27/28/27 65/2/27 28/29/27
|
||||
f 28/29/28 65/2/28 29/30/28
|
||||
f 29/30/29 65/2/29 30/31/29
|
||||
f 30/31/30 65/2/30 31/32/30
|
||||
f 31/32/31 65/2/31 32/33/31
|
||||
f 32/33/32 65/2/32 33/34/32
|
||||
f 33/34/33 65/2/33 34/35/33
|
||||
f 34/35/34 65/2/34 35/36/34
|
||||
f 35/36/35 65/2/35 36/37/35
|
||||
f 36/37/36 65/2/36 37/38/36
|
||||
f 37/38/37 65/2/37 38/39/37
|
||||
f 38/39/38 65/2/38 39/40/38
|
||||
f 39/40/39 65/2/39 40/41/39
|
||||
f 40/41/40 65/2/40 41/42/40
|
||||
f 41/42/41 65/2/41 42/43/41
|
||||
f 42/43/42 65/2/42 43/44/42
|
||||
f 43/44/43 65/2/43 44/45/43
|
||||
f 44/45/44 65/2/44 45/46/44
|
||||
f 45/46/45 65/2/45 46/47/45
|
||||
f 46/47/46 65/2/46 47/48/46
|
||||
f 47/48/47 65/2/47 48/49/47
|
||||
f 48/49/48 65/2/48 49/50/48
|
||||
f 49/50/49 65/2/49 50/51/49
|
||||
f 50/51/50 65/2/50 51/52/50
|
||||
f 51/52/51 65/2/51 52/53/51
|
||||
f 52/53/52 65/2/52 53/54/52
|
||||
f 53/54/53 65/2/53 54/55/53
|
||||
f 54/55/54 65/2/54 55/56/54
|
||||
f 55/56/55 65/2/55 56/57/55
|
||||
f 56/57/56 65/2/56 57/58/56
|
||||
f 57/58/57 65/2/57 58/59/57
|
||||
f 58/59/58 65/2/58 59/60/58
|
||||
f 59/60/59 65/2/59 60/61/59
|
||||
f 60/61/60 65/2/60 61/62/60
|
||||
f 61/62/61 65/2/61 62/63/61
|
||||
f 62/63/62 65/2/62 63/64/62
|
||||
f 1/65/63 2/66/63 3/67/63 4/68/63 5/69/63 6/70/63 7/71/63 8/72/63 9/73/63 10/74/63 11/75/63 12/76/63 13/77/63 14/78/63 15/79/63 16/80/63 17/81/63 18/82/63 19/83/63 20/84/63 21/85/63 22/86/63 23/87/63 24/88/63 25/89/63 26/90/63 27/91/63 28/92/63 29/93/63 30/94/63 31/95/63 32/96/63 33/97/63 34/98/63 35/99/63 36/100/63 37/101/63 38/102/63 39/103/63 40/104/63 41/105/63 42/106/63 43/107/63 44/108/63 45/109/63 46/110/63 47/111/63 48/112/63 49/113/63 50/114/63 51/115/63 52/116/63 53/117/63 54/118/63 55/119/63 56/120/63 57/121/63 58/122/63 59/123/63 60/124/63 61/125/63 62/126/63 63/127/63 64/128/63
|
||||
f 63/64/64 65/2/64 64/129/64
|
||||
f 64/129/65 65/2/65 1/1/65
|
@@ -1,88 +0,0 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Filename: d3dclass.h
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _D3DCLASS_H_
|
||||
#define _D3DCLASS_H_
|
||||
|
||||
|
||||
/////////////
|
||||
// LINKING //
|
||||
/////////////
|
||||
#pragma comment(lib, "d3d11.lib")
|
||||
#pragma comment(lib, "dxgi.lib")
|
||||
#pragma comment(lib, "d3dcompiler.lib")
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "imguiManager.h"
|
||||
#include "d3d11.h"
|
||||
#include "fontshaderclass.h"
|
||||
#include "fontclass.h"
|
||||
#include "textclass.h"
|
||||
|
||||
using namespace DirectX;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: D3DClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class D3DClass
|
||||
{
|
||||
public:
|
||||
D3DClass();
|
||||
D3DClass(const D3DClass&);
|
||||
~D3DClass();
|
||||
|
||||
bool Initialize(int, int, bool, HWND, bool, float, float);
|
||||
void Shutdown();
|
||||
|
||||
void BeginScene(float, float, float, float);
|
||||
void EndScene();
|
||||
|
||||
ID3D11Device* GetDevice();
|
||||
ID3D11DeviceContext* GetDeviceContext();
|
||||
XMMATRIX GetProjectionMatrix(XMMATRIX& projectionMatrix);
|
||||
IDXGISwapChain* m_swapChain;
|
||||
IDXGISwapChain* GetSwapChain();
|
||||
void ResizeSwapChain(int, int);
|
||||
|
||||
XMMATRIX GetProjectionMatrix();
|
||||
void GetWorldMatrix(XMMATRIX&);
|
||||
void GetOrthoMatrix(XMMATRIX&);
|
||||
|
||||
void GetVideoCardInfo(char*, int&);
|
||||
|
||||
void SetBackBufferRenderTarget();
|
||||
void ResetViewport();
|
||||
|
||||
void ReleaseResources();
|
||||
void ResetResources(int newWidth, int newHeight);
|
||||
|
||||
void TurnZBufferOn();
|
||||
void TurnZBufferOff();
|
||||
|
||||
void EnableAlphaBlending();
|
||||
void DisableAlphaBlending();
|
||||
|
||||
private:
|
||||
bool m_vsync_enabled;
|
||||
int m_videoCardMemory;
|
||||
char m_videoCardDescription[128];
|
||||
ID3D11Device* m_device;
|
||||
ID3D11DeviceContext* m_deviceContext;
|
||||
ID3D11RenderTargetView* m_renderTargetView;
|
||||
ID3D11Texture2D* m_depthStencilBuffer;
|
||||
ID3D11DepthStencilState* m_depthStencilState;
|
||||
ID3D11DepthStencilView* m_depthStencilView;
|
||||
ID3D11RasterizerState* m_rasterState;
|
||||
XMMATRIX m_projectionMatrix;
|
||||
XMMATRIX m_worldMatrix;
|
||||
XMMATRIX m_orthoMatrix;
|
||||
D3D11_VIEWPORT m_viewport;
|
||||
ID3D11DepthStencilState* m_depthDisabledStencilState;
|
||||
ID3D11BlendState* m_alphaEnableBlendingState;
|
||||
ID3D11BlendState* m_alphaDisableBlendingState;
|
||||
};
|
||||
|
||||
#endif
|
1
enginecustom/demo.ker
Normal file
@@ -0,0 +1 @@
|
||||
1 isosphere 0 10 0 0 0 -0 1 1 1 F:\Github_Repo\khaotic-engine-Reborn\x64\Debug\Content/Assets/Kobject/isosphere.obj SUNLIGHT 1 Unknown 1 0 2 F:\Github_Repo\khaotic-engine-Reborn\enginecustom\assets\Texture\ground01.png F:\Github_Repo\khaotic-engine-Reborn\enginecustom\assets\Texture\dirt01.png 1 assets/Texture/BricksNRM2K.png 1 assets/Texture/BricksGLOSS2K.png 1 F:\Github_Repo\khaotic-engine-Reborn\enginecustom\assets\Texture\alpha01.png
|