Skip to content

Commit fa9ab17

Browse files
committed
Added a variety of features - working on instancing and new texturing methods
1 parent 14f2681 commit fa9ab17

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+41114
-988
lines changed

ColorRangeDemo/ColorRangeDemo.vcxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
</Link>
148148
</ItemDefinitionGroup>
149149
<ItemGroup>
150+
<ClCompile Include="heads\Vulkan\Components.h" />
150151
<ClCompile Include="src\ColorRangeDemo.cpp" />
151152
<ClCompile Include="heads\ConsoleUI\Facade.h" />
152153
<ClCompile Include="heads\Vulkan\Objects\ModelTypes\Polyhedra.h" />
@@ -175,6 +176,7 @@
175176
<ClInclude Include="heads\ConsoleUI\Commands\UIConfigure.h" />
176177
<ClInclude Include="heads\ConsoleUI\Commands\UIMainMenu.h" />
177178
<ClInclude Include="heads\ConsoleUI\UISingletons.h" />
179+
<ClInclude Include="heads\UPCLASS.h" />
178180
<ClInclude Include="heads\Vulkan\GeneralIncludes.h" />
179181
<ClInclude Include="heads\Vulkan\Objects\Buffers\UniformData\PushConsts.h" />
180182
<ClInclude Include="heads\Vulkan\Objects\Buffers\UniformData\UBOs.h" />
@@ -184,6 +186,8 @@
184186
<ClInclude Include="heads\Vulkan\Objects\ModelTypes\ModelFactory.h" />
185187
<ClInclude Include="heads\Vulkan\Objects\Buffers\UniformData.h" />
186188
<ClInclude Include="heads\Vulkan\Objects\Render\RenderOut.h" />
189+
<ClInclude Include="heads\Vulkan\Objects\Shaders\ShaderFactory.h" />
190+
<ClInclude Include="heads\Vulkan\Objects\Shaders\Shaders.h" />
187191
<ClInclude Include="heads\Vulkan\Objects\Syncronization\CPUSyncFactory.h" />
188192
<ClInclude Include="heads\Vulkan\Objects\Syncronization\GPUSyncFactory.h" />
189193
<ClInclude Include="heads\Vulkan\Objects\Syncronization\SyncFactory.h" />

ColorRangeDemo/ColorRangeDemo.vcxproj.filters

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
<ClCompile Include="src\Vulkan\Objects\Buffers\CommonBuffers.cpp">
5252
<Filter>Source Files</Filter>
5353
</ClCompile>
54+
<ClCompile Include="heads\Vulkan\Components.h">
55+
<Filter>Source Files</Filter>
56+
</ClCompile>
5457
</ItemGroup>
5558
<ItemGroup>
5659
<Library Include="libs\ftxui-component.lib" />
@@ -1325,6 +1328,15 @@
13251328
<ClInclude Include="..\..\..\..\Users\micha\Downloads\stb-master(1)\stb-master\stb_image.h">
13261329
<Filter>Header Files</Filter>
13271330
</ClInclude>
1331+
<ClInclude Include="heads\UPCLASS.h">
1332+
<Filter>Header Files</Filter>
1333+
</ClInclude>
1334+
<ClInclude Include="heads\Vulkan\Objects\Shaders\ShaderFactory.h">
1335+
<Filter>Header Files</Filter>
1336+
</ClInclude>
1337+
<ClInclude Include="heads\Vulkan\Objects\Shaders\Shaders.h">
1338+
<Filter>Header Files</Filter>
1339+
</ClInclude>
13281340
</ItemGroup>
13291341
<ItemGroup>
13301342
<None Include="include\glm\detail\func_common.inl">

ColorRangeDemo/heads/UPCLASS.h

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
//#pragma once
2+
//#include <string>
3+
//#include <vector>
4+
//
5+
//#include "tiny_gltf.h"
6+
//
7+
////#define TINYOBJLOADER_IMPLEMENTATION
8+
//#define BUFFER_OFFSET(i) ((char *)NULL + (i))
9+
//
10+
//namespace UPCLASS {
11+
// namespace UPMATH {
12+
// struct upVector2 {
13+
// uint32_t u = 0;
14+
// uint32_t v = 0;
15+
// }; //upVector3
16+
//
17+
// struct upVector3 {
18+
// uint32_t x = 0;
19+
// uint32_t y = 0;
20+
// uint32_t z = 0;
21+
//
22+
// upVector3(uint32_t inX, uint32_t inY, uint32_t inZ) : x(inX), y(inY), z(inZ) {};
23+
// }; //upVector3
24+
//
25+
// struct upVector4 {
26+
// uint32_t r = 0;
27+
// uint32_t g = 0;
28+
// uint32_t b = 0;
29+
// uint32_t a = 0;
30+
// }; //upVector3
31+
// }; //UpMath Namespace
32+
//
33+
// using namespace UPMATH;
34+
//
35+
// struct upAsset {
36+
// std::vector < upVector4 > color;
37+
// std::vector < upVector3 > vertices;
38+
// std::vector < upVector3 > normals;
39+
// std::vector < upVector2 > textureCoordinates;
40+
// std::vector < uint32_t > indices;
41+
//
42+
// uint32_t faceCount;
43+
// uint32_t vertexCount;
44+
// uint32_t colorCount;
45+
// uint32_t indexCount;
46+
// uint32_t normalCount;
47+
// }; //upAsset
48+
//
49+
// struct upClass {
50+
// std::vector<upAsset*> upAssets;
51+
// std::string err;
52+
// std::vector<std::string> warn;
53+
// uint32_t upAssetCount;
54+
//
55+
// upClass() = default;
56+
// upClass(std::string filename, std::string extension) {
57+
// if (extension == ".gltf" || extension == ".glb") {
58+
// tinygltf::Model model;
59+
// tinygltf::TinyGLTF loader;
60+
// std::string gltfErr;
61+
// std::string gltfWarn;
62+
// if (extension == ".gltf")loader.LoadASCIIFromFile(&model, &gltfErr, &gltfWarn, filename + extension);
63+
// if (extension == ".glb")loader.LoadBinaryFromFile(&model, &gltfErr, &gltfWarn, filename + extension);
64+
// //if (extension == ".bin")loader.LoadBinaryFromFile(&model, &err, &warn, filename + extension);
65+
//
66+
// auto scene = model.scenes[model.defaultScene];
67+
//
68+
// uint32_t positionAccessIndex;
69+
// uint32_t normalAccessIndex;
70+
// uint32_t indexAccessIndex;
71+
//
72+
// uint32_t positionOffset;
73+
// uint32_t positionBuffView;
74+
// uint32_t positionBuffIndex;
75+
//
76+
// for (auto& nodeIndex : scene.nodes) {
77+
// if (model.nodes[nodeIndex].mesh >= 0) {
78+
// for (auto& primitive : model.meshes[model.nodes[nodeIndex].mesh].primitives) {
79+
// for (auto& attrib : primitive.attributes) {
80+
// //Second is the index to the item in the "model" hiearchy
81+
// if (attrib.first == "POSITION") positionAccessIndex = attrib.second;
82+
// if (attrib.first == "NORMAL") normalAccessIndex = attrib.second;
83+
// }; //For every Attribute
84+
// indexAccessIndex = primitive.indices;
85+
// }; //primitives
86+
//
87+
// auto asset = new upAsset();
88+
//
89+
// asset->indexCount = model.accessors[indexAccessIndex].count;
90+
// asset->vertexCount = model.accessors[positionAccessIndex].count;
91+
// asset->normalCount = model.accessors[normalAccessIndex].count;
92+
//
93+
// //Creating Indices
94+
// char* begin = BUFFER_OFFSET(model.accessors[indexAccessIndex].byteOffset);
95+
// char* end = BUFFER_OFFSET(model.accessors[indexAccessIndex].byteOffset) + model.accessors[indexAccessIndex].count;
96+
// if (!(model.accessors[indexAccessIndex].type == TINYGLTF_TYPE_SCALAR)) {
97+
// warn.push_back("Bad Accessor: Index"); continue;
98+
// };
99+
// if (model.accessors[indexAccessIndex].componentType == TINYGLTF_COMPONENT_TYPE_BYTE)
100+
// asset->indices = std::vector<uint32_t>((int8_t*)begin, (int8_t*)end);
101+
// if (model.accessors[indexAccessIndex].componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_BYTE)
102+
// asset->indices = std::vector<uint32_t>((uint8_t*)begin, (uint8_t*)end);
103+
// if (model.accessors[indexAccessIndex].componentType == TINYGLTF_COMPONENT_TYPE_SHORT)
104+
// asset->indices = std::vector<uint32_t>((int16_t*)begin, (int16_t*)end);
105+
// if (model.accessors[indexAccessIndex].componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_SHORT)
106+
// asset->indices = std::vector<uint32_t>((uint16_t*)begin, (uint16_t*)end);
107+
// if (model.accessors[indexAccessIndex].componentType == TINYGLTF_COMPONENT_TYPE_INT)
108+
// asset->indices = std::vector<uint32_t>((int32_t*)begin, (int32_t*)end);
109+
// if (model.accessors[indexAccessIndex].componentType == TINYGLTF_COMPONENT_TYPE_UNSIGNED_INT)
110+
// asset->indices = std::vector<uint32_t>((uint32_t*)begin, (uint32_t*)end);
111+
// if (model.accessors[indexAccessIndex].componentType == TINYGLTF_COMPONENT_TYPE_FLOAT)
112+
// asset->indices = std::vector<uint32_t>((float*)begin, (float*)end);
113+
//
114+
// //Creating Vertices
115+
// positionOffset = model.accessors[positionAccessIndex].byteOffset;
116+
// positionBuffView = model.accessors[positionAccessIndex].bufferView;
117+
// positionBuffIndex = model.bufferViews[positionBuffView].buffer;
118+
//
119+
// if (!(model.accessors[indexAccessIndex].type == TINYGLTF_TYPE_VEC3)) {
120+
// warn.push_back("Bad Accessor: Vertex"); continue;
121+
// }; //Warning
122+
// if (model.accessors[indexAccessIndex].componentType == TINYGLTF_COMPONENT_TYPE_FLOAT) {
123+
// uint_fast32_t i = 0;
124+
// auto verticeIndex = model.buffers[positionBuffIndex].data.at(0);
125+
// for (; i < model.bufferViews[positionBuffView].byteLength / model.accessors[positionAccessIndex].count; ++i) {
126+
// asset->vertices.emplace_back(
127+
// UPMATH::upVector3(
128+
// *(float*)verticeIndex,
129+
// *(float*)verticeIndex += 4,
130+
// *(float*)verticeIndex += 4));
131+
// verticeIndex += 4;
132+
// }; //for
133+
// } //if model
134+
// else warn.push_back("Bad Accessor: Vertex"); continue;
135+
// upAssets.emplace_back(asset);
136+
// }; //for every mesh
137+
// }//for every node
138+
// } //gltf, glb
139+
// //if (extension == ".obj") {
140+
// // std::string objWarn;
141+
// // std::string objErr;
142+
// // tinyobj::shape_t shapes;
143+
// //};
144+
// }; //upAsset ctor
145+
//
146+
// void AddUpAsset(std::string file) {
147+
//
148+
// }; //AddUpAsset
149+
//
150+
// void AddUpAsset(upAsset* asset) {
151+
// upAssets.emplace_back(asset);
152+
// ++upAssetCount;
153+
// }; //AddUpAsset
154+
//
155+
// void AppendUpClass(upClass& upclass) {
156+
// upAssets.insert(--upAssets.end(), upclass.upAssets.begin(), upclass.upAssets.end());
157+
// upAssetCount = upAssets.size();
158+
// }; //AppendUpClass
159+
//
160+
// upAsset* GetUpAsset(uint_fast8_t index) {
161+
// return upAssets[index];
162+
// }; //GetUpAsset
163+
//
164+
// upAsset* GetLastUpAsset() {
165+
// return *(--upAssets.end());
166+
// }; //GetLastUpAsset
167+
//
168+
// }; //Asset
169+
//}; //UpClass
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#pragma once
2+
3+
#include "Vulkan/Objects/Shaders/ShaderFactory.h"
4+
5+
namespace Aether {
6+
struct WorldAether {
7+
std::vector<uint32_t> modifierVector = {};
8+
std::string name = {};
9+
glm::mat4 aetherPos = {};
10+
glm::vec3 aetherRot = {};
11+
glm::vec3 aetherTrans = {};
12+
13+
std::string* texture;
14+
uint32_t textureIndex;
15+
std::string* fragShader;
16+
std::string* vertShader;
17+
std::string* compShader;
18+
19+
uint32_t descPoolIndex;
20+
uint32_t gfxPipelineIndex;
21+
22+
uint32_t type;
23+
24+
enum types {
25+
WorldBody = 0,
26+
LensBody,
27+
}; //types
28+
29+
enum modifiers {
30+
//MovementModel
31+
32+
TransformM = 0,
33+
RotateM,
34+
TeleportM,
35+
36+
//MovementView
37+
RotateV,
38+
TransformV,
39+
TeleportV,
40+
41+
//Outline
42+
43+
RefreshAsNormalOutline,
44+
RefreshAsVerticeOutline,
45+
46+
//RegularModel
47+
48+
RefreshAsDefaultModel,
49+
50+
//Loading
51+
52+
LoadMesh,
53+
LoadTexture,
54+
LoadShader,
55+
56+
//Refresh
57+
58+
RefreshMesh,
59+
RefreshTexture,
60+
RefreshShader,
61+
62+
//Copy
63+
64+
InitiateTextureCopy,
65+
CopyTexture,
66+
TerminateTextureCopy
67+
68+
}; //modifiers
69+
70+
enum shaderModifers {
71+
}; //modifiers
72+
}; //WorldAether
73+
74+
struct WorldBody : WorldAether {
75+
glm::mat4 view;
76+
std::string* mesh;
77+
uint32_t uniFactIndex;
78+
uint32_t compImageIndex;
79+
uint32_t meshIndex;
80+
81+
uint32_t indiceCount;
82+
uint32_t verticeCount;
83+
84+
WorldBody() = default;
85+
}; //WorldBody
86+
87+
struct WorldLens : WorldAether {
88+
glm::mat4 perspective;
89+
90+
WorldLens() {
91+
92+
}; //WorldLens
93+
}; //Camera
94+
95+
}; //namespace Aether

0 commit comments

Comments
 (0)