-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy.patch
5692 lines (5623 loc) · 184 KB
/
my.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
diff --git a/Albedo/src/Albedo/Renderer/Model.cpp b/Albedo/src/Albedo/Renderer/Model.cpp
index 15093f6..ec61b48 100644
--- a/Albedo/src/Albedo/Renderer/Model.cpp
+++ b/Albedo/src/Albedo/Renderer/Model.cpp
@@ -312,7 +312,7 @@ namespace Albedo {
// glUniform1i(uOcclusionTexture, 3);
//}
}
- };
+ };
void Model::Draw(Ref<Shader> shader) {
shader->SetUniformInt1("u_BaseColorTexture", 0);
@@ -321,15 +321,15 @@ namespace Albedo {
shader->SetUniformInt1("u_OcclusionTexture", 3);
// The recursive function that should draw a node
- // We use a std::function because a simple lambda cannot be recursive
+ // We use a std::function because a simple lambda cannot be recursive
const std::function<void(int, const glm::mat4&)> drawNode =
[&](int nodeIdx, const glm::mat4& parentMatrix) {
const auto& node = m_model.nodes[nodeIdx];
const glm::mat4 modelMatrix = glm::mat4(1.0f);
- //getLocalToWorldMatrix(node, parentMatrix);
+ //getLocalToWorldMatrix(node, parentMatrix);
- // If the node references a mesh (a node can also reference a
- // camera, or a light)
+ // If the node references a mesh (a node can also reference a
+ // camera, or a light)
if (node.mesh >= 0) {
const auto& mesh = m_model.meshes[node.mesh];
const auto& vaoRange = meshToVertexArrays[node.mesh];
diff --git a/Albedo/src/Albedo/Renderer/Model.h b/Albedo/src/Albedo/Renderer/Model.h
index 9df9b05..e9e7d5b 100644
--- a/Albedo/src/Albedo/Renderer/Model.h
+++ b/Albedo/src/Albedo/Renderer/Model.h
@@ -24,8 +24,6 @@ namespace Albedo {
Model() {}
bool Load(const std::string& path);
void Draw(Ref<Shader> shader);
- void SetPBR(bool pbr) { m_PBR = pbr; }
- const std::string& GetPath() const { return m_Path; }
private:
void LoadTextures(const tinygltf::Model& model);
void LoadMaterials(tinygltf::Model& model);
@@ -37,16 +35,6 @@ namespace Albedo {
GLsizei count; // Number of elements in range
};
- struct {
- int albedo = -1;
- int metallicroughness = -1;
- int emissive = -1;
- int occlusion = -1;
- int normal = -1;
- } m_UVs;
-
- std::string m_Path;
- bool m_PBR = true;
tinygltf::Model m_model;
//std::vector<GLuint> bufferObjects;
std::vector<GLuint> vertexArrayObjects;
diff --git a/Albedo/src/Albedo/Renderer/Renderer.cpp b/Albedo/src/Albedo/Renderer/Renderer.cpp
index df01c5c..88d81cc 100644
--- a/Albedo/src/Albedo/Renderer/Renderer.cpp
+++ b/Albedo/src/Albedo/Renderer/Renderer.cpp
@@ -353,27 +353,19 @@ namespace Albedo {
}
}
- void Renderer::SetupSkybox(const EditorCamera& camera, const SkyboxComponent skybox, const ShaderComponent shader, const glm::mat4& transform)
- {
- shader.m_Shader->Bind();
- shader.m_Shader->SetUniformMat4("u_Projection", camera.GetProjection());
- shader.m_Shader->SetUniformMat4("u_View", glm::mat4(glm::mat3(camera.GetViewMatrix())));
- shader.m_Shader->SetUniformMat4("u_Model", glm::mat4(1.0f));
-
- shader.m_Shader->SetUniformInt1("u_EquirectangularMap", 0);
-
- skybox.m_Skybox->Bind(0);
-
- shader.m_Shader->Unbind();
- }
-
void Renderer::Setup(const EditorCamera& camera, const Ref<Shader> shader, const glm::mat4& transform)
{
shader->Bind();
shader->SetUniformMat4("u_ProjectionView", camera.GetViewProjection());
- shader->SetUniformMat4("u_Model", transform);
- shader->SetUniformMat3("u_NormalMatrix", glm::mat3(transform));
+ shader->SetUniformMat4("u_Model", glm::mat4(1.0f));
+ shader->SetUniformMat3("u_NormalMatrix", glm::mat4(transform));
shader->SetUniformFloat3("u_CamPos", camera.GetPosition());
+
+ shader->SetUniformInt1("u_Albedo", 0);
+ shader->SetUniformInt1("u_MetallicRoughness", 1);
+ shader->SetUniformInt1("u_Normal", 2);
+ shader->SetUniformInt1("u_Occlusion", 3);
+ shader->SetUniformInt1("u_Emissive", 4);
}
void Renderer::RenderOverlay(const Ref<Mesh> mesh)
@@ -383,12 +375,11 @@ namespace Albedo {
mesh->GetMeshBufferData().m_VertexArray->UnBind();
}
- void Renderer::Render(const Ref<Model> model, const Ref<Shader> shader)
+ void Renderer::Render(const ModelComponent& mesh, const Ref<Shader> shader)
{
- shader->Bind();
//if(config.PolygonMode)
// glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- model->Draw(shader);
+ mesh.m_Model->Draw(shader);
//if(config.PolygonMode)
// glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
}
diff --git a/Albedo/src/Albedo/Renderer/Renderer.h b/Albedo/src/Albedo/Renderer/Renderer.h
index b5caaa7..1b2bcb3 100644
--- a/Albedo/src/Albedo/Renderer/Renderer.h
+++ b/Albedo/src/Albedo/Renderer/Renderer.h
@@ -18,14 +18,13 @@ namespace Albedo {
static void SetupPlane(const EditorCamera& camera, const ShaderComponent& shader, const TransformComponent& transform,
const TextureComponent& texture, const MaterialComponent& material, const std::vector<LightComponent>& lights,
const Ref<ShadowMap> shadowMap);
- static void SetupSkybox(const EditorCamera& camera, const SkyboxComponent skybox, const ShaderComponent shader, const glm::mat4& transform);
static void Setup(const EditorCamera& camera, const ShaderComponent& shader, const TransformComponent& transform,
const TextureComponent& texture, const MaterialComponent& material, const std::vector<LightComponent>& lights);
static void Setup(const SceneCamera& camera, const ShaderComponent& shader, const TransformComponent& transform,
const TextureComponent& texture, const MaterialComponent& material);
static void Setup(const EditorCamera& camera, const Ref<Shader> shader, const glm::mat4& transform);
static void RenderOverlay(const Ref<Mesh> mesh);
- static void Render(const Ref<Model> model, const Ref<Shader> shader);
+ static void Render(const ModelComponent& mesh, const Ref<Shader> shader);
static GLenum AlbedoDrawTypeToGLType(DrawType type);
static void Shutdown();
static void OnWindowResize(uint32_t width, uint32_t height);
diff --git a/Albedo/src/Albedo/Scene/Components.h b/Albedo/src/Albedo/Scene/Components.h
index dee8676..21eec4d 100644
--- a/Albedo/src/Albedo/Scene/Components.h
+++ b/Albedo/src/Albedo/Scene/Components.h
@@ -36,13 +36,12 @@ namespace Albedo {
struct ModelComponent
{
- std::string name = "Model Component";
+ std::string name = "Model Compnent";
void AddMesh(const Ref<Model> model, int id) { m_Model = model; ID = id; }
Ref<Model> m_Model;
int ID = -1;
- bool tobeinitialized = false;
ModelComponent() = default;
ModelComponent(const ModelComponent&) = default;
@@ -50,8 +49,6 @@ namespace Albedo {
struct LightComponent
{
- std::string name = "Light Compnent";
-
enum LightType
{
Point,
@@ -61,8 +58,8 @@ namespace Albedo {
LightType type = LightType::Directional;
- glm::vec3 direction = glm::vec3(0.0f, 1.0f, 0.0f);
- glm::vec3 position = glm::vec3(0.0);
+ glm::vec3 direction = glm::vec3(-0.2f, -1.0f, -0.3f);
+ glm::vec3 position = glm::vec3(1.0);
glm::vec3 ambient = glm::vec3(0.05f, 0.05f, 0.05f);
glm::vec3 diffuse = glm::vec3(0.4f, 0.4f, 0.4f);
glm::vec3 specular = glm::vec3(0.5f, 0.5f, 0.5f);
@@ -74,6 +71,7 @@ namespace Albedo {
float quadratic = 0.0;
std::string nameOfLight = "Directional";
+ //glm::vec3 color = glm::vec3(1.0);
LightComponent() = default;
LightComponent(const LightComponent&) = default;
@@ -81,12 +79,9 @@ namespace Albedo {
struct SkyboxComponent
{
- std::string name = "Skybox Compnent";
-
Ref<Texture2D> m_Skybox;
- Ref<Model> m_Model;
- std::string path = "Assets/Textures/hdr/environment.hdr";
+ std::vector<std::string> faces;
SkyboxComponent() = default;
SkyboxComponent(const SkyboxComponent&) = default;
@@ -132,7 +127,7 @@ namespace Albedo {
}
Ref<Shader> m_Shader;
- bool tobeinitialized = false;
+ bool initialize = true;
ShaderComponent() = default;
ShaderComponent(const ShaderComponent&) = default;
@@ -140,43 +135,43 @@ namespace Albedo {
struct TransformComponent
{
- std::string name = "Transform Component";
+ std::string name = "Transform Compnent";
+
+ void AddTranform(const glm::mat4 tranform) { Transform = tranform; }
+ const glm::vec3& GetPosition() const { return Position; }
+ const glm::vec3& GetRotation() const { return Rotation; }
+ const glm::vec3& GetScale() const { return Scale; }
void AddTranform(const glm::vec3& pos)
{
+ Transform = glm::translate(glm::mat4(1.0f), pos);
Position = pos;
}
void AddTranform(const glm::vec4& rot)
{
glm::mat4 rotation = glm::toMat4(glm::quat(rot));
+ Transform = Transform * rotation;
}
void AddTranform(const glm::vec3& pos, const glm::vec4& rot)
{
+ glm::mat4 rotation = glm::toMat4(glm::quat(rot));
+ Transform = glm::translate(glm::mat4(1.0f), pos) * rotation;
Position = pos;
Rotation = rot;
}
void AddTranform(const glm::vec3& pos, const glm::vec4& rot, const glm::vec3& scale)
{
+ glm::mat4 rotation = glm::toMat4(glm::quat(rot));
+ Transform = glm::translate(glm::mat4(1.0f), pos) * rotation * glm::scale(glm::mat4(1.0f), scale);
Position = pos;
Rotation = rot;
Scale = scale;
}
- const glm::vec3& GetPosition() const { return Position; }
- const glm::vec3& GetRotation() const { return Rotation; }
- const glm::vec3& GetScale() const { return Scale; }
-
- glm::mat4 GetTransform() const
- {
- glm::mat4 rotation = glm::toMat4(glm::quat(Rotation));
- return glm::translate(glm::mat4(1.0f), Position)
- * rotation
- * glm::scale(glm::mat4(1.0f), Scale);
- }
-
+ glm::mat4 Transform{ 1.0f };
glm::vec3 Position = { 0.0f, 0.0f, 0.0f };
glm::vec3 Rotation = { 0.0f, 0.0f, 0.0f };
glm::vec3 Scale = { 1.0f, 1.0f, 1.0f };
@@ -187,6 +182,16 @@ namespace Albedo {
TransformComponent(const glm::vec3& position)
: Position(position) {}
+
+ //void SetPosition(const glm::mat4& pos) { Position = pos; }
+
+ glm::mat4 GetTransform() const
+ {
+ glm::mat4 rotation = glm::toMat4(glm::quat(Rotation));
+ return glm::translate(glm::mat4(1.0f), Position)
+ * rotation
+ * glm::scale(glm::mat4(1.0f), Scale);
+ }
};
// Physics
diff --git a/Albedo/src/Albedo/Scene/Scene.cpp b/Albedo/src/Albedo/Scene/Scene.cpp
index 4f7246e..ddc995b 100644
--- a/Albedo/src/Albedo/Scene/Scene.cpp
+++ b/Albedo/src/Albedo/Scene/Scene.cpp
@@ -95,7 +95,7 @@ namespace Albedo {
"Assets/Textures/Skybox/lake/front.jpg",
"Assets/Textures/Skybox/lake/back.jpg"
};
- //skyboxTemp = Texture2D::Create(config);
+ skyboxTemp = Texture2D::Create(config);
}
m_ShadowMap = std::make_shared<ShadowMap>(2048, 2048);
@@ -224,8 +224,8 @@ namespace Albedo {
//entity.AddComponent<MaterialComponent>().m_Material = std::make_shared<Material>();
//entity.GetComponent<MaterialComponent>().m_Material->SetPBRStatus(true);
//entity.GetComponent<MaterialComponent>().isPBR = true;
- entity.AddComponent<ModelComponent>().AddMesh(m_AssetManager->LoadGLTFModel("Assets/gltf_models/DamagedHelmet/glTF/DamagedHelmet.gltf"), (uint32_t)entity);
- //entity.AddComponent<ModelComponent>().AddMesh(m_AssetManager->LoadGLTFModel("Assets/gltf_models/FlightHelmet/glTF/FlightHelmet.gltf"), (uint32_t)entity);
+ //entity.AddComponent<ModelComponent>().AddMesh(m_AssetManager->LoadGLTFModel("Assets/gltf_models/DamagedHelmet/glTF/DamagedHelmet.gltf"), (uint32_t)entity);
+ entity.AddComponent<ModelComponent>().AddMesh(m_AssetManager->LoadGLTFModel("Assets/gltf_models/FlightHelmet/glTF/FlightHelmet.gltf"), (uint32_t)entity);
entity.AddComponent<TextureComponent>().AddTexture(m_AssetManager->LoadTexture("Assets/Models/substance_sphere/marble/albedo.png"), 0);
entity.GetComponent<TextureComponent>().AddTexture(m_AssetManager->LoadTexture("Assets/Models/substance_sphere/ao.png"), 1);
entity.GetComponent<TextureComponent>().AddTexture(m_AssetManager->LoadTexture("Assets/Models/substance_sphere/marble/metallic.png"), 2);
@@ -243,13 +243,13 @@ namespace Albedo {
Entity Scene::CreateCubeEntity(const std::string& name)
{
Entity entity = { m_Registry.create(), this };
- entity.AddComponent<ModelComponent>().AddMesh(m_AssetManager->LoadGLTFModel("Assets/gltf_models/Cube/glTF/Cube.gltf"), (uint32_t)entity);
+ entity.AddComponent<ModelComponent>().AddMesh(m_AssetManager->LoadGLTFModel("Assets/Models/rounded_cube/rounded_cube.obj"), (uint32_t)entity);
entity.AddComponent<TransformComponent>();
entity.AddComponent<ScriptComponent>();
//entity.AddComponent<MaterialComponent>().m_Material = std::make_shared<Material>();
- entity.AddComponent<ShaderComponent>().AddShader(m_AssetManager->LoadShader("Assets/Shaders/ModelShaderBasic.glsl"));
+ entity.AddComponent<ShaderComponent>().AddShader(m_AssetManager->LoadShader("Assets/Shaders/ModelShader.glsl"));
//entity.AddComponent<MaterialComponent>().m_Material = std::make_shared<Material>();
- //entity.AddComponent<TextureComponent>().AddTexture(m_AssetManager->LoadTexture("Assets/Textures/rocky.jpg"), 0);
+ entity.AddComponent<TextureComponent>().AddTexture(m_AssetManager->LoadTexture("Assets/Textures/rocky.jpg"), 0);
entity.AddComponent<Physics2DComponent>();
entity.AddComponent<BoxCollider2DComponent>();
@@ -288,23 +288,21 @@ namespace Albedo {
return entity;
}
+
+
Entity Scene::CreateSkyboxEntity(const std::string& name)
{
Entity entity = { m_Registry.create(), this };
entity.AddComponent<TransformComponent>();
- entity.AddComponent<SkyboxComponent>();
- TextureConfiguration config{};
- config.m_MinFilter = Config::MinMagFilters::LINEAR;
- config.m_MagFilter= Config::MinMagFilters::LINEAR;
- config.m_TextureLayout = Config::TextureLayout::ClampToEdge;
- config.Path = entity.GetComponent<SkyboxComponent>().path;
- config.m_NullData = false;
- config.m_Flipped = true;
- entity.GetComponent<SkyboxComponent>().m_Skybox = Texture2D::Create(config);
- entity.GetComponent<SkyboxComponent>().m_Model = m_AssetManager->LoadGLTFModel("Assets/gltf_models/Cube/glTF/Cube.gltf");
- entity.GetComponent<SkyboxComponent>().m_Model->SetPBR(false);
- entity.AddComponent<ShaderComponent>().AddShader(m_AssetManager->LoadShader("Assets/Shaders/SkyboxShader.glsl"));
-
+ entity.AddComponent<SkyboxComponent>().faces =
+ {
+ "Assets/Textures/Skybox/lake/right.jpg",
+ "Assets/Textures/Skybox/lake/left.jpg",
+ "Assets/Textures/Skybox/lake/top.jpg",
+ "Assets/Textures/Skybox/lake/bottom.jpg",
+ "Assets/Textures/Skybox/lake/front.jpg",
+ "Assets/Textures/Skybox/lake/back.jpg"
+ };
auto& tag = entity.AddComponent<TagComponent>();
tag.Tag = name.empty() ? "Entity" : name;
return entity;
@@ -619,6 +617,11 @@ namespace Albedo {
void Scene::OnUpdateEditor(EditorCamera& camera, Timestep ts)
{
+ auto view = m_Registry.view<ShaderComponent, TransformComponent, ModelComponent,
+ TextureComponent, MaterialComponent, ScriptComponent>();
+
+ Camera* mainCamera = nullptr;
+
if (m_IsSimulating)
{
// changing to Scene Camera
@@ -648,6 +651,37 @@ namespace Albedo {
}
}
+ for (auto& entity : view)
+ {
+ auto& tex = view.get<TextureComponent>(entity);
+ //if (!view.get<MaterialComponent>(entity).isPBR) continue;
+ auto& textures = view.get<TextureComponent>(entity).m_Textures;
+ if (!textures[TextureComponent::TextureType::Albedo].get())
+ tex.AddTexture(m_AssetManager->LoadTexture("Assets/Textures/DarkGrey.jpg"), (int)TextureComponent::TextureType::Albedo);
+
+ if (!textures[TextureComponent::TextureType::AmbientOcclusion].get())
+ tex.AddTexture(m_AssetManager->LoadTexture("Assets/Textures/DarkGrey.jpg"), (int)TextureComponent::TextureType::AmbientOcclusion);
+
+ if (!textures[TextureComponent::TextureType::Metallic].get())
+ tex.AddTexture(m_AssetManager->LoadTexture("Assets/Textures/DarkGrey.jpg"), (int)TextureComponent::TextureType::Metallic);
+
+ if (!textures[TextureComponent::TextureType::Normal].get())
+ tex.AddTexture(m_AssetManager->LoadTexture("Assets/Textures/DarkGrey.jpg"), (int)TextureComponent::TextureType::Normal);
+
+ if (!textures[TextureComponent::TextureType::Roughness].get())
+ tex.AddTexture(m_AssetManager->LoadTexture("Assets/Textures/DarkGrey.jpg"), (int)TextureComponent::TextureType::Roughness);
+ }
+
+ // Checking for re initialization of meshes
+ auto meshView = m_Registry.view<ModelComponent, ShaderComponent>();
+ for (auto& entity : meshView)
+ {
+ auto& mesh = meshView.get<ModelComponent>(entity);
+ auto& shader = meshView.get<ShaderComponent>(entity);
+ //if (mesh.m_Mesh->GetInitializationStatus() || shader.m_Shader->GetInitializationStatus())
+ // Renderer::Init(m_Registry);
+ }
+
// Getting light components
auto& lightComponents = m_Registry.view<LightComponent>();
std::vector<LightComponent> lights;
@@ -668,7 +702,7 @@ namespace Albedo {
l = lights[0].position;
- //for (auto& entity : view)
+ for (auto& entity : view)
{
#if ALBEDO_PHYSX
@@ -688,7 +722,7 @@ namespace Albedo {
m_Framebuffer->Bind();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- //for (auto& entity : view)
+ for (auto& entity : view)
{
#if ALBEDO_PHYSX
auto& pos = view.get<TransformComponent>(entity).Position;
@@ -699,43 +733,28 @@ namespace Albedo {
#endif
}
- auto model_view = m_Registry.view<ModelComponent>();
- for (auto& entity : model_view) {
- if (model_view.get<ModelComponent>(entity).tobeinitialized) {
- std::string path = model_view.get<ModelComponent>(entity).m_Model->GetPath();
- model_view.get<ModelComponent>(entity).m_Model->Load(path);
- model_view.get<ModelComponent>(entity).tobeinitialized = false;
- }
- }
-
- auto shader_view = m_Registry.view<ShaderComponent>();
- for (auto& entity : shader_view) {
- if (shader_view.get<ShaderComponent>(entity).tobeinitialized) {
- std::string path = shader_view.get<ShaderComponent>(entity).m_Shader->GetPath();
- shader_view.get<ShaderComponent>(entity).m_Shader = Shader::Create(path);
- shader_view.get<ShaderComponent>(entity).tobeinitialized = false;
- }
- }
- auto skybox_view = m_Registry.view<ShaderComponent, SkyboxComponent, TransformComponent>();
- for (auto& entity : skybox_view)
- {
- glDepthMask(GL_FALSE);
- Renderer::SetupSkybox(camera, skybox_view.get<SkyboxComponent>(entity), skybox_view.get<ShaderComponent>(entity),
- skybox_view.get<TransformComponent>(entity).GetTransform());
- Renderer::Render(skybox_view.get<SkyboxComponent>(entity).m_Model, skybox_view.get<ShaderComponent>(entity).m_Shader);
- glDepthMask(GL_TRUE);
- }
-
auto temp_view = m_Registry.view<ShaderComponent, ModelComponent, TransformComponent>();
for (auto& entity : temp_view)
{
- Renderer::Setup(camera, temp_view.get<ShaderComponent>(entity).m_Shader, temp_view.get<TransformComponent>(entity).GetTransform());
- Renderer::Render(temp_view.get<ModelComponent>(entity).m_Model, temp_view.get<ShaderComponent>(entity).m_Shader);
+ //Renderer::Setup();
+
+ //if (view.get<MaterialComponent>(entity).m_Material->IsPBR())
+ {
+ //Renderer::SetupPBR(camera, (view.get<ShaderComponent>(entity)), view.get<TransformComponent>(entity),
+ // view.get<TextureComponent>(entity), view.get<MaterialComponent>(entity), lights);
+ }
+ //else if (!view.get<MaterialComponent>(entity).m_Material->IsPBR())
+ {
+ //Renderer::Setup(camera, view.get<ShaderComponent>(entity), view.get<TransformComponent>(entity),
+ // view.get<TextureComponent>(entity), view.get<MaterialComponent>(entity), lights);
+ //Renderer::SetupPlane(camera, (view.get<ShaderComponent>(entity)), view.get<TransformComponent>(entity),
+ // view.get<TextureComponent>(entity), view.get<MaterialComponent>(entity), lights, m_ShadowMap);
+ }
+ Renderer::Setup(camera, view.get<ShaderComponent>(entity).m_Shader, view.get<TransformComponent>(entity).Transform);
+ Renderer::Render(view.get<ModelComponent>(entity), view.get<ShaderComponent>(entity).m_Shader);
}
// end
return;
-
-
auto phyView = m_Registry.view<TransformComponent, BoxCollider2DComponent, Physics2DComponent>();
m_Transform = glm::mat4(1.0);
diff --git a/Albedo/src/Albedo/Scene/SceneSerializer.cpp b/Albedo/src/Albedo/Scene/SceneSerializer.cpp
index d353dcd..544f876 100644
--- a/Albedo/src/Albedo/Scene/SceneSerializer.cpp
+++ b/Albedo/src/Albedo/Scene/SceneSerializer.cpp
@@ -215,11 +215,11 @@ namespace Albedo {
out << YAML::BeginMap;
auto& skyc = entity.GetComponent<SkyboxComponent>();
int i = 1;
- //for (const auto& face : skyc.faces)
- //{
- // out << YAML::Key << "Face" + std::to_string(i) << YAML::Value << face;
- // i++;
- //}
+ for (const auto& face : skyc.faces)
+ {
+ out << YAML::Key << "Face" + std::to_string(i) << YAML::Value << face;
+ i++;
+ }
}
if (entity.HasComponent<TextureComponent>())
diff --git a/Albedo/src/Albedo/Utils/AssetSystem.cpp b/Albedo/src/Albedo/Utils/AssetSystem.cpp
index a5931aa..e48a3d8 100644
--- a/Albedo/src/Albedo/Utils/AssetSystem.cpp
+++ b/Albedo/src/Albedo/Utils/AssetSystem.cpp
@@ -333,9 +333,8 @@ namespace Albedo {
size_t pos = path.find_last_of('.');
std::string& extension = path.substr(pos + 1, path.size());
- //if (extension == "obj")
- // return true;
- if (extension == "gltf")
+ // currently only support obj
+ if (extension == "obj")
return true;
return false;
diff --git a/Albedo/src/Platform/OpenGL/OpenGLShader.h b/Albedo/src/Platform/OpenGL/OpenGLShader.h
index 3020fe7..6a67dcf 100644
--- a/Albedo/src/Platform/OpenGL/OpenGLShader.h
+++ b/Albedo/src/Platform/OpenGL/OpenGLShader.h
@@ -57,7 +57,7 @@ namespace Albedo {
unsigned int m_ShaderID;
std::string m_Name;
std::string m_Path;
- bool m_InitializationStatus = false;
+ bool m_InitializationStatus;
};
}
\ No newline at end of file
diff --git a/Albedo/src/Platform/OpenGL/OpenGLTexture.cpp b/Albedo/src/Platform/OpenGL/OpenGLTexture.cpp
index 504f209..f0d9897 100644
--- a/Albedo/src/Platform/OpenGL/OpenGLTexture.cpp
+++ b/Albedo/src/Platform/OpenGL/OpenGLTexture.cpp
@@ -34,13 +34,16 @@ namespace Albedo {
m_Height = config.m_Height;
GLenum dataFormat = Utils::AlbedoToOpenGLENUMType<Config::DataFormat>(config.m_DataFormat);
- GLenum texLayout = Utils::AlbedoToOpenGLENUMType<Config::TextureLayout>(config.m_TextureLayout);
- GLenum dataType = Utils::AlbedoToOpenGLENUMType<Config::DataType>(config.m_DataType);
- GLenum texType = Utils::AlbedoToOpenGLENUMType<Config::TextureType>(config.m_TextureType);
+ GLenum texLayout = Utils::AlbedoToOpenGLENUMType<Config::TextureLayout>(config.m_TextureLayout);
+ GLenum dataType = Utils::AlbedoToOpenGLENUMType<Config::DataType>(config.m_DataType);
+ GLenum texType = Utils::AlbedoToOpenGLENUMType<Config::TextureType>(config.m_TextureType);
- GLint inFormat = Utils::AlbedoToOpenGLINTType<Config::InternalFormat>(config.m_InternalFormat);
- GLint minFilter = Utils::AlbedoToOpenGLINTType<Config::MinMagFilters>(config.m_MinFilter);
- GLint magFilter = Utils::AlbedoToOpenGLINTType<Config::MinMagFilters>(config.m_MagFilter);
+ GLint inFormat = Utils::AlbedoToOpenGLINTType<Config::InternalFormat>(config.m_InternalFormat);
+ GLint minFilter = Utils::AlbedoToOpenGLINTType<Config::MinMagFilters>(config.m_MinFilter);
+ GLint magFilter = Utils::AlbedoToOpenGLINTType<Config::MinMagFilters>(config.m_MagFilter);
+
+ if (config.m_TextureType == Config::TextureType::Cubemap)
+ isCubemap = true;
glGenTextures(1, &m_TextureID);
glBindTexture(texType, m_TextureID);
@@ -50,54 +53,89 @@ namespace Albedo {
glTexParameteri(texType, GL_TEXTURE_WRAP_S, texLayout);
glTexParameteri(texType, GL_TEXTURE_WRAP_T, texLayout);
+ if (config.m_TextureType == Config::TextureType::Cubemap)
+ glTexParameteri(texType, GL_TEXTURE_WRAP_R, texLayout);
- if (config.m_NullData)
+ if (config.m_NullData && config.m_TextureType == Config::TextureType::Cubemap)
+ {
+ for (unsigned int i = 0; i < 6; ++i)
+ {
+ if (!config.m_Width || !config.m_Height)
+ Albedo_Core_WARN("texture width or height is zero");
+ glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, inFormat, config.m_Width, config.m_Height, 0, dataFormat, dataType, nullptr);
+ }
+ }
+ else if (config.m_NullData && config.m_TextureType == Config::TextureType::Texture2D)
{
if (!config.m_Width || !config.m_Height)
Albedo_Core_WARN("texture width or height is zero");
glTexImage2D(texType, 0, inFormat, config.m_Width, config.m_Height, 0, dataFormat, dataType, nullptr);
}
- else
+ else if (!config.m_NullData)
{
- if (config.Path.empty())
+ if (config.Path.empty() && config.Faces.empty())
Albedo_CORE_ASSERT(false, "no paths specified");
int width, height, nrChannels;
+ unsigned char* dataRGB = nullptr;
+ float* dataHDR = nullptr;
stbi_set_flip_vertically_on_load(config.m_Flipped);
-
- if (stbi_is_hdr(config.Path.c_str()))
+ if (config.m_TextureType == Config::TextureType::Texture2D)
{
- float* dataHDR = stbi_loadf(config.Path.c_str(), &width, &height, &nrChannels, 0);
- if (dataHDR) {
+ if (config.m_InternalFormat == Config::InternalFormat::RGB ||
+ config.m_InternalFormat == Config::InternalFormat::RGBA)
+ {
+ dataRGB = stbi_load(config.Path.c_str(), &width, &height, &nrChannels, 0);
+ }
+ else if (config.m_InternalFormat == Config::InternalFormat::RGB16F)
+ {
+ dataHDR = stbi_loadf(config.Path.c_str(), &width, &height, &nrChannels, 0);
+ }
+ if (dataRGB || dataHDR)
+ {
+ void* data;
+ if (dataRGB) data = dataRGB;
+ else if (dataHDR) data = dataHDR;
+
if (nrChannels == 4)
- glTexImage2D(texType, 0, GL_RGBA16F, width, height, 0, GL_RGBA, GL_FLOAT, dataHDR);
+ {
+ glTexImage2D(texType, 0, GL_RGB, width, height, 0, GL_RGBA, dataType, data);
+ }
else if (nrChannels == 3)
- glTexImage2D(texType, 0, GL_RGB16F, width, height, 0, GL_RGB, GL_FLOAT, dataHDR);
+ {
+ glTexImage2D(texType, 0, GL_RGB, width, height, 0, GL_RGB, dataType, data);
+ }
else
- glTexImage2D(texType, 0, GL_RGB16F, width, height, 0, GL_RED, GL_FLOAT, dataHDR);
- glGenerateMipmap(GL_TEXTURE_2D);
- stbi_image_free(dataHDR);
+ glTexImage2D(texType, 0, GL_RGB, width, height, 0, GL_RED, dataType, data);
+ if (config.m_TextureType == Config::TextureType::Texture2D)
+ glGenerateMipmap(GL_TEXTURE_2D);
+ stbi_image_free(data);
}
else
+ {
Albedo_Core_WARN("Failed to load texture: {}", config.Path);
+ }
+ m_Width = width;
+ m_Height = height;
}
- else
+ else if (config.m_TextureType == Config::TextureType::Cubemap)
{
- unsigned char* dataRGB = stbi_load(config.Path.c_str(), &width, &height, &nrChannels, 0);
- if (dataRGB) {
- if (nrChannels == 4)
- glTexImage2D(texType, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, dataRGB);
- else if (nrChannels == 3)
- glTexImage2D(texType, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, dataRGB);
+ Albedo_CORE_ASSERT(!config.Faces.empty(), "Invalid cubemap paths");
+ for (unsigned int i = 0; i < 6; i++)
+ {
+ unsigned char* data = stbi_load(config.Faces[i].c_str(), &width, &height, &nrChannels, 0);
+ if (data)
+ {
+ glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_RGB, width, height, 0, GL_RGB, dataType, data);
+ stbi_image_free(data);
+ }
else
- glTexImage2D(texType, 0, GL_RGB, width, height, 0, GL_RED, GL_UNSIGNED_BYTE, dataRGB);
- glGenerateMipmap(GL_TEXTURE_2D);
- stbi_image_free(dataRGB);
+ {
+ Albedo_Core_ERROR("Cubemap texture failed to load at path: ", config.Faces[i]);
+ //std::cout << "Cubemap texture failed to load at path: " << faces[i] << std::endl;
+ stbi_image_free(data);
+ }
}
- else
- Albedo_Core_WARN("Failed to load texture: {}", config.Path);
}
- m_Width = width;
- m_Height = height;
}
}
@@ -163,32 +201,19 @@ namespace Albedo {
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+ //glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
int width, height, nrChannels;
stbi_set_flip_vertically_on_load(flipped);
- void* data;
- GLenum dataType = GL_RGB;
- GLenum Format = GL_RGB;
- if (stbi_is_hdr(path.c_str())) {
- data = stbi_loadf(path.c_str(), &width, &height, &nrChannels, STBI_rgb_alpha);
- dataType = GL_FLOAT;
- if (nrChannels == 4) Format = GL_RGBA16F;
- else if (nrChannels == 3) Format = GL_RGB16F;
- }
- else {
- data = stbi_load(path.c_str(), &width, &height, &nrChannels, 0);
- dataType = GL_UNSIGNED_BYTE;
- if (nrChannels == 4) Format = GL_RGBA;
- else if (nrChannels == 3) Format = GL_RGB;
- }
+ unsigned char* data = stbi_load(path.c_str(), &width, &height, &nrChannels, 0);
if (data)
{
if(nrChannels == 4)
- glTexImage2D(GL_TEXTURE_2D, 0, Format, width, height, 0, GL_RGBA, dataType, data);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
else if(nrChannels == 3)
- glTexImage2D(GL_TEXTURE_2D, 0, Format, width, height, 0, GL_RGB, dataType, data);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data);
else
- glTexImage2D(GL_TEXTURE_2D, 0, Format, width, height, 0, GL_RED, dataType, data);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RED, GL_UNSIGNED_BYTE, data);
glGenerateMipmap(GL_TEXTURE_2D);
//glTexSubImage2D(m_TextureID, 0, 0, 0, m_Width, m_Height, GL_RGB, GL_UNSIGNED_BYTE, data);
diff --git a/AlbedoEditor/Shaders/BRDF.glsl b/AlbedoEditor/Shaders/BRDF.glsl
deleted file mode 100644
index 5a7f123..0000000
--- a/AlbedoEditor/Shaders/BRDF.glsl
+++ /dev/null
@@ -1,127 +0,0 @@
-#type vertex
-#version 330 core
-layout (location = 0) in vec3 a_Position;
-layout (location = 1) in vec2 a_UV;
-
-out vec2 TexCoords;
-
-void main()
-{
- TexCoords = a_UV;
- gl_Position = vec4(a_Position, 1.0);
-}
-
-#type fragment
-#version 330 core
-out vec2 FragColor;
-in vec2 TexCoords;
-
-const float PI = 3.14159265359;
-// ----------------------------------------------------------------------------
-// http://holger.dammertz.org/stuff/notes_HammersleyOnHemisphere.html
-// efficient VanDerCorpus calculation.
-float RadicalInverse_VdC(uint bits)
-{
- bits = (bits << 32u) | (bits >> 32u);
- bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
- bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
- bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
- bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
- return float(bits) * 2.3283064365386963e-10; // / 0x100000000
-}
-// ----------------------------------------------------------------------------
-vec2 Hammersley(uint i, uint N)
-{
- return vec2(float(i)/float(N), RadicalInverse_VdC(i));
-}
-// ----------------------------------------------------------------------------
-vec3 ImportanceSampleGGX(vec2 Xi, vec3 N, float roughness)
-{
- float a = roughness*roughness;
-
- float phi = 2.0 * PI * Xi.x;
- float cosTheta = sqrt((1.0 - Xi.y) / (1.0 + (a*a - 1.0) * Xi.y));
- float sinTheta = sqrt(1.0 - cosTheta*cosTheta);
-
- // from spherical coordinates to cartesian coordinates - halfway vector
- vec3 H;
- H.x = cos(phi) * sinTheta;
- H.y = sin(phi) * sinTheta;
- H.z = cosTheta;
-
- // from tangent-space H vector to world-space sample vector
- vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
- vec3 tangent = normalize(cross(up, N));
- vec3 bitangent = cross(N, tangent);
-
- vec3 sampleVec = tangent * H.x + bitangent * H.y + N * H.z;
- return normalize(sampleVec);
-}
-// ----------------------------------------------------------------------------
-float GeometrySchlickGGX(float NdotV, float roughness)
-{
- // note that we use a different k for IBL
- float a = roughness;
- float k = (a * a) / 2.0;
-
- float nom = NdotV;
- float denom = NdotV * (1.0 - k) + k;
-
- return nom / denom;
-}
-// ----------------------------------------------------------------------------
-float GeometrySmith(vec3 N, vec3 V, vec3 L, float roughness)
-{
- float NdotV = max(dot(N, V), 0.0);
- float NdotL = max(dot(N, L), 0.0);
- float ggx2 = GeometrySchlickGGX(NdotV, roughness);
- float ggx1 = GeometrySchlickGGX(NdotL, roughness);
-
- return ggx1 * ggx2;
-}
-// ----------------------------------------------------------------------------
-vec2 IntegrateBRDF(float NdotV, float roughness)
-{
- vec3 V;
- V.x = sqrt(1.0 - NdotV*NdotV);
- V.y = 0.0;
- V.z = NdotV;
-
- float A = 0.0;
- float B = 0.0;
-
- vec3 N = vec3(0.0, 0.0, 1.0);
-
- const uint SAMPLE_COUNT = 1024u;
- for(uint i = 0u; i < SAMPLE_COUNT; ++i)
- {
- // generates a sample vector that's biased towards the
- // preferred alignment direction (importance sampling).
- vec2 Xi = Hammersley(i, SAMPLE_COUNT);
- vec3 H = ImportanceSampleGGX(Xi, N, roughness);
- vec3 L = normalize(2.0 * dot(V, H) * H - V);
-
- float NdotL = max(L.z, 0.0);
- float NdotH = max(H.z, 0.0);
- float VdotH = max(dot(V, H), 0.0);
-
- if(NdotL > 0.0)
- {
- float G = GeometrySmith(N, V, L, roughness);
- float G_Vis = (G * VdotH) / (NdotH * NdotV);
- float Fc = pow(1.0 - VdotH, 5.0);
-
- A += (1.0 - Fc) * G_Vis;
- B += Fc * G_Vis;
- }
- }
- A /= float(SAMPLE_COUNT);
- B /= float(SAMPLE_COUNT);
- return vec2(A, B);
-}
-// ----------------------------------------------------------------------------
-void main()
-{
- vec2 integratedBRDF = IntegrateBRDF(TexCoords.x, TexCoords.y);
- FragColor = integratedBRDF;
-}
\ No newline at end of file
diff --git a/AlbedoEditor/Shaders/Background.glsl b/AlbedoEditor/Shaders/Background.glsl
deleted file mode 100644
index 7dc4c8c..0000000
--- a/AlbedoEditor/Shaders/Background.glsl
+++ /dev/null
@@ -1,36 +0,0 @@
-#type vertex
-#version 330 core
-layout (location = 0) in vec3 aPos;
-
-uniform mat4 projection;
-uniform mat4 view;
-
-out vec3 WorldPos;
-
-void main()
-{
- WorldPos = aPos;
-
- mat4 rotView = mat4(mat3(view));
- vec4 clipPos = projection * rotView * vec4(WorldPos, 1.0);
-
- gl_Position = clipPos.xyww;
-}
-
-#type fragment
-#version 330 core
-out vec4 FragColor;
-in vec3 WorldPos;
-
-uniform samplerCube environmentMap;
-uniform float darkness;
-
-void main()
-{
- vec3 envColor = textureLod(environmentMap, WorldPos, 0.0).rgb;
- // HDR tonemap and gamma correct
- envColor = envColor / (envColor + vec3(1.0));
- envColor = pow(envColor, vec3(1.0/2.2));
-
- FragColor = vec4(envColor, 1.0) * darkness;
-}
\ No newline at end of file
diff --git a/AlbedoEditor/Shaders/BatchTextureShader.glsl b/AlbedoEditor/Shaders/BatchTextureShader.glsl
deleted file mode 100644
index bf10586..0000000
--- a/AlbedoEditor/Shaders/BatchTextureShader.glsl
+++ /dev/null
@@ -1,86 +0,0 @@
-/////////////////////////////////////// - VERTEX SHADER - ///////////////////////////////////////
-#type vertex
-#version 430 core
-
-layout(location = 0) in vec3 a_Position;
-layout(location = 1) in vec4 a_Color;
-layout(location = 2) in vec2 a_TexCoord;
-layout(location = 3) in int a_TexID;
-layout(location = 4) in int a_EntityID;
-
-uniform mat4 u_ProjectionView;
-
-out vec4 v_Color;
-out vec2 v_TexCoord;
-flat out int v_TexID;
-flat out int v_EntityID;
-
-void main()
-{
- v_Color = a_Color;
- v_TexCoord = a_TexCoord;
- v_TexID = a_TexID;
- v_EntityID = a_EntityID;
- gl_Position = u_ProjectionView * vec4(a_Position, 1.0);
-}
-
-/////////////////////////////////////// - FRAGMENT SHADER - ///////////////////////////////////////
-
-#type fragment
-#version 430 core
-
-layout(location = 0) out vec4 color;
-layout(location = 1) out int color2;
-
-in vec4 v_Color;
-in vec2 v_TexCoord;
-flat in int v_TexID;
-flat in int v_EntityID;
-
-uniform vec4 u_Color;
-uniform sampler2D u_Textures[32];
-
-void main()
-{
- int v_TilingFactor = 1;
- vec4 texColor = v_Color;
-
- switch(v_TexID)
- {
- case 0: texColor *= texture(u_Textures[ 0], v_TexCoord * v_TilingFactor); break;
- case 1: texColor *= texture(u_Textures[ 1], v_TexCoord * v_TilingFactor); break;
- case 2: texColor *= texture(u_Textures[ 2], v_TexCoord * v_TilingFactor); break;
- case 3: texColor *= texture(u_Textures[ 3], v_TexCoord * v_TilingFactor); break;
- case 4: texColor *= texture(u_Textures[ 4], v_TexCoord * v_TilingFactor); break;
- case 5: texColor *= texture(u_Textures[ 5], v_TexCoord * v_TilingFactor); break;
- case 6: texColor *= texture(u_Textures[ 6], v_TexCoord * v_TilingFactor); break;
- case 7: texColor *= texture(u_Textures[ 7], v_TexCoord * v_TilingFactor); break;
- case 8: texColor *= texture(u_Textures[ 8], v_TexCoord * v_TilingFactor); break;
- case 9: texColor *= texture(u_Textures[ 9], v_TexCoord * v_TilingFactor); break;
- case 10: texColor *= texture(u_Textures[10], v_TexCoord * v_TilingFactor); break;
- case 11: texColor *= texture(u_Textures[11], v_TexCoord * v_TilingFactor); break;
- case 12: texColor *= texture(u_Textures[12], v_TexCoord * v_TilingFactor); break;
- case 13: texColor *= texture(u_Textures[13], v_TexCoord * v_TilingFactor); break;
- case 14: texColor *= texture(u_Textures[14], v_TexCoord * v_TilingFactor); break;
- case 15: texColor *= texture(u_Textures[15], v_TexCoord * v_TilingFactor); break;
- case 16: texColor *= texture(u_Textures[16], v_TexCoord * v_TilingFactor); break;
- case 17: texColor *= texture(u_Textures[17], v_TexCoord * v_TilingFactor); break;
- case 18: texColor *= texture(u_Textures[18], v_TexCoord * v_TilingFactor); break;
- case 19: texColor *= texture(u_Textures[19], v_TexCoord * v_TilingFactor); break;
- case 20: texColor *= texture(u_Textures[20], v_TexCoord * v_TilingFactor); break;
- case 21: texColor *= texture(u_Textures[21], v_TexCoord * v_TilingFactor); break;
- case 22: texColor *= texture(u_Textures[22], v_TexCoord * v_TilingFactor); break;
- case 23: texColor *= texture(u_Textures[23], v_TexCoord * v_TilingFactor); break;
- case 24: texColor *= texture(u_Textures[24], v_TexCoord * v_TilingFactor); break;
- case 25: texColor *= texture(u_Textures[25], v_TexCoord * v_TilingFactor); break;
- case 26: texColor *= texture(u_Textures[26], v_TexCoord * v_TilingFactor); break;
- case 27: texColor *= texture(u_Textures[27], v_TexCoord * v_TilingFactor); break;
- case 28: texColor *= texture(u_Textures[28], v_TexCoord * v_TilingFactor); break;
- case 29: texColor *= texture(u_Textures[29], v_TexCoord * v_TilingFactor); break;
- case 30: texColor *= texture(u_Textures[30], v_TexCoord * v_TilingFactor); break;
- case 31: texColor *= texture(u_Textures[31], v_TexCoord * v_TilingFactor); break;
- }
-
- color = texColor;
- color2 = v_EntityID;
-}
\ No newline at end of file
diff --git a/AlbedoEditor/Shaders/ColliderShader.glsl b/AlbedoEditor/Shaders/ColliderShader.glsl
deleted file mode 100644
index bc69199..0000000
--- a/AlbedoEditor/Shaders/ColliderShader.glsl
+++ /dev/null
@@ -1,20 +0,0 @@
-#type vertex
-#version 330 core
-layout (location = 0) in vec3 a_Position;
-
-uniform mat4 u_ProjectionView;
-uniform mat4 u_Transform;