Compare commits

...

16 Commits

49 changed files with 2337 additions and 437 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,37 +1,92 @@
{
"Version": 1,
"WorkspaceRootPath": "D:\\STUDIA_sem5\\GRAFIKA-PROJEKT\\grk\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|D:\\STUDIA_sem5\\GRAFIKA-PROJEKT\\grk\\projekt_grk\\src\\ex_7_1.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\src\\ex_7_1.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 0,
"Children": [
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "ex_7_1.hpp",
"DocumentMoniker": "D:\\STUDIA_sem5\\GRAFIKA-PROJEKT\\grk\\projekt_grk\\src\\ex_7_1.hpp",
"RelativeDocumentMoniker": "projekt_grk\\src\\ex_7_1.hpp",
"ToolTip": "D:\\STUDIA_sem5\\GRAFIKA-PROJEKT\\grk\\projekt_grk\\src\\ex_7_1.hpp",
"RelativeToolTip": "projekt_grk\\src\\ex_7_1.hpp",
"ViewState": "AQIAABICAAAAAAAAAAAAAEoCAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-02-27T10:49:30.827Z",
"EditorCaption": ""
}
]
}
]
}
]
{
"Version": 1,
"WorkspaceRootPath": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.vert||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\shaders\\shader_5_1_tex_copy.vert||{8B382828-6202-11D1-8870-0000F87579D2}"
},
{
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.frag||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\shaders\\shader_5_1_tex_copy.frag||{8B382828-6202-11D1-8870-0000F87579D2}"
},
{
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\src\\ex_7_1.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\src\\ex_7_1.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
},
{
"AbsoluteMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_pbr.frag||{8B382828-6202-11D1-8870-0000F87579D2}",
"RelativeMoniker": "D:0:0:{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}|projekt_grk\\grk-cw7.vcxproj|solutionrelative:projekt_grk\\shaders\\shader_pbr.frag||{8B382828-6202-11D1-8870-0000F87579D2}"
}
],
"DocumentGroupContainers": [
{
"Orientation": 0,
"VerticalTabListWidth": 256,
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 1,
"Children": [
{
"$type": "Bookmark",
"Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}"
},
{
"$type": "Document",
"DocumentIndex": 0,
"Title": "shader_5_1_tex_copy.vert",
"DocumentMoniker": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.vert",
"RelativeDocumentMoniker": "projekt_grk\\shaders\\shader_5_1_tex_copy.vert",
"ToolTip": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.vert",
"RelativeToolTip": "projekt_grk\\shaders\\shader_5_1_tex_copy.vert",
"ViewState": "AQIAAAkAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-03-01T18:58:34.685Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"Title": "shader_5_1_tex_copy.frag",
"DocumentMoniker": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.frag",
"RelativeDocumentMoniker": "projekt_grk\\shaders\\shader_5_1_tex_copy.frag",
"ToolTip": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_5_1_tex_copy.frag",
"RelativeToolTip": "projekt_grk\\shaders\\shader_5_1_tex_copy.frag",
"ViewState": "AQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-03-01T18:58:31.038Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "shader_pbr.frag",
"DocumentMoniker": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_pbr.frag",
"RelativeDocumentMoniker": "projekt_grk\\shaders\\shader_pbr.frag",
"ToolTip": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\shaders\\shader_pbr.frag",
"RelativeToolTip": "projekt_grk\\shaders\\shader_pbr.frag",
"ViewState": "AQIAABgAAAAAAAAAAAAowC0AAAAfAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.001001|",
"WhenOpened": "2024-03-01T18:45:46.425Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "ex_7_1.hpp",
"DocumentMoniker": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\src\\ex_7_1.hpp",
"RelativeDocumentMoniker": "projekt_grk\\src\\ex_7_1.hpp",
"ToolTip": "D:\\STUDIA_sem5\\GRK_FINAL_PULL\\Grafika_2024\\projekt_grk\\src\\ex_7_1.hpp",
"RelativeToolTip": "projekt_grk\\src\\ex_7_1.hpp",
"ViewState": "AQIAAC4BAAAAAAAAAAAgwEMBAAAXAAAA",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|",
"WhenOpened": "2024-03-01T18:40:57.457Z",
"EditorCaption": ""
}
]
}
]
}
]
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

19
README.md Normal file
View File

@ -0,0 +1,19 @@
# Projekt z grafika komputerowa
### Skład zespołu
1. Mikołaj Gawor
2. Maksymilian Mikołajczak
3. Kamil Ryżek
### Ogólny opis projektu
Jest to symulacja lotu statkiem przez układ słoneczny. Gracz ma za zadanie zebrać monety i jednocześnie unikać zderzenie z planetami.
### Wykorzystane techniki grafikii komputerowej
1. Skybox
2. Realistyczne tekstury planet dzięki normal mapping
3. Cienie planet
4. Bloom słońca
5. PBR wykorzystany do realistycznego oświetlenia statku kosmicznego.
### Link do prezentacji
https://youtu.be/gSAoen5C_co

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,19 +1,25 @@
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(531,5): warning MSB8028: Katalog pośredni (Debug\) zawiera pliki udostępnione z innego projektu (grk-cw3.vcxproj, grk-cw4.vcxproj, grk-cw5.vcxproj, grk-cw6.vcxproj, grk-cw7.vcxproj). Może to spowodować niepoprawne zachowanie podczas oczyszczania i ponownej kompilacji.
main.cpp
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\shared\minwindef.h(130,1): warning C4005: "APIENTRY": ponowna definicja makra
(kompilowanie pliku źródłowego „src/main.cpp”)
D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123,1):
zobacz poprzednią definicję „APIENTRY”
D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\src\ex_7_1.hpp(110,10): warning C4305: "inicjowanie": obcięcie z "double" do "float"
(kompilowanie pliku źródłowego „src/main.cpp”)
D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\src\ex_7_1.hpp(332,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
(kompilowanie pliku źródłowego „src/main.cpp”)
D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\src\ex_7_1.hpp(350,29): warning C4305: "inicjowanie": obcięcie z "double" do "float"
(kompilowanie pliku źródłowego „src/main.cpp”)
Box.obj : warning LNK4075: zignorowano opcję „/EDITANDCONTINUE” z powodu określenia opcji „/INCREMENTAL:NO”
LINK : warning LNK4098: domyślna biblioteka „MSVCRT” powoduje konflikt z innymi bibliotekami; użyj opcji /NODEFAULTLIB:biblioteka
grk-cw7.vcxproj -> D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\Debug\projekt_grk.exe
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(531,5): warning MSB8028: Katalog pośredni (Debug\) zawiera pliki udostępnione z innego projektu (grk-cw3.vcxproj, grk-cw4.vcxproj, grk-cw5.vcxproj, grk-cw6.vcxproj, grk-cw7.vcxproj). Może to spowodować niepoprawne zachowanie podczas oczyszczania i ponownej kompilacji.
main.cpp
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\shared\minwindef.h(130,1): warning C4005: "APIENTRY": ponowna definicja makra
(kompilowanie pliku źródłowego „src/main.cpp”)
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123,1):
zobacz poprzednią definicję „APIENTRY”
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\ex_7_1.hpp(162,10): warning C4305: "inicjowanie": obcięcie z "double" do "float"
(kompilowanie pliku źródłowego „src/main.cpp”)
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\ex_7_1.hpp(293,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
(kompilowanie pliku źródłowego „src/main.cpp”)
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\ex_7_1.hpp(474,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
(kompilowanie pliku źródłowego „src/main.cpp”)
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\ex_7_1.hpp(704,25): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
(kompilowanie pliku źródłowego „src/main.cpp”)
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\ex_7_1.hpp(744,34): warning C4244: "=": konwersja z "double" do "float", możliwa utrata danych
(kompilowanie pliku źródłowego „src/main.cpp”)
Box.obj : warning LNK4075: zignorowano opcję „/EDITANDCONTINUE” z powodu określenia opcji „/INCREMENTAL:NO”
LINK : warning LNK4098: domyślna biblioteka „MSVCRT” powoduje konflikt z innymi bibliotekami; użyj opcji /NODEFAULTLIB:biblioteka
grk-cw7.vcxproj -> D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\Debug\projekt_grk.exe

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\Debug\projekt_grk.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\Debug\projekt_grk.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />
<SatelliteDlls />
<NonRecipeFileRefs />
</Project>

View File

@ -1,10 +1,10 @@
D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\src\Box.cpp;D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\Debug\Box.obj
D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\src\Camera.cpp;D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\Debug\Camera.obj
D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\src\main.cpp;D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\Debug\main.obj
D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\src\Render_Utils.cpp;D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\Debug\Render_Utils.obj
D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\src\Shader_Loader.cpp;D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\Debug\Shader_Loader.obj
D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\src\SOIL\image_DXT.c;D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\Debug\image_DXT.obj
D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\src\SOIL\image_helper.c;D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\Debug\image_helper.obj
D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\src\SOIL\SOIL.c;D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\Debug\SOIL.obj
D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\src\SOIL\stb_image_aug.c;D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\Debug\stb_image_aug.obj
D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\src\Texture.cpp;D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\projekt_grk\Debug\Texture.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\Box.cpp;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\Box.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\Camera.cpp;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\Camera.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\main.cpp;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\main.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\Render_Utils.cpp;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\Render_Utils.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\Shader_Loader.cpp;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\Shader_Loader.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\SOIL\image_DXT.c;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\image_DXT.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\SOIL\image_helper.c;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\image_helper.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\SOIL\SOIL.c;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\SOIL.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\SOIL\stb_image_aug.c;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\stb_image_aug.obj
D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\src\Texture.cpp;D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\projekt_grk\Debug\Texture.obj

View File

@ -1 +1 @@
^D:\STUDIA_SEM5\GRAFIKA-PROJEKT\GRK\PROJEKT_GRK\DEBUG\BOX.OBJ|D:\STUDIA_SEM5\GRAFIKA-PROJEKT\GRK\PROJEKT_GRK\DEBUG\CAMERA.OBJ|D:\STUDIA_SEM5\GRAFIKA-PROJEKT\GRK\PROJEKT_GRK\DEBUG\IMAGE_DXT.OBJ|D:\STUDIA_SEM5\GRAFIKA-PROJEKT\GRK\PROJEKT_GRK\DEBUG\IMAGE_HELPER.OBJ|D:\STUDIA_SEM5\GRAFIKA-PROJEKT\GRK\PROJEKT_GRK\DEBUG\MAIN.OBJ|D:\STUDIA_SEM5\GRAFIKA-PROJEKT\GRK\PROJEKT_GRK\DEBUG\RENDER_UTILS.OBJ|D:\STUDIA_SEM5\GRAFIKA-PROJEKT\GRK\PROJEKT_GRK\DEBUG\SHADER_LOADER.OBJ|D:\STUDIA_SEM5\GRAFIKA-PROJEKT\GRK\PROJEKT_GRK\DEBUG\SOIL.OBJ|D:\STUDIA_SEM5\GRAFIKA-PROJEKT\GRK\PROJEKT_GRK\DEBUG\STB_IMAGE_AUG.OBJ|D:\STUDIA_SEM5\GRAFIKA-PROJEKT\GRK\PROJEKT_GRK\DEBUG\TEXTURE.OBJ
^D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\BOX.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\CAMERA.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\IMAGE_DXT.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\IMAGE_HELPER.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\MAIN.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\RENDER_UTILS.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\SHADER_LOADER.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\SOIL.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\STB_IMAGE_AUG.OBJ|D:\STUDIA_SEM5\GRK_FINAL_PULL\GRAFIKA_2024\PROJEKT_GRK\DEBUG\TEXTURE.OBJ

View File

@ -1,2 +1,2 @@
PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.39.33519:TargetPlatformVersion=10.0.22000.0:
Debug|Win32|D:\STUDIA_sem5\GRAFIKA-PROJEKT\grk\|
PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.39.33519:TargetPlatformVersion=10.0.22000.0:
Debug|Win32|D:\STUDIA_sem5\GRK_FINAL_PULL\Grafika_2024\|

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,134 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" 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>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\Box.cpp" />
<ClCompile Include="src\Camera.cpp" />
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\Render_Utils.cpp" />
<ClCompile Include="src\Shader_Loader.cpp" />
<ClCompile Include="src\SOIL\image_DXT.c" />
<ClCompile Include="src\SOIL\image_helper.c" />
<ClCompile Include="src\SOIL\SOIL.c" />
<ClCompile Include="src\SOIL\stb_image_aug.c" />
<ClCompile Include="src\Texture.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\Camera.h" />
<ClInclude Include="src\ex_7_1.hpp" />
<ClInclude Include="src\objload.h" />
<ClInclude Include="src\Render_Utils.h" />
<ClInclude Include="src\Shader_Loader.h" />
<ClInclude Include="src\SOIL\image_DXT.h" />
<ClInclude Include="src\SOIL\image_helper.h" />
<ClInclude Include="src\SOIL\SOIL.h" />
<ClInclude Include="src\SOIL\stbi_DDS_aug.h" />
<ClInclude Include="src\SOIL\stbi_DDS_aug_c.h" />
<ClInclude Include="src\SOIL\stb_image_aug.h" />
<ClInclude Include="src\Texture.h" />
</ItemGroup>
<ItemGroup>
<None Include="shaders\shader_5_1.frag" />
<None Include="shaders\shader_5_1.vert" />
<None Include="shaders\shader_5_1_tex_copy.frag" />
<None Include="shaders\shader_5_1_tex_copy.vert" />
<None Include="shaders\shader_bloom.frag" />
<None Include="shaders\shader_bloom.vert" />
<None Include="shaders\shader_blur.frag" />
<None Include="shaders\shader_blur.vert" />
<None Include="shaders\shader_sun.frag" />
<None Include="shaders\shader_sun.vert" />
<None Include="shaders\shader_pbr.frag" />
<None Include="shaders\shader_pbr.vert" />
<None Include="shaders\shader_skybox.frag" />
<None Include="shaders\shader_skybox.vert" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>grk-cw7</RootNamespace>
<WindowsTargetPlatformVersion>10.0.22000.0</WindowsTargetPlatformVersion>
<ProjectName>projekt_grk</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</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>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>false</LinkIncremental>
<LibraryPath>$(SolutionDir)dependencies\freeglut\lib;$(SolutionDir)dependencies\glew-2.0.0\lib\Release\Win32;$(SolutionDir)dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019;$(SolutionDir)dependencies\assimp;$(LibraryPath)</LibraryPath>
<IncludePath>$(SolutionDir)dependencies\freeglut\include\GL;$(SolutionDir)dependencies\glew-2.0.0\include\GL;$(SolutionDir)dependencies\glm;$(SolutionDir)dependencies\glfw-3.3.8.bin.WIN32\include;$(SolutionDir)dependencies\assimp\include;$(IncludePath)</IncludePath>
<ExecutablePath>$(ExecutablePath)</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<LibraryPath>$(SolutionDir)dependencies\freeglut\lib;$(SolutionDir)dependencies\glew-2.0.0\lib\Release\Win32;$(SolutionDir)dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019;$(SolutionDir)dependencies\assimp;$(LibraryPath)</LibraryPath>
<IncludePath>$(SolutionDir)dependencies\freeglut\include\GL;$(SolutionDir)dependencies\glew-2.0.0\include\GL;$(SolutionDir)dependencies\glm;$(SolutionDir)dependencies\glfw-3.3.8.bin.WIN32\include;$(SolutionDir)dependencies\assimp\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>opengl32.lib;freeglut.lib;glew32.lib;$(SolutionDir)\dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019\glfw3.lib;$(SolutionDir)\dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019\glfw3dll.lib;zlibd.lib;assimp-vc141-mtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>opengl32.lib;freeglut.lib;glew32.lib;$(SolutionDir)\dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019\glfw3.lib;$(SolutionDir)\dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019\glfw3dll.lib;zlibd.lib;assimp-vc141-mtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" 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>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\Box.cpp" />
<ClCompile Include="src\Camera.cpp" />
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\Render_Utils.cpp" />
<ClCompile Include="src\Shader_Loader.cpp" />
<ClCompile Include="src\SOIL\image_DXT.c" />
<ClCompile Include="src\SOIL\image_helper.c" />
<ClCompile Include="src\SOIL\SOIL.c" />
<ClCompile Include="src\SOIL\stb_image_aug.c" />
<ClCompile Include="src\Texture.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\Camera.h" />
<ClInclude Include="src\ex_7_1.hpp" />
<ClInclude Include="src\objload.h" />
<ClInclude Include="src\Render_Utils.h" />
<ClInclude Include="src\Shader_Loader.h" />
<ClInclude Include="src\SOIL\image_DXT.h" />
<ClInclude Include="src\SOIL\image_helper.h" />
<ClInclude Include="src\SOIL\SOIL.h" />
<ClInclude Include="src\SOIL\stbi_DDS_aug.h" />
<ClInclude Include="src\SOIL\stbi_DDS_aug_c.h" />
<ClInclude Include="src\SOIL\stb_image_aug.h" />
<ClInclude Include="src\Texture.h" />
</ItemGroup>
<ItemGroup>
<None Include="shaders\shader_5_1.frag" />
<None Include="shaders\shader_5_1.vert" />
<None Include="shaders\shader_5_1_tex_copy.frag" />
<None Include="shaders\shader_5_1_tex_copy.vert" />
<None Include="shaders\shader_bloom.frag" />
<None Include="shaders\shader_bloom.vert" />
<None Include="shaders\shader_blur.frag" />
<None Include="shaders\shader_blur.vert" />
<None Include="shaders\shader_sun.frag" />
<None Include="shaders\shader_sun.vert" />
<None Include="shaders\shader_pbr.frag" />
<None Include="shaders\shader_pbr.vert" />
<None Include="shaders\shader_skybox.frag" />
<None Include="shaders\shader_skybox.vert" />
<None Include="shader_coin.frag" />
<None Include="shader_coin.vert" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{F2FC2E8F-CBA6-49D7-8B73-4BFBCB64D310}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>grk-cw7</RootNamespace>
<WindowsTargetPlatformVersion>10.0.22000.0</WindowsTargetPlatformVersion>
<ProjectName>projekt_grk</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</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>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>false</LinkIncremental>
<LibraryPath>$(SolutionDir)dependencies\freeglut\lib;$(SolutionDir)dependencies\glew-2.0.0\lib\Release\Win32;$(SolutionDir)dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019;$(SolutionDir)dependencies\assimp;$(LibraryPath)</LibraryPath>
<IncludePath>$(SolutionDir)dependencies\freeglut\include\GL;$(SolutionDir)dependencies\glew-2.0.0\include\GL;$(SolutionDir)dependencies\glm;$(SolutionDir)dependencies\glfw-3.3.8.bin.WIN32\include;$(SolutionDir)dependencies\assimp\include;$(IncludePath)</IncludePath>
<ExecutablePath>$(ExecutablePath)</ExecutablePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<LibraryPath>$(SolutionDir)dependencies\freeglut\lib;$(SolutionDir)dependencies\glew-2.0.0\lib\Release\Win32;$(SolutionDir)dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019;$(SolutionDir)dependencies\assimp;$(LibraryPath)</LibraryPath>
<IncludePath>$(SolutionDir)dependencies\freeglut\include\GL;$(SolutionDir)dependencies\glew-2.0.0\include\GL;$(SolutionDir)dependencies\glm;$(SolutionDir)dependencies\glfw-3.3.8.bin.WIN32\include;$(SolutionDir)dependencies\assimp\include;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>opengl32.lib;freeglut.lib;glew32.lib;$(SolutionDir)\dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019\glfw3.lib;$(SolutionDir)\dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019\glfw3dll.lib;zlibd.lib;assimp-vc141-mtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>opengl32.lib;freeglut.lib;glew32.lib;$(SolutionDir)\dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019\glfw3.lib;$(SolutionDir)\dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019\glfw3dll.lib;zlibd.lib;assimp-vc141-mtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)dependencies\glfw-3.3.8.bin.WIN32\lib-vc2019;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,137 +1,143 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<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>
<Filter Include="Shader Files">
<UniqueIdentifier>{0a247bb8-2e8e-4a90-b0ef-17415b0941ba}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\SOIL">
<UniqueIdentifier>{0af44075-33f4-4953-b1d6-1d28d61d758f}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\Render_Utils.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Shader_Loader.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Box.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Camera.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Texture.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SOIL\SOIL.c">
<Filter>Source Files\SOIL</Filter>
</ClCompile>
<ClCompile Include="src\SOIL\stb_image_aug.c">
<Filter>Source Files\SOIL</Filter>
</ClCompile>
<ClCompile Include="src\SOIL\image_DXT.c">
<Filter>Source Files\SOIL</Filter>
</ClCompile>
<ClCompile Include="src\SOIL\image_helper.c">
<Filter>Source Files\SOIL</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\objload.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="src\Render_Utils.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="src\Shader_Loader.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="src\Camera.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="src\Texture.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="src\SOIL\image_helper.h">
<Filter>Source Files\SOIL</Filter>
</ClInclude>
<ClInclude Include="src\SOIL\SOIL.h">
<Filter>Source Files\SOIL</Filter>
</ClInclude>
<ClInclude Include="src\SOIL\stb_image_aug.h">
<Filter>Source Files\SOIL</Filter>
</ClInclude>
<ClInclude Include="src\SOIL\stbi_DDS_aug.h">
<Filter>Source Files\SOIL</Filter>
</ClInclude>
<ClInclude Include="src\SOIL\stbi_DDS_aug_c.h">
<Filter>Source Files\SOIL</Filter>
</ClInclude>
<ClInclude Include="src\SOIL\image_DXT.h">
<Filter>Source Files\SOIL</Filter>
</ClInclude>
<ClInclude Include="src\ex_7_1.hpp">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="shaders\shader_sun.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_sun.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_5_1.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_5_1.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_5_1_tex_copy.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_5_1_tex_copy.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_skybox.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_skybox.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_pbr.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_pbr.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_bloom.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_bloom.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_blur.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_blur.vert">
<Filter>Shader Files</Filter>
</None>
</ItemGroup>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<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>
<Filter Include="Shader Files">
<UniqueIdentifier>{0a247bb8-2e8e-4a90-b0ef-17415b0941ba}</UniqueIdentifier>
</Filter>
<Filter Include="Source Files\SOIL">
<UniqueIdentifier>{0af44075-33f4-4953-b1d6-1d28d61d758f}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\Render_Utils.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Shader_Loader.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Box.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Camera.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Texture.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\SOIL\SOIL.c">
<Filter>Source Files\SOIL</Filter>
</ClCompile>
<ClCompile Include="src\SOIL\stb_image_aug.c">
<Filter>Source Files\SOIL</Filter>
</ClCompile>
<ClCompile Include="src\SOIL\image_DXT.c">
<Filter>Source Files\SOIL</Filter>
</ClCompile>
<ClCompile Include="src\SOIL\image_helper.c">
<Filter>Source Files\SOIL</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\objload.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="src\Render_Utils.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="src\Shader_Loader.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="src\Camera.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="src\Texture.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="src\SOIL\image_helper.h">
<Filter>Source Files\SOIL</Filter>
</ClInclude>
<ClInclude Include="src\SOIL\SOIL.h">
<Filter>Source Files\SOIL</Filter>
</ClInclude>
<ClInclude Include="src\SOIL\stb_image_aug.h">
<Filter>Source Files\SOIL</Filter>
</ClInclude>
<ClInclude Include="src\SOIL\stbi_DDS_aug.h">
<Filter>Source Files\SOIL</Filter>
</ClInclude>
<ClInclude Include="src\SOIL\stbi_DDS_aug_c.h">
<Filter>Source Files\SOIL</Filter>
</ClInclude>
<ClInclude Include="src\SOIL\image_DXT.h">
<Filter>Source Files\SOIL</Filter>
</ClInclude>
<ClInclude Include="src\ex_7_1.hpp">
<Filter>Source Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="shaders\shader_sun.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_sun.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_5_1.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_5_1.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_5_1_tex_copy.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_5_1_tex_copy.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_skybox.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_skybox.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_pbr.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_pbr.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_bloom.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_bloom.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_blur.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_blur.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shader_coin.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shader_coin.frag">
<Filter>Shader Files</Filter>
</None>
</ItemGroup>
</Project>

View File

@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ShowAllFiles>true</ShowAllFiles>
</PropertyGroup>
</Project>

View File

@ -0,0 +1,2 @@
# Blender 4.0.2 MTL File: 'None'
# www.blender.org

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
#version 430 core
float AMBIENT = 0.1;
uniform vec3 color;
uniform vec3 lightPos;
in vec3 vecNormal;
in vec3 worldPos;
out vec4 finalColor;
void main()
{
vec3 lightDir = normalize(lightPos-worldPos);
vec3 normal = normalize(vecNormal);
float diffuse=max(0,dot(normal,lightDir));
finalColor = vec4(color*min(1,AMBIENT+diffuse), 1.0);
}

View File

@ -0,0 +1,17 @@
#version 430 core
layout(location = 0) in vec3 vertexPosition;
layout(location = 1) in vec3 vertexNormal;
uniform mat4 transformation;
uniform mat4 modelMatrix;
out vec3 vecNormal;
out vec3 worldPos;
void main()
{
worldPos = (modelMatrix* vec4(vertexPosition,1)).xyz;
vecNormal = (modelMatrix* vec4(vertexNormal,0)).xyz;
gl_Position = transformation * vec4(vertexPosition, 1.0);
}

View File

@ -1,7 +1,6 @@
#version 430 core
const float DIFFUSE_INTENSITY = 0.6;
const float MAX_RENDER_DISTANCE = 16.0;
float surfaceRoughness;
float metalnessValue;
@ -64,10 +63,6 @@ void main() {
vec3 diffuseReflectance = vec3(1.0) - fresnelTerm;
vec3 BRDF = diffuseReflectance * (textureColor / 3.1458493) + specular;
if (distanceToCamera > MAX_RENDER_DISTANCE) {
discard;
}
float diffuse = max(0.0001, dot(normal, lightDir));
fragmentColor = vec4(BRDF * (DIFFUSE_INTENSITY + diffuse) * 1.5, 1.0);

View File

@ -16,7 +16,6 @@
#include <string>
#include "SOIL/SOIL.h"
namespace texture {
GLuint mercury;
GLuint venus;
@ -47,6 +46,8 @@ namespace texture {
GLuint grid;
GLuint gameOverSprite;
}
@ -54,6 +55,7 @@ GLuint program;
GLuint programSun;
GLuint programTex;
GLuint programSkyBox;
GLuint programCoin;
GLuint programSpaceShip;
GLuint programBlur;
GLuint programBloom;
@ -62,18 +64,68 @@ Core::Shader_Loader shaderLoader;
Core::RenderContext shipContext;
Core::RenderContext sphereContext;
Core::RenderContext cubeContext;
Core::RenderContext cylinderContext;
glm::vec3 cameraPos = glm::vec3(-4.f, 0, 0);
glm::vec3 cameraDir = glm::vec3(1.f, 0, 0.f);
glm::vec3 spaceshipPos = glm::vec3(-4.f, 0, 0);
glm::vec3 spaceshipPos = glm::vec3(-22.f, 0, 0);
glm::vec3 spaceshipDir = glm::vec3(1.f, 0.f, 0.f);
GLuint VAO,VBO;
GLuint VAO, VBO;
float aspectRatio = 1.f;
unsigned int textureID;
bool gameOver = false;
bool gameWon = false;
const int maxSize = 30;
int numberOfCollectedCoins = 0;
float xCordinatesOfCoin[maxSize] = {
5.3f, 10.0f, -4.7f, 9.2f, 3.5f, -7.5f, 1.8f, 2.5f, 11.8f, -10.2f,
-4.5f, 6.7f, -6.7f, 5.5f, -0.1f, -9.2f, -6.8f, -9.7f, -12.9f, 5.0f,
12.2f, -7.4f, 2.4f, 12.3f, -4.1f, -5.7f, -5.5f, -3.6f, -2.5f, -7.6f
};
float zCordinatesOfCoin[maxSize] = {
2.6f, 1.5f, 4.8f, 2.2f, -11.8f, 3.3f, 9.1f, -6.0f, -12.0f, 11.1f,
11.9f, 2.5f, 5.2f, 1.1f, -2.0f, -8.2f, -2.9f, -9.4f, 0.5f, -2.3f,
-1.0f, 1.0f, -4.2f, 7.3f, 10.0f, -12.6f, -5.9f, -2.7f, 12.8f, 2.3f
};
float xCordinatesOfCollectedCoin[maxSize] = {};
float zCordinatesOfCollectedCoin[maxSize] = {};
float angleSpeed = 0.01f;
float moveSpeed = 0.009f;
struct Planet {
glm::vec3 currentPos;
glm::vec3 modelScale;
float rotationSpeed; // ruch obrotowy
float orbitSpeed; // ruch obiegowy
float orbitRadius;
GLuint texture;
GLuint normalTexture;
};
struct Satellite {
glm::vec3 currentPos;
glm::vec3 modelScale;
float rotationSpeed; // ruch obrotowy
float orbitSpeed; // ruch obiegowy
float orbitRadius;
GLuint texture;
GLuint normalTexture;
Planet parentPlanet;
};
std::vector<Planet> planets;
std::vector<Satellite> satellites;
unsigned int hdrFBO;
unsigned int colorBuffers[2];
unsigned int pingpongFBO[2];
@ -89,8 +141,8 @@ bool bloom = true;
glm::mat4 createCameraMatrix()
{
glm::vec3 cameraSide = glm::normalize(glm::cross(cameraDir,glm::vec3(0.f,1.f,0.f)));
glm::vec3 cameraUp = glm::normalize(glm::cross(cameraSide,cameraDir));
glm::vec3 cameraSide = glm::normalize(glm::cross(cameraDir, glm::vec3(0.f, 1.f, 0.f)));
glm::vec3 cameraUp = glm::normalize(glm::cross(cameraSide, cameraDir));
glm::mat4 cameraRotrationMatrix = glm::mat4({
cameraSide.x,cameraSide.y,cameraSide.z,0,
cameraUp.x,cameraUp.y,cameraUp.z ,0,
@ -105,7 +157,7 @@ glm::mat4 createCameraMatrix()
glm::mat4 createPerspectiveMatrix()
{
glm::mat4 perspectiveMatrix;
float n = 0.05;
float f = 20.;
@ -114,12 +166,12 @@ glm::mat4 createPerspectiveMatrix()
perspectiveMatrix = glm::mat4({
1,0.,0.,0.,
0.,aspectRatio,0.,0.,
0.,0.,(f+n) / (n - f),2*f * n / (n - f),
0.,0.,(f + n) / (n - f),2 * f * n / (n - f),
0.,0.,-1.,0.,
});
perspectiveMatrix=glm::transpose(perspectiveMatrix);
perspectiveMatrix = glm::transpose(perspectiveMatrix);
return perspectiveMatrix;
}
@ -144,7 +196,7 @@ void renderQuad()
glBindBuffer(GL_ARRAY_BUFFER, quadVBO);
glBufferData(GL_ARRAY_BUFFER, sizeof(quadVertices), &quadVertices, GL_STATIC_DRAW);
// locations 7 i 8 aby nie by³o kolizii z shaderem statku
// locations 7 i 8 aby nie by<62>o kolizii z shaderem statku
glEnableVertexAttribArray(7);
glVertexAttribPointer(7, 3, GL_FLOAT, GL_FALSE, 5 * sizeof(float), (void*)0);
glEnableVertexAttribArray(8);
@ -217,7 +269,7 @@ void drawObjectColor(Core::RenderContext& context, glm::mat4 modelMatrix, glm::v
glUniformMatrix4fv(glGetUniformLocation(prog, "transformation"), 1, GL_FALSE, (float*)&transformation);
glUniformMatrix4fv(glGetUniformLocation(prog, "modelMatrix"), 1, GL_FALSE, (float*)&modelMatrix);
glUniform3f(glGetUniformLocation(prog, "color"), color.x, color.y, color.z);
glUniform3f(glGetUniformLocation(prog, "lightPos"), 0,0,0);
glUniform3f(glGetUniformLocation(prog, "lightPos"), 0, 0, 0);
Core::DrawContext(context);
}
@ -235,6 +287,70 @@ void drawObjectTexture(Core::RenderContext& context, glm::mat4 modelMatrix, GLui
Core::DrawContext(context);
}
void drawCylinder(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec3 color) {
GLuint prog = programCoin;
glUseProgram(prog);
float time = glfwGetTime();
glm::mat4 modelMatrixForMultiplications = modelMatrix * glm::rotate(glm::mat4(1.0f), time * 1.0f, glm::vec3(0, 1, 0))
* glm::scale(glm::vec3(0.3f));
modelMatrix = modelMatrixForMultiplications;
glm::mat4 viewProjectionMatrix = createPerspectiveMatrix() * createCameraMatrix();
glm::mat4 transformation = viewProjectionMatrix * modelMatrix;
glUniformMatrix4fv(glGetUniformLocation(prog, "transformation"), 1, GL_FALSE, (float*)&transformation);
glUniformMatrix4fv(glGetUniformLocation(prog, "modelMatrix"), 1, GL_FALSE, (float*)&modelMatrix);
glUniform3f(glGetUniformLocation(prog, "color"), color.x, color.y, color.z);
glUniform3f(glGetUniformLocation(prog, "lightPos"), 0, 0, 0);
Core::DrawContext(context);
}
bool checkCoinCollection(glm::vec3 spaceshipPos, glm::vec3 coinPos) {
float collectionDistance = 0.8f;
float distance = glm::length(spaceshipPos - coinPos);
if (distance < collectionDistance) {
return true;
}
return false;
}
void renderCoins() {
for (int i = 0;i < maxSize;i++) {
bool found = false;
if (checkCoinCollection(spaceshipPos, glm::vec3(xCordinatesOfCoin[i], 0.0f, zCordinatesOfCoin[i]))) {
for (int y = 0; y < numberOfCollectedCoins; y++) {
if (xCordinatesOfCollectedCoin[y] == xCordinatesOfCoin[i] &&
zCordinatesOfCollectedCoin[y] == zCordinatesOfCoin[i]) {
found = true;
break;
}
}
if (!found) {
xCordinatesOfCollectedCoin[numberOfCollectedCoins] = xCordinatesOfCoin[i];
zCordinatesOfCollectedCoin[numberOfCollectedCoins] = zCordinatesOfCoin[i];
numberOfCollectedCoins++;
}
}
else {
for (int y = 0; y < numberOfCollectedCoins; y++) {
if (xCordinatesOfCollectedCoin[y] == xCordinatesOfCoin[i] &&
zCordinatesOfCollectedCoin[y] == zCordinatesOfCoin[i]) {
found = true;
break;
}
}
if (!found) {
drawCylinder(cylinderContext, glm::translate(glm::vec3(xCordinatesOfCoin[i], 0.0f, zCordinatesOfCoin[i])), glm::vec3(1.0f, 1.0f, 0.0f));
}
}
}
}
void drawSun(Core::RenderContext& context, glm::mat4 modelMatrix, GLuint textureID)
{
@ -257,7 +373,7 @@ void drawSunBlur() {
{
glBindFramebuffer(GL_FRAMEBUFFER, pingpongFBO[horizontal]);
glUniform1i(glGetUniformLocation(programBlur, "horizontal"), horizontal);
glBindTexture(GL_TEXTURE_2D, first_iteration ? colorBuffers[1] : pingpongColorbuffers[!horizontal]);
glBindTexture(GL_TEXTURE_2D, first_iteration ? colorBuffers[1] : pingpongColorbuffers[!horizontal]);
renderQuad();
horizontal = !horizontal;
if (first_iteration)
@ -319,79 +435,43 @@ void drawSpaceShip(Core::RenderContext& context, glm::mat4 modelMatrix, GLuint t
}
void renderPlanet(float time, float orbitRadius, float orbitRotationSpeed, float selfRotationSpeed, float scale, GLuint planetTexture, GLuint normalTexture) {
glm::mat4 planetTransform = glm::rotate(glm::mat4(1.0f), time * orbitRotationSpeed, glm::vec3(0, 1, 0)) // orbitowanie dooko³a s³oñca
* glm::translate(glm::vec3(orbitRadius, 0, 0)) // translacja na odp. odleg³oœæ
* glm::rotate(glm::mat4(1.0f), time * selfRotationSpeed, glm::vec3(0, 1, 0)) //obrót planety wokó³ w³asnej osi
* glm::scale(glm::vec3(scale)); //skalowanie planety
drawObjectTexture(sphereContext, planetTransform, planetTexture, normalTexture);
void initializePlanets() {
planets.push_back(Planet{ glm::vec3(2.0f, 0, 0), glm::vec3(0.11f), 1 / 59.0f, 1.0f / 2, 2.0f, texture::mercury, texture::mercuryNormal });
planets.push_back(Planet{ glm::vec3(3.5f, 0, 0), glm::vec3(0.29f), 1 / 243.0f, 1.0f / 5, 3.5f, texture::venus, texture::venusNormal });
planets.push_back(Planet{ glm::vec3(5.0f, 0, 0), glm::vec3(0.3f), 1.f, 1.0f / 6, 5.0f, texture::earth, texture::earthNormal });
planets.push_back(Planet{ glm::vec3(7.5f, 0, 0), glm::vec3(0.2f), 1.f, 1.0f / 7, 7.5f, texture::mars, texture::marsNormal });
planets.push_back(Planet{ glm::vec3(10.f, 0, 0), glm::vec3(1.f), 2.4f, 1.0f / 9, 10.f, texture::jupiter, texture::jupiterNormal });
planets.push_back(Planet{ glm::vec3(12.5f, 0, 0), glm::vec3(0.7f), 2.4f, 1.0f / 10, 12.5f, texture::saturn, texture::saturnNormal });
planets.push_back(Planet{ glm::vec3(15.f, 0, 0), glm::vec3(1.f), 1.7f, 1.0f / 15, 15.f, texture::uranus, texture::uranusNormal });
planets.push_back(Planet{ glm::vec3(20.f, 0, 0), glm::vec3(1.f), 1.2f, 1.0f / 24, 20.f, texture::neptune, texture::neptuneNormal });
planets.push_back(Planet{ glm::vec3(0, 0, 0), glm::vec3(1.f), 0.f, 0.f, 0.f, texture::sun, texture::sun });
satellites.push_back(Satellite{ glm::vec3(5.0f, 0, 0), glm::vec3(0.055f), 1.f / 2, 1.0f / 2, 0.8f, texture::moon, texture::asteroidNormal, planets[2] });
}
void renderPlanets() {
float time = glfwGetTime();
void printPlanetPos() {
int index = 0;
for (auto& planet : planets) {
std::cout << index << " " << glm::to_string(planet.currentPos) << std::endl;
++index;
}
}
float mercuryOrbitRadius = 1.3f;
float venusOrbitRadius = 2.0f;
float earthOrbitRadius = 5.0f;
float moonOrbitRadius = 0.8f;
float marsOrbitRadius = 8.0f;
float jupiterOrbitRadius = 10.0f;
float saturnOrbitRadius = 11.0f;
float uranusOrbitRadius = 12.5f;
float neptuneOrbitRadius = 13.0f;
bool checkCollision(glm::vec3 spaceshipPos, glm::vec3 planetPos, glm::vec3 planetScale) {
// im mniejsze tym szybciej
float mercuryRotationSpeed = 1.0f / 10;
float venusRotationSpeed = 1.0f / 7;
float earthRotationSpeed = 1.0f / 6;
float moonRotationSpeed = 1.0f / 2;
float marsRotationSpeed = 1.0f / 5;
float jupiterRotationSpeed = 1.0f / 8.5;
float saturnRotationSpeed = 1.0f / 5;
float uranusRotationSpeed = 1.0f / 9;
float neptuneRotationSpeed = 1.0f / 10;
float planetRadius = planetScale.x;
float shipSize = 0.5f;
float mercurySelfRotationSpeed = 1.0f;
float venusSelfRotationSpeed = 1.0f;
float earthSelfRotationSpeed = 1.0f;
float moonSelfRotationSpeed = 1.0f / 2;
float marsSelfRotationSpeed = 1.0f;
float jupiterSelfRotationSpeed = 1.0f;
float saturnSelfRotationSpeed = 1.0f;
float uranusSelfRotationSpeed = 1.0f / 2;
float neptuneSelfRotationSpeed = 1.0f;
float mercuryScale = 0.11f;
float venusScale = 0.14f;
float earthScale = 0.3f;
float moonScale = 0.055f;
float marsScale = 0.2f;
float jupiterScale = 0.7f;
float saturnScale = 0.5f;
float uranusScale = 0.3f;
float neptuneScale = 0.32f;
renderPlanet(time, mercuryOrbitRadius, mercuryRotationSpeed, mercurySelfRotationSpeed, mercuryScale, texture::mercury, texture::mercuryNormal);
renderPlanet(time, venusOrbitRadius, venusRotationSpeed, venusSelfRotationSpeed, venusScale, texture::venus, texture::venusNormal);
renderPlanet(time, earthOrbitRadius, earthRotationSpeed, earthSelfRotationSpeed, earthScale, texture::earth, texture::earthNormal);
float distanceSquared = glm::distance2(spaceshipPos, planetPos);
float distance = glm::length(planetPos - spaceshipPos);
//earths moon, musi byæ inaczej renderowany bo on nie orbituje wokó³ s³oñca tylko ziemi. PóŸniej to mo¿na jakoœ lepiej rozwi¹zaæ.
drawObjectTexture(sphereContext,
glm::eulerAngleY(time * earthRotationSpeed) * glm::translate(glm::vec3(earthOrbitRadius, 0, 0)) * glm::eulerAngleY(time * moonRotationSpeed) * glm::translate(glm::vec3(moonOrbitRadius, 0, 0)) * glm::scale(glm::vec3(moonScale)),
texture::moon,
texture::asteroidNormal);
renderPlanet(time, marsOrbitRadius, marsRotationSpeed, marsSelfRotationSpeed, marsScale, texture::mars, texture::marsNormal);
renderPlanet(time, jupiterOrbitRadius, jupiterRotationSpeed, jupiterSelfRotationSpeed, jupiterScale, texture::jupiter, texture::jupiterNormal);
renderPlanet(time, saturnOrbitRadius, saturnRotationSpeed, saturnSelfRotationSpeed, saturnScale, texture::saturn, texture::saturnNormal);
renderPlanet(time, uranusOrbitRadius, uranusRotationSpeed, uranusSelfRotationSpeed, uranusScale, texture::uranus, texture::uranusNormal);
renderPlanet(time, neptuneOrbitRadius, neptuneRotationSpeed, neptuneSelfRotationSpeed, neptuneScale, texture::neptune, texture::neptuneNormal);
float minDistance = planetRadius + shipSize;
return distanceSquared <= (planetRadius + shipSize) * (planetRadius + shipSize);
}
void renderScene(GLFWwindow* window)
{
//float time = 0;
float time = glfwGetTime();
glClearColor(0.0f, 0.3f, 0.3f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@ -402,11 +482,34 @@ void renderScene(GLFWwindow* window)
drawObjectSkyBox(cubeContext, glm::translate(cameraPos));
//sun
drawSun(sphereContext, glm::mat4(), texture::sun);
//rendering all the planets
renderPlanets();
for (auto& planet : planets) {
glm::mat4 modelMatrix = glm::rotate(glm::mat4(1.0f), time * planet.orbitSpeed, glm::vec3(0, 1, 0)) // orbitowanie dooko³a s³oñca
* glm::translate(glm::vec3(planet.orbitRadius, 0, 0)) // translacja na odp. odleg³oœæ
* glm::rotate(glm::mat4(1.0f), time * planet.rotationSpeed, glm::vec3(0, 1, 0)) //obrót planety wokó³ w³asnej osi
* glm::scale(glm::vec3(planet.modelScale)); //skalowanie planety
drawObjectTexture(sphereContext, modelMatrix, planet.texture, planet.normalTexture);
planet.currentPos = glm::vec3(modelMatrix * glm::vec4(0, 0, 0, 1.0f));
}
for (auto& satellite : satellites) {
glm::mat4 modelMatrix = glm::eulerAngleY(2*time * satellite.parentPlanet.orbitSpeed)
* glm::translate(glm::vec3(satellite.parentPlanet.orbitRadius, 0, 0))
* glm::eulerAngleY(time * satellite.rotationSpeed)
* glm::translate(glm::vec3(satellite.orbitRadius, 0, 0))
* glm::scale(glm::vec3(satellite.modelScale));
drawObjectTexture(sphereContext, modelMatrix, satellite.texture, satellite.normalTexture);
satellite.currentPos = glm::vec3(modelMatrix * glm::vec4(0, 0, 0, 1.0f));
}
renderCoins();
// obliczanie orientacji statku
glm::vec3 spaceshipSide = glm::normalize(glm::cross(spaceshipDir, glm::vec3(0.f, 1.f, 0.f)));
glm::vec3 spaceshipUp = glm::normalize(glm::cross(spaceshipSide, spaceshipDir));
@ -432,6 +535,8 @@ void renderScene(GLFWwindow* window)
glUseProgram(0);
glfwSwapBuffers(window);
}
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
@ -444,7 +549,7 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
void loadModelToContext(std::string path, Core::RenderContext& context)
{
Assimp::Importer import;
const aiScene* scene = import.ReadFile(path, aiProcess_Triangulate | aiProcess_CalcTangentSpace);
const aiScene * scene = import.ReadFile(path, aiProcess_Triangulate | aiProcess_CalcTangentSpace);
if (!scene || scene->mFlags & AI_SCENE_FLAGS_INCOMPLETE || !scene->mRootNode)
{
@ -464,6 +569,7 @@ void init(GLFWwindow* window)
programTex = shaderLoader.CreateProgram("shaders/shader_5_1_tex_copy.vert", "shaders/shader_5_1_tex_copy.frag");
programSun = shaderLoader.CreateProgram("shaders/shader_sun.vert", "shaders/shader_sun.frag");
programSkyBox = shaderLoader.CreateProgram("shaders/shader_skybox.vert", "shaders/shader_skybox.frag");
programCoin = shaderLoader.CreateProgram("shaders/shader_coin.vert", "shaders/shader_coin.frag");
programSpaceShip = shaderLoader.CreateProgram("shaders/shader_pbr.vert", "shaders/shader_pbr.frag");
programBlur = shaderLoader.CreateProgram("shaders/shader_blur.vert", "shaders/shader_blur.frag");
programBloom = shaderLoader.CreateProgram("shaders/shader_bloom.vert", "shaders/shader_bloom.frag");
@ -472,6 +578,7 @@ void init(GLFWwindow* window)
loadModelToContext("./models/sphere.obj", sphereContext);
loadModelToContext("./models/new_spaceship.obj", shipContext);
loadModelToContext("./models/cube.obj", cubeContext);
loadModelToContext("./models/cylinder.obj", cylinderContext);
texture::mercury = Core::LoadTexture("textures/mercury/mercury.jpg");
texture::venus = Core::LoadTexture("textures/venus/venus.jpg");
@ -532,12 +639,27 @@ void init(GLFWwindow* window)
//skybox end
blur(window);
glUseProgram(programBlur);
glUniform1i(glGetUniformLocation(programBloom, "image"), 0);
glUseProgram(programBloom);
glUniform1i(glGetUniformLocation(programBloom, "scene"), 0);
glUniform1i(glGetUniformLocation(programBloom, "bloomBlur"), 1);
initializePlanets();
}
void gameOverScreen(GLFWwindow* window) {
if (gameWon) {
std::cout << "Congratulations!" << std::endl;
}
else if (gameOver) {
std::cout << "GAME OVER. Number of collected coins: " << numberOfCollectedCoins << std::endl;
}
glfwSetWindowShouldClose(window, GLFW_TRUE);
moveSpeed = 0;
angleSpeed = 0;
}
void shutdown(GLFWwindow* window)
@ -550,8 +672,6 @@ void processInput(GLFWwindow* window)
glm::vec3 spaceshipSide = glm::normalize(glm::cross(spaceshipDir, glm::vec3(0.f, 1.f, 0.f)));
glm::vec3 spaceshipUp = glm::vec3(0.f, 1.f, 0.f);
float angleSpeed = 0.005f;
float moveSpeed = 0.0025f;
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS) {
glfwSetWindowShouldClose(window, true);
}
@ -571,16 +691,63 @@ void processInput(GLFWwindow* window)
spaceshipDir = glm::vec3(glm::eulerAngleY(angleSpeed) * glm::vec4(spaceshipDir, 0));
if (glfwGetKey(window, GLFW_KEY_D) == GLFW_PRESS)
spaceshipDir = glm::vec3(glm::eulerAngleY(-angleSpeed) * glm::vec4(spaceshipDir, 0));
if (glfwGetKey(window, GLFW_KEY_SPACE) == GLFW_PRESS)
spaceshipPos += spaceshipDir * 5*moveSpeed;
cameraPos = spaceshipPos - 1.5 * spaceshipDir + glm::vec3(0, 1, 0) * 0.5f;
cameraDir = spaceshipDir;
}
void renderLoop(GLFWwindow* window) {
float timeOfLastUpdate = glfwGetTime();
int loopCount = 0;
int interval = 2500;
while (!glfwWindowShouldClose(window))
{
processInput(window);
renderScene(window);
int index = 0;
if (numberOfCollectedCoins == 30) {
gameWon = true;
}
for (auto& planet : planets) {
if (checkCollision(spaceshipPos, planet.currentPos, planet.modelScale)) {
gameOver = true;
//std::cout << "Kolizja statku z planeta " << index << std::endl;
}
++index;
}
for (auto& satellite : satellites) {
if (checkCollision(spaceshipPos, satellite.currentPos, satellite.modelScale)) {
gameOver = true;
//std::cout << "Kolizja statku z satelita " << index << std::endl;
}
++index;
}
loopCount++;
if (loopCount >= interval) {
//printPlanetPos();
//std::cout << "Pozycja statku " << glm::to_string(spaceshipPos) << std::endl;
std::cout << "Coins collected " << numberOfCollectedCoins << std::endl;
loopCount = 0;
timeOfLastUpdate = glfwGetTime();
}
if (gameOver || gameWon) {
gameOverScreen(window);
}
glfwPollEvents();
}
}
}