Nvidia cards not yet supported, Nvidia drivers are so gosh darn strict

This commit is contained in:
Ben
2019-03-02 21:07:00 +00:00
parent 2b900c9b1f
commit 8a860bcd7f
16 changed files with 165650 additions and 165639 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,22 +1,22 @@
#version 330
layout (location = 0) in vec3 position;
layout (location = 1) in vec3 normal;
layout (location = 2) in vec3 texCoord;
out vec3 Normal;
out vec3 FragPos;
// out vec4 FragPosLightSpace;
uniform mat4 model;
uniform mat4 view;
uniform mat4 proj;
// uniform mat4 lightSpaceMatrix;
void main() {
gl_Position = proj * view * model * vec4(position, 1.0);
FragPos = vec3(model * vec4(position, 1.0));
// FragPosLightSpace = lightSpaceMatrix * vec4(FragPos, 1.0);
Normal = mat3(model) * normal;
}
#version 330
layout (location = 0) in vec3 position;
layout (location = 1) in vec3 normal;
layout (location = 2) in vec3 texCoord;
out vec3 Normal;
out vec3 FragPos;
// out vec4 FragPosLightSpace;
uniform mat4 model;
uniform mat4 view;
uniform mat4 proj;
// uniform mat4 lightSpaceMatrix;
void main() {
gl_Position = proj * view * model * vec4(position, 1.0);
FragPos = vec3(model * vec4(position, 1.0));
// FragPosLightSpace = lightSpaceMatrix * vec4(FragPos, 1.0);
Normal = mat3(model) * normal;
}

View File

@@ -1,316 +1,316 @@
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 26.07.2011 17:00:30
newmtl sp_00_luk_mali
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.745098 0.709804 0.674510
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka SP_LUK.JPG
map_Kd SP_LUK.JPG
map_bump sp_luk-bump.JPG
bump sp_luk-bump.JPG
newmtl sp_svod_kapitel
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.713726 0.705882 0.658824
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 00_SKAP.JPG
map_Kd 00_SKAP.JPG
map_bump 00_SKAP.JPG
bump 00_SKAP.JPG
newmtl sp_01_stub_baza_
Ns 19.999998
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.784314 0.784314 0.784314
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
newmtl sp_01_stub_kut
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.737255 0.709804 0.670588
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 01_STUB.JPG
map_Kd 01_STUB.JPG
map_bump 01_STUB-bump.jpg
bump 01_STUB-bump.jpg
newmtl sp_00_stup
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.737255 0.709804 0.670588
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 01_STUB.JPG
map_Kd 01_STUB.JPG
map_bump 01_STUB-bump.jpg
bump 01_STUB-bump.jpg
newmtl sp_01_stub_baza
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.800000 0.784314 0.749020
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 01_S_BA.JPG
map_Kd 01_S_BA.JPG
map_bump 01_S_BA.JPG
bump 01_S_BA.JPG
newmtl sp_00_luk_mal1
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.745098 0.709804 0.674510
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 01_ST_KP.JPG
map_Kd 01_ST_KP.JPG
map_bump 01_St_kp-bump.jpg
bump 01_St_kp-bump.jpg
newmtl sp_01_stub
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.737255 0.709804 0.670588
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 01_STUB.JPG
map_Kd 01_STUB.JPG
map_bump 01_STUB-bump.jpg
bump 01_STUB-bump.jpg
newmtl sp_01_stup
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.827451 0.800000 0.768628
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka X01_ST.JPG
map_Kd X01_ST.JPG
newmtl sp_vijenac
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.713726 0.705882 0.658824
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 00_SKAP.JPG
map_Kd 00_SKAP.JPG
map_bump 00_SKAP.JPG
bump 00_SKAP.JPG
newmtl sp_00_svod
Ns 1.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.145098 0.145098 0.145098
Kd 0.941177 0.866667 0.737255
Ks 0.034039 0.032314 0.029333
Ke 0.000000 0.000000 0.000000
map_Kd KAMEN-stup.JPG
map_Ka KAMEN-stup.JPG
map_bump KAMEN-stup.jpg
bump KAMEN-stup.jpg
newmtl sp_02_reljef
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.529412 0.498039 0.490196
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka RELJEF.JPG
map_Kd RELJEF.JPG
map_bump reljef-bump.jpg
bump reljef-bump.jpg
newmtl sp_01_luk_a
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.745098 0.709804 0.674510
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka SP_LUK.JPG
map_Kd SP_LUK.JPG
map_bump sp_luk-bump.JPG
bump sp_luk-bump.JPG
newmtl sp_zid_vani
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.627451 0.572549 0.560784
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka KAMEN.JPG
map_Kd KAMEN.JPG
map_bump KAMEN-bump.jpg
bump KAMEN-bump.jpg
newmtl sp_01_stup_baza
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.800000 0.784314 0.749020
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 01_S_BA.JPG
map_Kd 01_S_BA.JPG
map_bump 01_S_BA.JPG
bump 01_S_BA.JPG
newmtl sp_00_zid
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.627451 0.572549 0.560784
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka KAMEN.JPG
map_Kd KAMEN.JPG
map_bump KAMEN-bump.jpg
bump KAMEN-bump.jpg
newmtl sp_00_prozor
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 1.000000 1.000000 1.000000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka PROZOR1.JPG
map_Kd PROZOR1.JPG
map_bump PROZOR1.JPG
bump PROZOR1.JPG
newmtl sp_00_vrata_krug
Ns 19.999998
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.784314 0.784314 0.784314
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka VRATA_KR.JPG
map_Kd VRATA_KR.JPG
map_bump VRATA_KR.JPG
bump VRATA_KR.JPG
newmtl sp_00_pod
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.627451 0.572549 0.560784
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka KAMEN.JPG
map_Kd KAMEN.JPG
map_bump KAMEN-bump.jpg
bump KAMEN-bump.jpg
newmtl sp_00_vrata_kock
Ns 19.999998
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.784314 0.784314 0.784314
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka VRATA_KO.JPG
map_Kd VRATA_KO.JPG
map_bump VRATA_KO.JPG
bump VRATA_KO.JPG
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
# File Created: 26.07.2011 17:00:30
newmtl sp_00_luk_mali
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.745098 0.709804 0.674510
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka SP_LUK.JPG
map_Kd SP_LUK.JPG
map_bump sp_luk-bump.JPG
bump sp_luk-bump.JPG
newmtl sp_svod_kapitel
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.713726 0.705882 0.658824
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 00_SKAP.JPG
map_Kd 00_SKAP.JPG
map_bump 00_SKAP.JPG
bump 00_SKAP.JPG
newmtl sp_01_stub_baza_
Ns 19.999998
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.784314 0.784314 0.784314
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
newmtl sp_01_stub_kut
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.737255 0.709804 0.670588
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 01_STUB.JPG
map_Kd 01_STUB.JPG
map_bump 01_STUB-bump.jpg
bump 01_STUB-bump.jpg
newmtl sp_00_stup
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.737255 0.709804 0.670588
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 01_STUB.JPG
map_Kd 01_STUB.JPG
map_bump 01_STUB-bump.jpg
bump 01_STUB-bump.jpg
newmtl sp_01_stub_baza
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.800000 0.784314 0.749020
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 01_S_BA.JPG
map_Kd 01_S_BA.JPG
map_bump 01_S_BA.JPG
bump 01_S_BA.JPG
newmtl sp_00_luk_mal1
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.745098 0.709804 0.674510
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 01_ST_KP.JPG
map_Kd 01_ST_KP.JPG
map_bump 01_St_kp-bump.jpg
bump 01_St_kp-bump.jpg
newmtl sp_01_stub
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.737255 0.709804 0.670588
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 01_STUB.JPG
map_Kd 01_STUB.JPG
map_bump 01_STUB-bump.jpg
bump 01_STUB-bump.jpg
newmtl sp_01_stup
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.827451 0.800000 0.768628
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka X01_ST.JPG
map_Kd X01_ST.JPG
newmtl sp_vijenac
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.713726 0.705882 0.658824
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 00_SKAP.JPG
map_Kd 00_SKAP.JPG
map_bump 00_SKAP.JPG
bump 00_SKAP.JPG
newmtl sp_00_svod
Ns 1.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.145098 0.145098 0.145098
Kd 0.941177 0.866667 0.737255
Ks 0.034039 0.032314 0.029333
Ke 0.000000 0.000000 0.000000
map_Kd KAMEN-stup.JPG
map_Ka KAMEN-stup.JPG
map_bump KAMEN-stup.jpg
bump KAMEN-stup.jpg
newmtl sp_02_reljef
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.529412 0.498039 0.490196
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka RELJEF.JPG
map_Kd RELJEF.JPG
map_bump reljef-bump.jpg
bump reljef-bump.jpg
newmtl sp_01_luk_a
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.745098 0.709804 0.674510
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka SP_LUK.JPG
map_Kd SP_LUK.JPG
map_bump sp_luk-bump.JPG
bump sp_luk-bump.JPG
newmtl sp_zid_vani
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.627451 0.572549 0.560784
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka KAMEN.JPG
map_Kd KAMEN.JPG
map_bump KAMEN-bump.jpg
bump KAMEN-bump.jpg
newmtl sp_01_stup_baza
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.800000 0.784314 0.749020
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka 01_S_BA.JPG
map_Kd 01_S_BA.JPG
map_bump 01_S_BA.JPG
bump 01_S_BA.JPG
newmtl sp_00_zid
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.627451 0.572549 0.560784
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka KAMEN.JPG
map_Kd KAMEN.JPG
map_bump KAMEN-bump.jpg
bump KAMEN-bump.jpg
newmtl sp_00_prozor
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 1.000000 1.000000 1.000000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka PROZOR1.JPG
map_Kd PROZOR1.JPG
map_bump PROZOR1.JPG
bump PROZOR1.JPG
newmtl sp_00_vrata_krug
Ns 19.999998
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.784314 0.784314 0.784314
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka VRATA_KR.JPG
map_Kd VRATA_KR.JPG
map_bump VRATA_KR.JPG
bump VRATA_KR.JPG
newmtl sp_00_pod
Ns 50.000000
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.627451 0.572549 0.560784
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka KAMEN.JPG
map_Kd KAMEN.JPG
map_bump KAMEN-bump.jpg
bump KAMEN-bump.jpg
newmtl sp_00_vrata_kock
Ns 19.999998
Ni 1.500000
d 1.000000
Tr 0.000000
Tf 1.000000 1.000000 1.000000
illum 2
Ka 0.000000 0.000000 0.000000
Kd 0.784314 0.784314 0.784314
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
map_Ka VRATA_KO.JPG
map_Kd VRATA_KO.JPG
map_bump VRATA_KO.JPG
bump VRATA_KO.JPG

File diff suppressed because it is too large Load Diff

View File

@@ -1,39 +1,39 @@
# Blender v2.79 (sub 0) OBJ File: ''
# www.blender.org
mtllib test.mtl
o Cube
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -0.999999
v 0.985777 1.192230 2.337569
v -1.377941 1.709185 1.023966
v -1.000000 1.000000 -1.000000
v 0.517399 2.721372 1.811071
v -1.866757 2.621557 0.910967
v 0.548957 1.837827 -1.224019
v -1.690411 2.280694 -1.395202
v -0.783580 1.471610 2.999746
v -1.362162 2.293163 2.078320
v -0.980705 2.326940 1.789054
vn 0.0000 -1.0000 0.0000
vn 0.1613 0.9751 -0.1521
vn 1.0000 0.0026 0.0026
vn -0.3069 -0.2775 0.9104
vn -0.9937 -0.0793 -0.0793
vn 0.0000 0.0000 -1.0000
vn -0.4940 -0.8691 -0.0268
usemtl Material
s off
f 1//1 2//1 3//1 4//1
f 5//2 8//2 7//2 6//2
f 1//3 5//3 6//3 2//3
f 2//4 6//4 7//4 3//4
f 3//5 7//5 8//5 4//5
f 5//6 1//6 4//6 8//6
f 6//7 13//7 14//7 15//7 7//7
l 6 9
l 7 10
l 5 11
l 8 12
# Blender v2.79 (sub 0) OBJ File: ''
# www.blender.org
mtllib test.mtl
o Cube
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -0.999999
v 0.985777 1.192230 2.337569
v -1.377941 1.709185 1.023966
v -1.000000 1.000000 -1.000000
v 0.517399 2.721372 1.811071
v -1.866757 2.621557 0.910967
v 0.548957 1.837827 -1.224019
v -1.690411 2.280694 -1.395202
v -0.783580 1.471610 2.999746
v -1.362162 2.293163 2.078320
v -0.980705 2.326940 1.789054
vn 0.0000 -1.0000 0.0000
vn 0.1613 0.9751 -0.1521
vn 1.0000 0.0026 0.0026
vn -0.3069 -0.2775 0.9104
vn -0.9937 -0.0793 -0.0793
vn 0.0000 0.0000 -1.0000
vn -0.4940 -0.8691 -0.0268
usemtl Material
s off
f 1//1 2//1 3//1 4//1
f 5//2 8//2 7//2 6//2
f 1//3 5//3 6//3 2//3
f 2//4 6//4 7//4 3//4
f 3//5 7//5 8//5 4//5
f 5//6 1//6 4//6 8//6
f 6//7 13//7 14//7 15//7 7//7
l 6 9
l 7 10
l 5 11
l 8 12

View File

@@ -1,88 +1,88 @@
#include "camera.h"
Camera::Camera() {
}
void Camera::updateView() {
//roll can be removed from here. because is not actually used in FPS camera
glm::mat4 matRoll = glm::mat4(1.0f);//identity matrix;
glm::mat4 matPitch = glm::mat4(1.0f);//identity matrix
glm::mat4 matYaw = glm::mat4(1.0f);//identity matrix
//roll, pitch and yaw are used to store our angles in our class
matRoll = glm::rotate(matRoll, roll, glm::vec3(0.0f, 0.0f, 1.0f));
matPitch = glm::rotate(matPitch, pitch, glm::vec3(1.0f, 0.0f, 0.0f));
matYaw = glm::rotate(matYaw, yaw, glm::vec3(0.0f, 1.0f, 0.0f));
//order matters
glm::mat4 rotate = matRoll * matPitch * matYaw;
glm::mat4 translate = glm::mat4(1.0f);
translate = glm::translate(translate, -eyeVector);
viewMatrix = rotate * translate;
}
glm::mat4 Camera::getViewMatrix() {
return viewMatrix;
}
glm::vec3 Camera::getPos() {
return eyeVector;
}
void Camera::handleMouse(SDL_Event e) {
if (e.type != SDL_MOUSEMOTION)
return;
float mouseDX = e.motion.xrel;
float mouseDY = e.motion.yrel;
glm::vec2 mouseDelta {mouseDX, mouseDY};
mouseMoved(mouseDelta);
}
void Camera::moveCamera() {
float dx = 0; //how much we strafe on x
float dz = 0; //how much we walk on z
const Uint8* state = SDL_GetKeyboardState(NULL);
if (state[SDL_SCANCODE_W])
dz += 2;
if (state[SDL_SCANCODE_S])
dz += -2;
if (state[SDL_SCANCODE_A])
dx += -2;
if (state[SDL_SCANCODE_D])
dx += 2;
// if (state[SDL_SCANCODE_Z])
// if (state[SDL_SCANCODE_LSHIFT])
//get current view matrix
glm::mat4 mat = getViewMatrix();
//row major
glm::vec3 forward(mat[0][2], mat[1][2], mat[2][2]);
glm::vec3 strafe( mat[0][0], mat[1][0], mat[2][0]);
//forward vector must be negative to look forward.
//read :http://in2gpu.com/2015/05/17/view-matrix/
eyeVector += (-dz * forward + dx * strafe) * cameraSpeed;
//update the view matrix
updateView();
}
void Camera::mouseMoved(glm::vec2 mouseDelta) {
//note that yaw and pitch must be converted to radians.
//this is done in UpdateView() by glm::rotate
yaw += mouseSensitivity * mouseDelta.x;
pitch += mouseSensitivity * mouseDelta.y;
updateView();
}
#include "camera.h"
Camera::Camera() {
}
void Camera::updateView() {
//roll can be removed from here. because is not actually used in FPS camera
glm::mat4 matRoll = glm::mat4(1.0f);//identity matrix;
glm::mat4 matPitch = glm::mat4(1.0f);//identity matrix
glm::mat4 matYaw = glm::mat4(1.0f);//identity matrix
//roll, pitch and yaw are used to store our angles in our class
matRoll = glm::rotate(matRoll, roll, glm::vec3(0.0f, 0.0f, 1.0f));
matPitch = glm::rotate(matPitch, pitch, glm::vec3(1.0f, 0.0f, 0.0f));
matYaw = glm::rotate(matYaw, yaw, glm::vec3(0.0f, 1.0f, 0.0f));
//order matters
glm::mat4 rotate = matRoll * matPitch * matYaw;
glm::mat4 translate = glm::mat4(1.0f);
translate = glm::translate(translate, -eyeVector);
viewMatrix = rotate * translate;
}
glm::mat4 Camera::getViewMatrix() {
return viewMatrix;
}
glm::vec3 Camera::getPos() {
return eyeVector;
}
void Camera::handleMouse(SDL_Event e) {
if (e.type != SDL_MOUSEMOTION)
return;
float mouseDX = e.motion.xrel;
float mouseDY = e.motion.yrel;
glm::vec2 mouseDelta {mouseDX, mouseDY};
mouseMoved(mouseDelta);
}
void Camera::moveCamera() {
float dx = 0; //how much we strafe on x
float dz = 0; //how much we walk on z
const Uint8* state = SDL_GetKeyboardState(NULL);
if (state[SDL_SCANCODE_W])
dz += 2;
if (state[SDL_SCANCODE_S])
dz += -2;
if (state[SDL_SCANCODE_A])
dx += -2;
if (state[SDL_SCANCODE_D])
dx += 2;
// if (state[SDL_SCANCODE_Z])
// if (state[SDL_SCANCODE_LSHIFT])
//get current view matrix
glm::mat4 mat = getViewMatrix();
//row major
glm::vec3 forward(mat[0][2], mat[1][2], mat[2][2]);
glm::vec3 strafe (mat[0][0], mat[1][0], mat[2][0]);
//forward vector must be negative to look forward.
//read :http://in2gpu.com/2015/05/17/view-matrix/
eyeVector += (-dz * forward + dx * strafe) * cameraSpeed;
//update the view matrix
updateView();
}
void Camera::mouseMoved(glm::vec2 mouseDelta) {
//note that yaw and pitch must be converted to radians.
//this is done in UpdateView() by glm::rotate
yaw += mouseSensitivity * mouseDelta.x;
pitch += mouseSensitivity * mouseDelta.y;
updateView();
}

View File

@@ -1,31 +1,35 @@
#ifndef SMHENGINE_SRC_CAMERA_H_
#define SMHENGINE_SRC_CAMERA_H_
#include <SDL2/SDL.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
class Camera {
public:
Camera();
void updateView();
glm::mat4 getViewMatrix();
glm::vec3 getPos();
void handleMouse(SDL_Event e);
void moveCamera();
void mouseMoved(glm::vec2 mouseDelta);
float mouseSensitivity = 0.0025f;
float cameraSpeed = 1.12f;
private:
float roll, pitch, yaw;
glm::vec3 eyeVector;
glm::mat4 viewMatrix;
};
#endif
#ifndef SMHENGINE_SRC_CAMERA_H_
#define SMHENGINE_SRC_CAMERA_H_
#if _WIN32
#include <SDL.h>
#else
#include <SDL2/SDL.h>
#endif
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
class Camera {
public:
Camera();
void updateView();
glm::mat4 getViewMatrix();
glm::vec3 getPos();
void handleMouse(SDL_Event e);
void moveCamera();
void mouseMoved(glm::vec2 mouseDelta);
float mouseSensitivity = 0.0025f;
float cameraSpeed = 1.12f;
private:
float roll, pitch, yaw;
glm::vec3 eyeVector;
glm::mat4 viewMatrix;
};
#endif

View File

@@ -11,6 +11,7 @@
#include <logger.h>
#include "display.h"
#include "camera.h"
#include "shader.h"
#include "model.h"
@@ -38,12 +39,15 @@ int main (int argc, char** argv) {
SDL_Event e;
while (!display.isClosed) {
camera.moveCamera();
while (SDL_PollEvent(&e)) {
camera.handleMouse(e);
if (e.type == SDL_QUIT || e.key.keysym.sym == SDLK_ESCAPE)
if (e.type == SDL_QUIT)
display.isClosed = true;
if (e.key.keysym.sym == SDLK_t) {
SDL_SetRelativeMouseMode(SDL_GetRelativeMouseMode() == SDL_TRUE ? SDL_FALSE : SDL_TRUE);
}
camera.handleMouse(e);
}
const Uint8* state = SDL_GetKeyboardState(NULL);
@@ -57,11 +61,12 @@ int main (int argc, char** argv) {
}
mesh.bind();
mesh.render(shader, camera);`
mesh.render(shader, camera);
mesh.unbind();
display.update();
}
}
return 0;
}

View File

@@ -1,4 +1,5 @@
#include "mesh.h"
#include "camera.h"
Mesh::Mesh() {

View File

@@ -13,10 +13,11 @@
#include <tiny_obj_loader.h>
#include <logger.h>
#include "camera.h"
#include "shader.h"
#include "./util/util.h"
class Camera;
// Not in use yet
// Will be used as a vector, enabling
// the use of strides when sending the

View File

@@ -1,3 +1,3 @@
#include "model.h"
#include "model.h"

View File

@@ -1,26 +1,26 @@
#ifndef SMHENGINE_SRC_MODEL_H_
#define SMHENGINE_SRC_MODEL_H_
#include <string>
#include <vector>
#include <glad/glad.hpp>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <logger.h>
#include "mesh.h"
#include "material.h"
class Model {
public:
Model();
Model(std::string loadPath);
std::vector<std::pair<Mesh, Material>> modelData;
};
#endif
#ifndef SMHENGINE_SRC_MODEL_H_
#define SMHENGINE_SRC_MODEL_H_
#include <string>
#include <vector>
#include <glad/glad.hpp>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <logger.h>
#include "mesh.h"
#include "material.h"
class Model {
public:
Model();
Model(std::string loadPath);
std::vector<std::pair<Mesh, Material>> modelData;
};
#endif

View File

@@ -1,28 +1,28 @@
#ifndef SMHENGINE_SRC_OBJECT_H_
#define SMHENGINE_SRC_OBJECT_H_
#include <string>
#include <vector>
#include <glad/glad.hpp>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <OBJLoader.h>
#include <logger.h>
#include "model.h"
#include "shader.h"
class Object {
public:
Object();
std::vector<Model> models;
std::vector<Shader> shaders;
};
#endif
#ifndef SMHENGINE_SRC_OBJECT_H_
#define SMHENGINE_SRC_OBJECT_H_
#include <string>
#include <vector>
#include <glad/glad.hpp>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <OBJLoader.h>
#include <logger.h>
#include "model.h"
#include "shader.h"
class Object {
public:
Object();
std::vector<Model> models;
std::vector<Shader> shaders;
};
#endif

View File

@@ -1,2 +1,2 @@
#define TINYOBJLOADER_IMPLEMENTATION // define this in only *one* .cc
#include "tiny_obj_loader.h"
#define TINYOBJLOADER_IMPLEMENTATION // define this in only *one* .cc
#include "tiny_obj_loader.h"

View File

@@ -1,79 +1,79 @@
#include "util.h"
#include <unordered_map>
#include <logger.h>
#include "../mesh.h"
void OBJLtoGLM(ObjLMesh& mesh,
std::vector<glm::vec3>& outVert,
std::vector<glm::vec3>& outNorm,
std::vector<glm::vec3>& outTexCoord,
std::vector<GLuint>& outIndices) {
std::unordered_map<glm::vec3, uint64_t> uniqueVertices {{{1.0f, 1.0f, 1.0f}, 1}};
for (const auto &shape : mesh.shapes) {
for (const auto& index : shape.mesh.indices) {
glm::vec3 vertex {
mesh.attrib.vertices[3 * index.vertex_index + 0],
mesh.attrib.vertices[3 * index.vertex_index + 1],
mesh.attrib.vertices[3 * index.vertex_index + 2]
};
// outNorm.push_back({
// mesh.attrib.normals[3 * index.normal_index + 0],
// mesh.attrib.normals[3 * index.normal_index + 1],
// mesh.attrib.normals[3 * index.normal_index + 2]
// });
// outTexCoord.push_back({
// mesh.attrib.texcoords[2 * index.texcoord_index + 0],
// mesh.attrib.texcoords[2 * index.texcoord_index + 1],
// 0.0f
// });
if (uniqueVertices.count(vertex) == 0) {
uniqueVertices[vertex] = static_cast<uint32_t>(outVert.size());
outVert.push_back(vertex);
}
outIndices.push_back(uniqueVertices[vertex]);
}
}
ComputeNormals(outNorm, outVert, outIndices);
}
void ComputeNormals(std::vector<glm::vec3>& normals,
std::vector<glm::vec3>& vertices,
std::vector<GLuint>& elements) {
normals.resize(vertices.size(), glm::vec3(0.0, 0.0, 0.0));
for (int i = 0; i < elements.size(); i += 3) {
GLushort ia = elements[i];
GLushort ib = elements[i+1];
GLushort ic = elements[i+2];
glm::vec3 normal = glm::normalize(glm::cross(
glm::vec3(vertices[ib]) - glm::vec3(vertices[ia]),
glm::vec3(vertices[ic]) - glm::vec3(vertices[ia])));
normals[ia] = normals[ib] = normals[ic] = normal;
}
}
void UintToGLuint(ObjLMesh& mesh,
std::vector<GLuint>& outIndices) {
}
// void OBJLVec3toGLM(objl::Vector3& inVec, glm::vec3& outVec) {
// outVec.x = inVec.X;
// outVec.y = inVec.Y;
// outVec.z = inVec.Z;
// }
#include "util.h"
#include <unordered_map>
#include <logger.h>
#include "../mesh.h"
void OBJLtoGLM(ObjLMesh& mesh,
std::vector<glm::vec3>& outVert,
std::vector<glm::vec3>& outNorm,
std::vector<glm::vec3>& outTexCoord,
std::vector<GLuint>& outIndices) {
std::unordered_map<glm::vec3, uint64_t> uniqueVertices {{{1.0f, 1.0f, 1.0f}, 1}};
for (const auto &shape : mesh.shapes) {
for (const auto& index : shape.mesh.indices) {
glm::vec3 vertex {
mesh.attrib.vertices[3 * index.vertex_index + 0],
mesh.attrib.vertices[3 * index.vertex_index + 1],
mesh.attrib.vertices[3 * index.vertex_index + 2]
};
// outNorm.push_back({
// mesh.attrib.normals[3 * index.normal_index + 0],
// mesh.attrib.normals[3 * index.normal_index + 1],
// mesh.attrib.normals[3 * index.normal_index + 2]
// });
// outTexCoord.push_back({
// mesh.attrib.texcoords[2 * index.texcoord_index + 0],
// mesh.attrib.texcoords[2 * index.texcoord_index + 1],
// 0.0f
// });
if (uniqueVertices.count(vertex) == 0) {
uniqueVertices[vertex] = static_cast<uint32_t>(outVert.size());
outVert.push_back(vertex);
}
outIndices.push_back(uniqueVertices[vertex]);
}
}
ComputeNormals(outNorm, outVert, outIndices);
}
void ComputeNormals(std::vector<glm::vec3>& normals,
std::vector<glm::vec3>& vertices,
std::vector<GLuint>& elements) {
normals.resize(vertices.size(), glm::vec3(0.0, 0.0, 0.0));
for (int i = 0; i < elements.size(); i += 3) {
GLushort ia = elements[i];
GLushort ib = elements[i+1];
GLushort ic = elements[i+2];
glm::vec3 normal = glm::normalize(glm::cross(
glm::vec3(vertices[ib]) - glm::vec3(vertices[ia]),
glm::vec3(vertices[ic]) - glm::vec3(vertices[ia])));
normals[ia] = normals[ib] = normals[ic] = normal;
}
}
void UintToGLuint(ObjLMesh& mesh,
std::vector<GLuint>& outIndices) {
}
// void OBJLVec3toGLM(objl::Vector3& inVec, glm::vec3& outVec) {
// outVec.x = inVec.X;
// outVec.y = inVec.Y;
// outVec.z = inVec.Z;
// }

View File

@@ -1,34 +1,34 @@
#ifndef SMHENGINE_SRC_UTIL_UTIL_H_
#define SMHENGINE_SRC_UTIL_UTUL_H_
#include <glad/glad.hpp>
// This is so that i can use
// glm::vec3 inside of an
// std::unordered_map as it's
// experimental for some reason
// smh
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/hash.hpp>
#include <glm/glm.hpp>
#include <vector>
#include <tiny_obj_loader.h>
struct ObjLMesh;
void OBJLtoGLM(ObjLMesh& mesh,
std::vector<glm::vec3>& outVert,
std::vector<glm::vec3>& outNorm,
std::vector<glm::vec3>& outTexCoord,
std::vector<GLuint>& outIndices);
void ComputeNormals(std::vector<glm::vec3>& normals,
std::vector<glm::vec3>& vertices,
std::vector<GLuint>& elements);
void UintToGLuint(ObjLMesh& mesh,
std::vector<GLuint>& outIndices);
// void OBJLVec3toGLM(objl::Vector3& inVec, glm::vec3& outVec);
#endif
#ifndef SMHENGINE_SRC_UTIL_UTIL_H_
#define SMHENGINE_SRC_UTIL_UTUL_H_
#include <glad/glad.hpp>
// This is so that i can use
// glm::vec3 inside of an
// std::unordered_map as it's
// experimental for some reason
// smh
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/hash.hpp>
#include <glm/glm.hpp>
#include <vector>
#include <tiny_obj_loader.h>
struct ObjLMesh;
void OBJLtoGLM(ObjLMesh& mesh,
std::vector<glm::vec3>& outVert,
std::vector<glm::vec3>& outNorm,
std::vector<glm::vec3>& outTexCoord,
std::vector<GLuint>& outIndices);
void ComputeNormals(std::vector<glm::vec3>& normals,
std::vector<glm::vec3>& vertices,
std::vector<GLuint>& elements);
void UintToGLuint(ObjLMesh& mesh,
std::vector<GLuint>& outIndices);
// void OBJLVec3toGLM(objl::Vector3& inVec, glm::vec3& outVec);
#endif