Compare commits

..

No commits in common. "master" and "improvements" have entirely different histories.

111 changed files with 105 additions and 1156 deletions

3
.gitignore vendored
View File

@ -360,5 +360,4 @@ MigrationBackup/
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
/cw 9/textures/test
FodyWeavers.xsd

Binary file not shown.

Binary file not shown.

View File

@ -1,10 +0,0 @@
# GRK Projekt
Water Causics / Particle Generator
Link do dokumentacji: https://uam-my.sharepoint.com/:w:/g/personal/julsad3_st_amu_edu_pl/Ea8GEqOLJMNLhxW9BBwQ2A0B0lOoyEtLEa4DNLNZkBfnqA?e=OCneeL&fbclid=IwAR3MKk2vUPXqkQhl-CC7CG04piLw_8zdY-GLTpl52MsLz2IEemNN9tcxXl4
Link do pobrania modeli: https://drive.google.com/drive/folders/1H9mCPv32GYCW7wTFX0St0C-mWTQPUpZ-?usp=sharing
Modele należy umieścić w cw 9/models.

Binary file not shown.

Binary file not shown.

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

@ -2,7 +2,7 @@
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\Users\sjule\source\repos\GRK_Project\Debug\grk-cw9.exe</FullPath>
<FullPath>C:\Users\Anna Niczyporuk\source\repos\GRK_Projectnew\Debug\grk-cw9.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />

View File

@ -1,83 +1 @@
 main.cpp
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\minwindef.h(130,1): warning C4005: 'APIENTRY': macro redefinition
C:\Users\sjule\source\repos\GRK_Project\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123,1): message : see previous definition of 'APIENTRY'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(87,16): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(88,14): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(90,17): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(91,15): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(100,9): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(101,9): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(111,29): warning C4244: 'return': conversion from 'int' to 'float', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(115,29): warning C4244: 'return': conversion from 'int' to 'float', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(337,30): warning C4305: 'initializing': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(375,17): warning C4101: 'data': unreferenced local variable
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(400,38): warning C4305: '=': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(429,16): warning C4305: 'initializing': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(642,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(650,73): warning C4244: 'argument': conversion from 'int' to 'GLfloat', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(650,66): warning C4244: 'argument': conversion from 'int' to 'GLfloat', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(662,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(680,98): warning C4305: 'argument': truncation from 'double' to 'T'
with
[
T=float
]
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(683,68): warning C4305: 'argument': truncation from 'double' to 'T'
with
[
T=float
]
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(728,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(742,99): warning C4305: 'argument': truncation from 'double' to 'T'
with
[
T=float
]
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(745,69): warning C4305: 'argument': truncation from 'double' to 'T'
with
[
T=float
]
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(790,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(804,99): warning C4305: 'argument': truncation from 'double' to 'T'
with
[
T=float
]
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(807,69): warning C4305: 'argument': truncation from 'double' to 'T'
with
[
T=float
]
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(931,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(932,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(933,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(936,31): warning C4305: 'initializing': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(937,25): warning C4305: 'initializing': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(991,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(992,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(993,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(996,31): warning C4305: 'initializing': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(997,23): warning C4305: 'initializing': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1099,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1122,87): warning C4305: 'argument': truncation from 'double' to 'T'
with
[
T=float
]
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1122,223): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1151,73): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1155,81): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1156,93): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1157,83): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1158,83): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1254,108): warning C4305: 'argument': truncation from 'double' to 'T'
with
[
T=float
]
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1592,21): warning C4305: '-=': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1594,21): warning C4305: '+=': truncation from 'double' to 'float'
Box.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
grk-cw9.vcxproj -> C:\Users\sjule\source\repos\GRK_Project\Debug\grk-cw9.exe
 grk-cw9.vcxproj -> C:\Users\Anna Niczyporuk\source\repos\GRK_Projectnew\Debug\grk-cw9.exe

View File

@ -1,2 +1,2 @@
PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.34.31933:TargetPlatformVersion=10.0.22621.0:
Debug|Win32|C:\Users\sjule\source\repos\GRK_Project\|
PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.33.31629:TargetPlatformVersion=10.0.19041.0:
Debug|Win32|C:\Users\Anna Niczyporuk\source\repos\GRK_Projectnew\|

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

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

@ -2,7 +2,7 @@
<Project>
<ProjectOutputs>
<ProjectOutput>
<FullPath>C:\Users\jedrz\Desktop\projekt final\GRK_Project\Release\grk-cw9.exe</FullPath>
<FullPath>C:\Users\jedrz\Desktop\graf\GRK_Project\Release\grk-cw9.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />

Binary file not shown.

Binary file not shown.

View File

@ -1,86 +1,69 @@
 main.cpp
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h(130,1): warning C4005: "APIENTRY": ponowna definicja makra
C:\Users\jedrz\Desktop\projekt final\GRK_Project\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY”
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\Collision_System.cpp(87,16): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\Collision_System.cpp(88,14): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\Collision_System.cpp(90,17): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\Collision_System.cpp(91,15): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\Collision_System.cpp(100,9): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\Collision_System.cpp(101,9): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\Collision_System.cpp(111,29): warning C4244: "return": konwersja z "int" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\Collision_System.cpp(115,29): warning C4244: "return": konwersja z "int" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(342,30): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(372,17): warning C4101: "data": lokalna zmienna, do której nie istnieje odwołanie
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(397,38): warning C4305: "=": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(426,16): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(644,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(657,73): warning C4244: "argument": konwersja z "int" do "GLfloat", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(657,66): warning C4244: "argument": konwersja z "int" do "GLfloat", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(669,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(687,98): warning C4305: "argument": obcięcie z "double" do "T"
C:\Users\jedrz\Desktop\graf\GRK_Project\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY”
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(87,16): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(88,14): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(90,17): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(91,15): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(100,9): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(101,9): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(111,29): warning C4244: "return": konwersja z "int" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(115,29): warning C4244: "return": konwersja z "int" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(270,30): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(284,17): warning C4101: "data": lokalna zmienna, do której nie istnieje odwołanie
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(309,38): warning C4305: "=": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(338,16): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(527,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(541,98): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(690,68): warning C4305: "argument": obcięcie z "double" do "T"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(544,68): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(735,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(749,99): warning C4305: "argument": obcięcie z "double" do "T"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(576,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(590,99): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(752,69): warning C4305: "argument": obcięcie z "double" do "T"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(593,69): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(797,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(811,99): warning C4305: "argument": obcięcie z "double" do "T"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(685,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(694,108): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(814,69): warning C4305: "argument": obcięcie z "double" do "T"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(702,87): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(938,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(939,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(940,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(943,31): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(944,25): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(998,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(999,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(1000,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(1003,31): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(1004,23): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(1106,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(1120,108): warning C4305: "argument": obcięcie z "double" do "T"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(702,223): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(705,59): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(1133,85): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(1159,73): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(1163,81): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(1164,93): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(1165,83): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(1166,83): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(1264,108): warning C4305: "argument": obcięcie z "double" do "T"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(706,37): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(726,2): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(825,108): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(1610,21): warning C4305: "-=": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(1612,21): warning C4305: "+=": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(1088,21): warning C4305: "-=": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(1090,21): warning C4305: "+=": obcięcie z "double" do "float"
Trwa generowanie kodu
99 of 727 functions (13.6%) were compiled, the rest were copied from previous compilation.
2 of 687 functions ( 0.3%) were compiled, the rest were copied from previous compilation.
0 functions were new in current compilation
24 functions had inline decision re-evaluated but remain unchanged
10 functions had inline decision re-evaluated but remain unchanged
Zakończono generowanie kodu
grk-cw9.vcxproj -> C:\Users\jedrz\Desktop\projekt final\GRK_Project\Release\grk-cw9.exe
grk-cw9.vcxproj -> C:\Users\jedrz\Desktop\graf\GRK_Project\Release\grk-cw9.exe

View File

@ -1,2 +1,2 @@
PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.33.31629:TargetPlatformVersion=10.0.19041.0:
Release|Win32|C:\Users\jedrz\Desktop\projekt final\GRK_Project\|
Release|Win32|C:\Users\jedrz\Desktop\graf\GRK_Project\|

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -44,8 +44,6 @@
<None Include="shaders\shader_9_1.vert" />
<None Include="shaders\shader_8_sun.frag" />
<None Include="shaders\shader_8_sun.vert" />
<None Include="shaders\shader_bubble.frag" />
<None Include="shaders\shader_bubble.vert" />
<None Include="shaders\shader_shadowap_sun.frag" />
<None Include="shaders\shader_shadowap_sun.vert" />
<None Include="shaders\shader_skybox.frag" />

View File

@ -154,11 +154,5 @@
<None Include="shaders\shader_tex_pbr_arm.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_bubble.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_bubble.vert">
<Filter>Shader Files</Filter>
</None>
</ItemGroup>
</Project>

View File

@ -1,14 +0,0 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by grk-cw9.rc
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@ -1,13 +0,0 @@
#version 410 core
uniform vec3 objectColor;
uniform vec3 lightDir;
in vec3 interpNormal;
void main()
{
vec3 normal = normalize(interpNormal);
float diffuse = 0.4;
gl_FragColor = vec4(objectColor * diffuse, 1.0);
}

View File

@ -1,16 +0,0 @@
#version 410 core
layout(location = 0) in vec3 vertexPosition;
layout(location = 1) in vec3 vertexNormal;
layout(location = 2) in vec2 vertexTexCoord;
uniform mat4 modelViewProjectionMatrix;
uniform mat4 modelMatrix;
out vec3 interpNormal;
void main()
{
gl_Position = modelViewProjectionMatrix * vec4(vertexPosition, 1.0);
interpNormal = (modelMatrix * vec4(vertexNormal, 0.0)).xyz;
}

View File

@ -1,6 +1,6 @@
#version 430 core
float AMBIENT = 0.5;
float AMBIENT = 0.03;
float PI = 3.14;
uniform sampler2D depthMap;

View File

@ -1,299 +0,0 @@
#version 430 core
uniform vec3 iResolution;
uniform sampler2D iChannel1;
uniform samplerCube iChannel0;
uniform float time;
//in float iDate;
in vec4 bubblePosition;
out vec4 fragColor;
/*
Fast Thin-Film Interference
This is a performance-optimized version of my previous
thin-film interference shader here: https://www.shadertoy.com/view/XddXRj
This version also fixes a platform-specific bug and has
a few other tweaks as well.
Thin-film interference and chromatic dispersion are simulated at
six different wavelengths and then downsampled to RGB.
*/
// To see just the reflection (no refraction/transmission) uncomment this next line:
//#define REFLECTANCE_ONLY
// performance and raymarching options
#define INTERSECTION_PRECISION 0.01 // raymarcher intersection precision
#define ITERATIONS 20 // max number of iterations
#define AA_SAMPLES 1 // anti aliasing samples
#define BOUND 6.0 // cube bounds check
#define DIST_SCALE 0.9 // scaling factor for raymarching position update
// optical properties
#define DISPERSION 0.05 // dispersion amount
#define IOR 0.9 // base IOR value specified as a ratio
#define THICKNESS_SCALE 32.0 // film thickness scaling factor
#define THICKNESS_CUBEMAP_SCALE 0.1 // film thickness cubemap scaling factor
#define REFLECTANCE_SCALE 3.0 // reflectance scaling factor
#define REFLECTANCE_GAMMA_SCALE 2.0 // reflectance gamma scaling factor
#define FRESNEL_RATIO 0.7 // fresnel weight for reflectance
#define SIGMOID_CONTRAST 8.0 // contrast enhancement
#define TWO_PI 6.28318530718
#define WAVELENGTHS 6 // number of wavelengths, not a free parameter
// iq's cubemap function
vec3 fancyCube( sampler2D sam, in vec3 d, in float s, in float b )
{
vec3 colx = textureLod( sam, 0.5 + s*d.yz/d.x, b ).xyz;
vec3 coly = textureLod( sam, 0.5 + s*d.zx/d.y, b ).xyz;
vec3 colz = textureLod( sam, 0.5 + s*d.xy/d.z, b ).xyz;
vec3 n = d*d;
return (colx*n.x + coly*n.y + colz*n.z)/(n.x+n.y+n.z);
}
// iq's 3D noise function
float hash( float n ){
return fract(sin(n)*43758.5453);
}
float noise( in vec3 x ) {
vec3 p = floor(x);
vec3 f = fract(x);
f = f*f*(3.0-2.0*f);
float n = p.x + p.y*57.0 + 113.0*p.z;
return mix(mix(mix( hash(n+ 0.0), hash(n+ 1.0),f.x),
mix( hash(n+ 57.0), hash(n+ 58.0),f.x),f.y),
mix(mix( hash(n+113.0), hash(n+114.0),f.x),
mix( hash(n+170.0), hash(n+171.0),f.x),f.y),f.z);
}
vec3 noise3(vec3 x) {
return vec3( noise(x+vec3(123.456,.567,.37)),
noise(x+vec3(.11,47.43,19.17)),
noise(x) );
}
// a sphere with a little bit of warp
float sdf( vec3 p ) {
vec3 n = vec3(sin(time * 0.5), sin(time * 0.3), cos(time * 0.2));
vec3 q = 0.1 * (noise3(p + n) - 0.5);
return length(q + p) - 3.5;
}
vec3 fresnel( vec3 rd, vec3 norm, vec3 n2 ) {
vec3 r0 = pow((1.0-n2)/(1.0+n2), vec3(2));
return r0 + (1. - r0)*pow(clamp(1. + dot(rd, norm), 0.0, 1.0), 5.);
}
vec3 calcNormal( in vec3 pos ) {
const float eps = INTERSECTION_PRECISION;
const vec3 v1 = vec3( 1.0,-1.0,-1.0);
const vec3 v2 = vec3(-1.0,-1.0, 1.0);
const vec3 v3 = vec3(-1.0, 1.0,-1.0);
const vec3 v4 = vec3( 1.0, 1.0, 1.0);
return normalize( v1*sdf( pos + v1*eps ) +
v2*sdf( pos + v2*eps ) +
v3*sdf( pos + v3*eps ) +
v4*sdf( pos + v4*eps ) );
}
#define GAMMA_CURVE 50.0
#define GAMMA_SCALE 4.5
vec3 filmic_gamma(vec3 x) {
return log(GAMMA_CURVE * x + 1.0) / GAMMA_SCALE;
}
vec3 filmic_gamma_inverse(vec3 y) {
return (1.0 / GAMMA_CURVE) * (exp(GAMMA_SCALE * y) - 1.0);
}
// sample weights for the cubemap given a wavelength i
// room for improvement in this function
#define GREEN_WEIGHT 2.8
vec3 texCubeSampleWeights(float i) {
vec3 w = vec3((1.0 - i) * (1.0 - i), GREEN_WEIGHT * i * (1.0 - i), i * i);
return w / dot(w, vec3(1.0));
}
vec3 sampleCubeMap(vec3 i, vec3 rd) {
vec3 col = textureLod(iChannel0, rd * vec3(1.0,-1.0,1.0), 0.0).xyz;
return vec3(
dot(texCubeSampleWeights(i.x), col),
dot(texCubeSampleWeights(i.y), col),
dot(texCubeSampleWeights(i.z), col)
);
}
vec3 sampleCubeMap(vec3 i, vec3 rd0, vec3 rd1, vec3 rd2) {
vec3 col0 = textureLod(iChannel0, rd0 * vec3(1.0,-1.0,1.0), 0.0).xyz;
vec3 col1 = textureLod(iChannel0, rd1 * vec3(1.0,-1.0,1.0), 0.0).xyz;
vec3 col2 = textureLod(iChannel0, rd2 * vec3(1.0,-1.0,1.0), 0.0).xyz;
return vec3(
dot(texCubeSampleWeights(i.x), col0),
dot(texCubeSampleWeights(i.y), col1),
dot(texCubeSampleWeights(i.z), col2)
);
}
vec3 sampleWeights(float i) {
return vec3((1.0 - i) * (1.0 - i), GREEN_WEIGHT * i * (1.0 - i), i * i);
}
vec3 resample(vec3 wl0, vec3 wl1, vec3 i0, vec3 i1) {
vec3 w0 = sampleWeights(wl0.x);
vec3 w1 = sampleWeights(wl0.y);
vec3 w2 = sampleWeights(wl0.z);
vec3 w3 = sampleWeights(wl1.x);
vec3 w4 = sampleWeights(wl1.y);
vec3 w5 = sampleWeights(wl1.z);
return i0.x * w0 + i0.y * w1 + i0.z * w2
+ i1.x * w3 + i1.y * w4 + i1.z * w5;
}
// downsample to RGB
vec3 resampleColor(vec3[WAVELENGTHS] rds, vec3 refl0, vec3 refl1, vec3 wl0, vec3 wl1) {
#ifdef REFLECTANCE_ONLY
vec3 intensity0 = refl0;
vec3 intensity1 = refl1;
#else
vec3 cube0 = sampleCubeMap(wl0, rds[0], rds[1], rds[2]);
vec3 cube1 = sampleCubeMap(wl1, rds[3], rds[4], rds[5]);
vec3 intensity0 = filmic_gamma_inverse(cube0) + refl0;
vec3 intensity1 = filmic_gamma_inverse(cube1) + refl1;
#endif
vec3 col = resample(wl0, wl1, intensity0, intensity1);
return 1.4 * filmic_gamma(col / float(WAVELENGTHS));
}
vec3 resampleColorSimple(vec3 rd, vec3 wl0, vec3 wl1) {
vec3 cube0 = sampleCubeMap(wl0, rd);
vec3 cube1 = sampleCubeMap(wl1, rd);
vec3 intensity0 = filmic_gamma_inverse(cube0);
vec3 intensity1 = filmic_gamma_inverse(cube1);
vec3 col = resample(wl0, wl1, intensity0, intensity1);
return 1.4 * filmic_gamma(col / float(WAVELENGTHS));
}
// compute the wavelength/IOR curve values.
vec3 iorCurve(vec3 x) {
return x;
}
vec3 attenuation(float filmThickness, vec3 wavelengths, vec3 normal, vec3 rd) {
return 0.5 + 0.5 * cos(((THICKNESS_SCALE * filmThickness)/(wavelengths + 1.0)) * dot(normal, rd));
}
vec3 contrast(vec3 x) {
return 1.0 / (1.0 + exp(-SIGMOID_CONTRAST * (x - 0.5)));
}
void doCamera( out vec3 camPos, out vec3 camTar, in float time, in vec4 m ) {
camTar = vec3(0.0,0.0,0.0);
if (max(m.z, m.w) <= 0.0) {
float an = 1.5 + sin(time * 0.05) * 4.0;
camPos = vec3(6.5*sin(an), 0.0 ,6.5*cos(an));
} else {
float an = 10.0 * m.x - 5.0;
camPos = vec3(6.5*sin(an),10.0 * m.y - 5.0,6.5*cos(an));
}
}
mat3 calcLookAtMatrix( in vec3 ro, in vec3 ta, in float roll )
{
vec3 ww = normalize( ta - ro );
vec3 uu = normalize( cross(ww,vec3(sin(roll),cos(roll),0.0) ) );
vec3 vv = normalize( cross(uu,ww));
return mat3( uu, vv, ww );
}
void main()
{
vec2 p = (-iResolution.xy + 2.0*gl_FragCoord.xy)/iResolution.y;
//vec4 m = vec4(iMouse.xy/iResolution.xy, iMouse.zw);
// camera movement
//vec3 ro, ta;
//doCamera( ro, ta, iTime, m );
float dh = (0.666 / iResolution.y);
const float rads = TWO_PI / float(AA_SAMPLES);
vec3 col = vec3(0.0);
vec3 wavelengths0 = vec3(1.0, 0.8, 0.6);
vec3 wavelengths1 = vec3(0.4, 0.2, 0.0);
vec3 iors0 = IOR + iorCurve(wavelengths0) * DISPERSION;
vec3 iors1 = IOR + iorCurve(wavelengths1) * DISPERSION;
vec3 rds[WAVELENGTHS];
for (int samp = 0; samp < AA_SAMPLES; samp++) {
vec2 dxy = dh * vec2(cos(float(samp) * rads), sin(float(samp) * rads));
vec3 rd = normalize(vec3(p.xy + dxy, 0.2)); // 1.5 is the lens length
vec3 pos = vec3(-bubblePosition.z, -bubblePosition.y, bubblePosition.x);
bool hit = false;
for (int j = 0; j < ITERATIONS; j++) {
float t = DIST_SCALE * sdf(pos);
pos += t * rd;
hit = t < INTERSECTION_PRECISION;
if ( clamp(pos, -BOUND, BOUND) != pos || hit ) {
break;
}
}
if (hit) {
vec3 normal = calcNormal(pos);
float filmThickness = fancyCube( iChannel1, normal, THICKNESS_CUBEMAP_SCALE, 0.0 ).x + 0.1;
vec3 att0 = attenuation(filmThickness, wavelengths0, normal, rd);
vec3 att1 = attenuation(filmThickness, wavelengths1, normal, rd);
vec3 f0 = (1.0 - FRESNEL_RATIO) + FRESNEL_RATIO * fresnel(rd, normal, 1.0 / iors0);
vec3 f1 = (1.0 - FRESNEL_RATIO) + FRESNEL_RATIO * fresnel(rd, normal, 1.0 / iors1);
vec3 rrd = reflect(rd, normal);
vec3 cube0 = REFLECTANCE_GAMMA_SCALE * att0 * sampleCubeMap(wavelengths0, rrd);
vec3 cube1 = REFLECTANCE_GAMMA_SCALE * att1 * sampleCubeMap(wavelengths1, rrd);
vec3 refl0 = REFLECTANCE_SCALE * filmic_gamma_inverse(mix(vec3(0), cube0, f0));
vec3 refl1 = REFLECTANCE_SCALE * filmic_gamma_inverse(mix(vec3(0), cube1, f1));
rds[0] = refract(rd, normal, iors0.x);
rds[1] = refract(rd, normal, iors0.y);
rds[2] = refract(rd, normal, iors0.z);
rds[3] = refract(rd, normal, iors1.x);
rds[4] = refract(rd, normal, iors1.y);
rds[5] = refract(rd, normal, iors1.z);
col += resampleColor(rds, refl0, refl1, wavelengths0, wavelengths1);
} else {
col += resampleColorSimple(rd, wavelengths0, wavelengths1);
}
}
col /= float(AA_SAMPLES);
fragColor = vec4( contrast(col), 1.0 );
}

View File

@ -1,19 +0,0 @@
#version 430 core
layout(location = 0) in vec3 vertexPosition;
layout(location = 1) in vec3 vertexNormal;
layout(location = 2) in vec2 vertexTexCoord;
uniform mat4 transformation;
//uniform float time;
out vec4 bubblePosition;
//out float iDate;
void main()
{
bubblePosition = transformation * vec4(vertexPosition, 1.0);
//vec3 bubbling = sdf(bubblePosition2.xyz);
gl_Position = transformation * vec4(vertexPosition, 1.0);
//gl_Position = vec4(vertexPosition, 1.0);
}

View File

@ -1,6 +1,6 @@
#version 430 core
float AMBIENT = 0.5;
float AMBIENT = 0.03;
float PI = 3.14;
uniform sampler2D depthMap;

View File

@ -1,6 +1,6 @@
#version 430 core
float AMBIENT = 0.5;
float AMBIENT = 0.03;
float PI = 3.14;
@ -9,7 +9,6 @@ uniform vec3 cameraPos;
uniform sampler2D depthMap;
uniform sampler2D depthMap2;
uniform sampler2D depthMap3;
uniform sampler2D colorTexture;
uniform sampler2D metallicTexture;
uniform sampler2D roughnessTexture;
@ -18,7 +17,6 @@ uniform sampler2D normalSampler;
uniform vec3 sunDir;
uniform vec3 sunDir2;
uniform vec3 lampDir;
uniform vec3 sunColor;
uniform vec3 lightPos;
@ -51,7 +49,6 @@ float roughness;
in vec4 sunSpacePos;
in vec4 sunSpacePos2;
in vec4 lampSpacePos;
float DistributionGGX(vec3 normal, vec3 H, float roughness){
@ -136,19 +133,6 @@ float calculateShadow2() {
return (0.5*(diff)/abs(diff))+0.5;
}
float calculateShadow3() {
vec4 sunSpacePosNormalized = (0.5 * sunSpacePos / (sunSpacePos.w)) + 0.5;
float closestDepth = texture2D(depthMap3, sunSpacePosNormalized.xy).r;
if(closestDepth + 0.01 > sunSpacePosNormalized.z){
return 1.0;
} else {
return 0.0;
}
}
void main()
{
@ -167,8 +151,8 @@ void main()
vec3 lightDir = normalize(lightDirTS);
//vec3 lightDir = normalize(lightPos-worldPos);
vec3 ao = texture2D(aoTexture, vecTex).xyz;
vec3 ambient = AMBIENT*ao*color;
vec3 ambient = texture2D(aoTexture, vecTex).xyz*color;
vec3 attenuatedlightColor = lightColor/pow(length(lightPos-worldPos),2);
vec3 ilumination;
ilumination = ambient+PBRLight(lightDir,attenuatedlightColor,normal,viewDir);
@ -191,8 +175,5 @@ void main()
//sun2
ilumination=ilumination+PBRLight(sunDir2, sunColor * calculateShadow2(), normal, viewDir);
ilumination=ilumination+PBRLight(lampDir, sunColor * calculateShadow3(), normal, viewDir);
outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1);
}

View File

@ -10,7 +10,6 @@ uniform mat4 transformation;
uniform mat4 modelMatrix;
uniform mat4 LightVP;
uniform mat4 LightVP2;
uniform mat4 LightVP3;
out vec3 vecNormal;
out vec3 worldPos;
@ -27,7 +26,6 @@ out vec3 sunDirTS;
out vec2 vecTex;
out vec4 sunSpacePos;
out vec4 sunSpacePos2;
out vec4 lampSpacePos;
void main()
@ -51,5 +49,5 @@ void main()
sunDirTS = TBN*sunDir;
sunSpacePos=LightVP*modelMatrix*vec4(vertexPosition,1);
sunSpacePos2=LightVP2*modelMatrix*vec4(vertexPosition,1);
lampSpacePos=LightVP3*modelMatrix*vec4(vertexPosition,1);
}

View File

@ -1,6 +1,6 @@
#version 430 core
float AMBIENT = 0.5;
float AMBIENT = 0.03;
float PI = 3.14;
@ -9,14 +9,12 @@ uniform vec3 cameraPos;
uniform sampler2D depthMap;
uniform sampler2D depthMap2;
uniform sampler2D depthMap3;
uniform sampler2D colorTexture;
uniform sampler2D armTexture;
uniform sampler2D normalSampler;
uniform vec3 sunDir;
uniform vec3 sunDir2;
uniform vec3 lampDir;
uniform vec3 sunColor;
uniform vec3 lightPos;
@ -49,7 +47,7 @@ float roughness;
in vec4 sunSpacePos;
in vec4 sunSpacePos2;
in vec4 lampSpacePos;
float DistributionGGX(vec3 normal, vec3 H, float roughness){
float a = roughness*roughness;
@ -134,19 +132,6 @@ float calculateShadow2() {
return (0.5*(diff)/abs(diff))+0.5;
}
float calculateShadow3() {
vec4 sunSpacePosNormalized = (0.5 * sunSpacePos / (sunSpacePos.w)) + 0.5;
float closestDepth = texture2D(depthMap3, sunSpacePosNormalized.xy).r;
if(closestDepth + 0.01 > sunSpacePosNormalized.z){
return 1.0;
} else {
return 0.0;
}
}
void main()
{
color = texture2D(colorTexture, vecTex).xyz;
@ -164,8 +149,8 @@ void main()
vec3 lightDir = normalize(lightDirTS);
//vec3 lightDir = normalize(lightPos-worldPos);
float ao = texture2D(armTexture, vecTex).x;
vec3 ambient = AMBIENT*ao*color;
vec3 ambient = texture2D(armTexture, vecTex).x*color;
vec3 attenuatedlightColor = lightColor/pow(length(lightPos-worldPos),2);
vec3 ilumination;
ilumination = ambient+PBRLight(lightDir,attenuatedlightColor,normal,viewDir);
@ -174,12 +159,12 @@ void main()
//flashlight
//vec3 spotlightDir= normalize(spotlightDirTS);
//vec3 spotlightDir= normalize(spotlightPos-worldPos);
vec3 spotlightDir= normalize(spotlightPos-worldPos);
//float angle_atenuation = clamp((dot(-normalize(spotlightPos-worldPos),spotlightConeDir)-0.5)*3,0,1);
//attenuatedlightColor = angle_atenuation*spotlightColor/pow(length(spotlightPos-worldPos),2);
//ilumination=ilumination+PBRLight(spotlightDir,attenuatedlightColor,normal,viewDir);
float angle_atenuation = clamp((dot(-normalize(spotlightPos-worldPos),spotlightConeDir)-0.5)*3,0,1);
attenuatedlightColor = angle_atenuation*spotlightColor/pow(length(spotlightPos-worldPos),2);
ilumination=ilumination+PBRLight(spotlightDir,attenuatedlightColor,normal,viewDir);
//sun
//ilumination=ilumination+PBRLight(sunDir,sunColor,normal,viewDir);
@ -187,9 +172,6 @@ void main()
//sun2
ilumination=ilumination+PBRLight(sunDir2, sunColor * calculateShadow2(), normal, viewDir);
//lamp
ilumination=ilumination+PBRLight(lampDir, sunColor * calculateShadow3(), normal, viewDir);
outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1);
}

View File

@ -10,7 +10,6 @@ uniform mat4 transformation;
uniform mat4 modelMatrix;
uniform mat4 LightVP;
uniform mat4 LightVP2;
uniform mat4 LightVP3;
out vec3 vecNormal;
out vec3 worldPos;
@ -27,7 +26,6 @@ out vec3 sunDirTS;
out vec2 vecTex;
out vec4 sunSpacePos;
out vec4 sunSpacePos2;
out vec4 lampSpacePos;
void main()
{
@ -50,5 +48,5 @@ void main()
sunDirTS = TBN*sunDir;
sunSpacePos=LightVP*modelMatrix*vec4(vertexPosition,1);
sunSpacePos2=LightVP2*modelMatrix*vec4(vertexPosition,1);
lampSpacePos=LightVP3*modelMatrix*vec4(vertexPosition,1);
}

View File

@ -207,7 +207,7 @@ void main () {
//vec4 light = vec4(1.0, 10.0, 0.0, 0.1);
vec4 light = vec4(lightPos, 1);
//light = light*rotMat;
vec3 colorBlue = vec3(0.0,0.1,0.2);
vec3 colorBlue = vec3(0.0,0.1,0.3);
vec3 colorLightBlue = vec3(0.0, 0.04, 0.2);
vec3 colorWhite = vec3(0.9, 0.9, 0.9);

View File

@ -37,7 +37,6 @@ namespace models {
Core::RenderContext roomContext;
Core::RenderContext spaceshipContext;
Core::RenderContext sphereContext;
Core::RenderContext sphereBubbleContext;
//Core::RenderContext windowContext;
Core::RenderContext testContext;
Core::RenderContext cubeContext;
@ -79,25 +78,8 @@ namespace models {
Core::RenderContext books1Context;
Core::RenderContext books2Context;
Core::RenderContext cactusContext;
Core::RenderContext fanContext;
Core::RenderContext fanTopContext;
Core::RenderContext colission1Context;
Core::RenderContext colission2Context;
Core::RenderContext colission3Context;
Core::RenderContext colission4Context;
Core::RenderContext handleContext;
Core::RenderContext pillow1Context;
Core::RenderContext pillow2Context;
Core::RenderContext pillow3Context;
Core::RenderContext painting1Context;
Core::RenderContext painting2Context;
Core::RenderContext mug2Context;
Core::RenderContext bookContext;
Core::RenderContext lampContext;
Core::RenderContext cableContext;
}
std::vector<std::string> faces = {
"textures/skybox_2/right.jpg",
"textures/skybox_2/left.jpg",
@ -107,15 +89,6 @@ std::vector<std::string> faces = {
"textures/skybox_2/back.jpg",
};
std::vector<std::string> facesBubble = {
"textures/bubbleSkybox/right.jpg",
"textures/bubbleSkybox/left.jpg",
"textures/bubbleSkybox/top.jpg",
"textures/bubbleSkybox/bottom.jpg",
"textures/bubbleSkybox/front.jpg",
"textures/bubbleSkybox/back.jpg",
};
namespace texture {
GLuint water;
GLuint rust;
@ -242,47 +215,12 @@ namespace texture {
GLuint cactus_ao;
GLuint cactus_normal;
GLuint metal;
GLuint pillow1;
GLuint pillow2;
GLuint pillow3;
GLuint painting1;
GLuint painting2;
GLuint mug2_albedo;
GLuint mug2_metallic;
GLuint mug2_roughness;
GLuint mug2_ao;
GLuint mug2_normal;
GLuint book_albedo;
GLuint book_metallic;
GLuint book_roughness;
GLuint book_ao;
GLuint book_normal;
GLuint spray_albedo;
GLuint spray_metallic;
GLuint spray_roughness;
GLuint spray_ao;
GLuint spray_normal;
GLuint lamp_albedo;
GLuint lamp_metallic;
GLuint lamp_ao;
GLuint lamp_roughness;
GLuint lamp_normal;
}
GLuint depthMapFBO;
GLuint depthMap;
GLuint depthMapFBO2;
GLuint depthMap2;
GLuint depthMapFBO3;
GLuint depthMap3;
int speed = 300;
GLuint program;
GLuint programSun;
@ -295,37 +233,17 @@ GLuint programSkybox;
GLuint programWater;
GLuint skyboxTexture;
GLuint bubbleTexture0, bubbleTexture1;
GLuint programBubble;
GLuint bubblesColor;
GLuint bubbleTexture;
Core::RenderContext bubbleContext;
Core::Shader_Loader shaderLoader;
Core::RenderContext waterContext;
Core::RenderContext shipContext;
Core::RenderContext sphereContext;
TriangleSoup water;
CONST int bubbleQuantity = 2000;
glm::vec3 bubbleLocation[bubbleQuantity];
glm::vec3 bubbleOriginalLocation[bubbleQuantity];
bool bubbleZdir[bubbleQuantity];
bool bubbleXdir[bubbleQuantity];
CONST int bubblenumber = 500;
glm::vec3 bubbleLocationInRoom[bubblenumber];
glm::vec3 bubbleOriginalLocationInRoom[bubblenumber];
bool bubbleZdirInRoom[bubblenumber];
bool bubbleXdirInRoom[bubblenumber];
glm::vec3 sunPos = glm::vec3(-4.740971f, 2.149999f, -0.069280f);
glm::vec3 sunDir = glm::vec3(-0.93633f, 0.351106, 0.003226f);
glm::vec3 sunPos2 = glm::vec3(4.040971f, 2.149999f, -0.739280f);
glm::vec3 sunDir2 = glm::vec3(0.93633f, 0.351106, -0.003226f);
glm::vec3 lampPos = glm::vec3(1.5, 1.15, -1.1);
glm::vec3 lampDir = glm::vec3(-0.2, -1.0, 0.3);
glm::vec3 sunColor = glm::vec3(0.9f, 0.9f, 0.7f) * 5;
glm::vec3 cameraPos = glm::vec3(0.479490f, 1.250000f, -2.124680f);
@ -339,30 +257,24 @@ GLuint VAO, VBO;
float aspectRatio = 1.f;
float exposition = 1.f;
float spotlightPhi = 3.14 / 4;
glm::vec3 spotlightPos = glm::vec3(1.5, 1.15, -1.1);
glm::vec3 spotlightConeDir = glm::vec3(-0.2, -1.0, 0.3);
glm::vec3 spotlightColor = glm::vec3(0.4, 0.4, 0.9) * 3;
glm::mat4 lightVP = glm::ortho(-3.f, 2.3f, -1.3f, 3.f, -1.0f, 40.0f) * glm::lookAt(sunPos, sunPos - sunDir, glm::vec3(0, 1, 0));
glm::mat4 lightVP2 = glm::ortho(-3.f, 2.3f, -1.3f, 3.f, -1.0f, 40.0f) * glm::lookAt(sunPos2, sunPos2 - sunDir2, glm::vec3(0, 1, 0));
glm::mat4 lightVP3 = glm::ortho(-3.f, 2.3f, -1.3f, 3.f, -1.0f, 40.0f) * glm::lookAt(spotlightPos, spotlightPos - spotlightConeDir, glm::vec3(0, 1, 0));
glm::vec3 pointlightPos = glm::vec3(0, 2, 0);
glm::vec3 pointlightColor = glm::vec3(0.9, 0.6, 0.6);
glm::vec3 spotlightPos = glm::vec3(0, 0, 0);
glm::vec3 spotlightConeDir = glm::vec3(0, 0, 0);
glm::vec3 spotlightColor = glm::vec3(0.4, 0.4, 0.9) * 3;
float spotlightPhi = 3.14 / 4;
glm::vec3 lightPos = glm::vec3(-8, 4, 2);
float lastTime = -1.f;
float deltaTime = 0.f;
void bubbleManager();
void bubbleManagerInRoom();
bool bubble = false;
unsigned int loadSkybox(std::vector<std::string> faces1)
unsigned int loadSkybox(std::vector<std::string> faces)
{
unsigned int textureID;
glGenTextures(1, &textureID);
@ -372,7 +284,7 @@ unsigned int loadSkybox(std::vector<std::string> faces1)
unsigned char* data;
for (unsigned int i = 0; i < 6; i++)
{
unsigned char* data = SOIL_load_image(faces1[i].c_str(), &w, &h, 0, SOIL_LOAD_RGBA);
unsigned char* data = SOIL_load_image(faces[i].c_str(), &w, &h, 0, SOIL_LOAD_RGBA);
glTexImage2D(
GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, data
@ -415,8 +327,8 @@ glm::mat4 createCameraMatrix()
void drawSkybox(Core::RenderContext& context, glm::mat4 transformation, GLuint textureID) {
glUseProgram(programSkybox);
glUniformMatrix4fv(glGetUniformLocation(programSkybox, "transformation"), 1, GL_FALSE, (float*)&transformation);
Core::SetActiveTexture(textureID, "colorTexture", programSkybox, 0);
glBindTexture(GL_TEXTURE_CUBE_MAP, textureID);
Core::SetActiveTexture(textureID, "colorTexture", programSkybox, 0);
Core::DrawContext(context);
}
glm::mat4 createPerspectiveMatrix()
@ -458,7 +370,6 @@ void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec
glUniform3f(glGetUniformLocation(program, "sunDir"), sunDir.x, sunDir.y, sunDir.z);
glUniform3f(glGetUniformLocation(program, "sunDir2"), sunDir2.x, sunDir2.y, sunDir2.z);
glUniform3f(glGetUniformLocation(program, "lampDir"), lampDir.x, lampDir.y, lampDir.z);
glUniform3f(glGetUniformLocation(program, "sunColor"), sunColor.x, sunColor.y, sunColor.z);
glUniform3f(glGetUniformLocation(program, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z);
@ -474,8 +385,6 @@ void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec
Core::SetActiveTexture(depthMap, "depthMap", program, 0);
glUniformMatrix4fv(glGetUniformLocation(program, "LightVP2"), 1, GL_FALSE, (float*)&lightVP2);
Core::SetActiveTexture(depthMap2, "depthMap2", program, 1);
glUniformMatrix4fv(glGetUniformLocation(program, "LightVP3"), 1, GL_FALSE, (float*)&lightVP3);
Core::SetActiveTexture(depthMap3, "depthMap3", program, 2);
Core::DrawContext(context);
}
@ -498,7 +407,6 @@ void drawObjectTex(Core::RenderContext& context, glm::mat4 modelMatrix, float ro
glUniform3f(glGetUniformLocation(programTex, "sunDir"), sunDir.x, sunDir.y, sunDir.z);
glUniform3f(glGetUniformLocation(programTex, "sunDir2"), sunDir2.x, sunDir2.y, sunDir2.z);
glUniform3f(glGetUniformLocation(program, "lampDir"), lampDir.x, lampDir.y, lampDir.z);
glUniform3f(glGetUniformLocation(programTex, "sunColor"), sunColor.x, sunColor.y, sunColor.z);
glUniform3f(glGetUniformLocation(programTex, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z);
@ -517,8 +425,6 @@ void drawObjectTex(Core::RenderContext& context, glm::mat4 modelMatrix, float ro
Core::SetActiveTexture(depthMap, "depthMap", programTex, 1);
glUniformMatrix4fv(glGetUniformLocation(programTex, "LightVP2"), 1, GL_FALSE, (float*)&lightVP2);
Core::SetActiveTexture(depthMap2, "depthMap2", programTex, 2);
glUniformMatrix4fv(glGetUniformLocation(program, "LightVP3"), 1, GL_FALSE, (float*)&lightVP3);
Core::SetActiveTexture(depthMap3, "depthMap3", program, 3);
Core::DrawContext(context);
}
@ -541,7 +447,6 @@ void drawObjectTexPBR(Core::RenderContext& context, glm::mat4 modelMatrix, GLuin
glUniform3f(glGetUniformLocation(programTexPBR, "sunDir"), sunDir.x, sunDir.y, sunDir.z);
glUniform3f(glGetUniformLocation(programTexPBR, "sunDir2"), sunDir2.x, sunDir2.y, sunDir2.z);
glUniform3f(glGetUniformLocation(program, "lampDir"), lampDir.x, lampDir.y, lampDir.z);
glUniform3f(glGetUniformLocation(programTexPBR, "sunColor"), sunColor.x, sunColor.y, sunColor.z);
glUniform3f(glGetUniformLocation(programTexPBR, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z);
@ -564,8 +469,6 @@ void drawObjectTexPBR(Core::RenderContext& context, glm::mat4 modelMatrix, GLuin
Core::SetActiveTexture(depthMap, "depthMap", programTexPBR, 0);
glUniformMatrix4fv(glGetUniformLocation(programTexPBR, "LightVP2"), 1, GL_FALSE, (float*)&lightVP2);
Core::SetActiveTexture(depthMap2, "depthMap2", programTexPBR, 6);
glUniformMatrix4fv(glGetUniformLocation(program, "LightVP3"), 1, GL_FALSE, (float*)&lightVP3);
Core::SetActiveTexture(depthMap3, "depthMap3", program, 7);
Core::DrawContext(context);
}
@ -588,7 +491,6 @@ void drawObjectTexPBR_ARM(Core::RenderContext& context, glm::mat4 modelMatrix, G
glUniform3f(glGetUniformLocation(programTexPBR_ARM, "sunDir"), sunDir.x, sunDir.y, sunDir.z);
glUniform3f(glGetUniformLocation(programTexPBR_ARM, "sunDir2"), sunDir2.x, sunDir2.y, sunDir2.z);
glUniform3f(glGetUniformLocation(program, "lampDir"), lampDir.x, lampDir.y, lampDir.z);
glUniform3f(glGetUniformLocation(programTexPBR_ARM, "sunColor"), sunColor.x, sunColor.y, sunColor.z);
glUniform3f(glGetUniformLocation(programTexPBR_ARM, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z);
@ -609,8 +511,6 @@ void drawObjectTexPBR_ARM(Core::RenderContext& context, glm::mat4 modelMatrix, G
Core::SetActiveTexture(depthMap, "depthMap", programTexPBR_ARM, 0);
glUniformMatrix4fv(glGetUniformLocation(programTexPBR_ARM, "LightVP2"), 1, GL_FALSE, (float*)&lightVP2);
Core::SetActiveTexture(depthMap2, "depthMap2", programTexPBR_ARM, 4);
glUniformMatrix4fv(glGetUniformLocation(program, "LightVP3"), 1, GL_FALSE, (float*)&lightVP3);
Core::SetActiveTexture(depthMap3, "depthMap3", program, 5);
Core::DrawContext(context);
}
@ -621,51 +521,9 @@ void drawObjectDepth(Core::RenderContext context, glm::mat4 viewProjectionMatrix
glUniformMatrix4fv(glGetUniformLocation(programDepth, "modelMatrix"), 1, GL_FALSE, (float*)&modelMatrix);
Core::DrawContext(context);
}
void drawBubbleColor(Core::RenderContext context, glm::mat4 modelMatrix, glm::vec3 color)
{
GLuint program = bubblesColor;
glUseProgram(program);
glUniform3f(glGetUniformLocation(program, "objectColor"), color.x, color.y, color.z);
glUniform3f(glGetUniformLocation(program, "lightDir"), sunDir.x, sunDir.y, sunDir.z);
glm::mat4 transformation = createPerspectiveMatrix() * createCameraMatrix() * modelMatrix;
glUniformMatrix4fv(glGetUniformLocation(program, "modelViewProjectionMatrix"), 1, GL_FALSE, (float*)&transformation);
glUniformMatrix4fv(glGetUniformLocation(program, "modelMatrix"), 1, GL_FALSE, (float*)&modelMatrix);
Core::DrawContext(context);
glUseProgram(0);
}
void drawBubble(glm::mat4 transformSphere) {
float time = glfwGetTime();
glUseProgram(programBubble);
glm::mat4 cameraMatrix = createCameraMatrix();
glm::mat4 perspectiveMatrix = createPerspectiveMatrix();
glm::mat4 viewProjectionMatrix = perspectiveMatrix * cameraMatrix;
glm::mat4 transformation = viewProjectionMatrix * transformSphere;
glm::mat3 bubbleSkyboxViewMatrix = glm::mat3(perspectiveMatrix * glm::mat4(glm::mat3(cameraMatrix)));
if (bubble == false) {
glUniformMatrix4fv(glGetUniformLocation(programBubble, "transformation"), 1, GL_FALSE, (float*)&transformSphere);
}
else {
glUniformMatrix4fv(glGetUniformLocation(programBubble, "transformation"), 1, GL_FALSE, (float*)&transformation);
}
glUniform3f(glGetUniformLocation(programBubble, "iResolution"), WIDTH, HEIGHT, 1.0);
glUniform1f(glGetUniformLocation(programBubble, "time"), time);
Core::SetActiveTexture(bubbleTexture0, "iChannel0", programBubble, 1);
glBindTexture(GL_TEXTURE_CUBE_MAP, bubbleTexture0);
Core::SetActiveTexture(bubbleTexture1, "iChannel1", programBubble, 0);
glBindTexture(GL_TEXTURE_2D, bubbleTexture1);
Core::DrawContext(models::sphereBubbleContext);
}
void renderShadowapSun(float angle) {
void renderShadowapSun() {
float time = glfwGetTime();
glViewport(0, 0, SHADOW_WIDTH, SHADOW_HEIGHT);
//uzupelnij o renderowanie glebokosci do tekstury
@ -679,10 +537,6 @@ void renderShadowapSun(float angle) {
glClear(GL_DEPTH_BUFFER_BIT);
//ustawianie programu
glUseProgram(programDepth);
glm::mat4 p1 = glm::translate(glm::mat4(), -glm::vec3(-2.103f, 1.0699f, -2.3338f));
glm::mat4 p2 = glm::translate(glm::mat4(), glm::vec3(-2.103f, 1.0699f, -2.3338f));
glm::mat4 rotate = p2 * glm::rotate(glm::mat4(), glm::radians(angle * speed), glm::vec3(1, 0, 0)) * p1;
drawObjectDepth(sphereContext, lightVP, glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::scale(glm::vec3(0.3f)));
@ -714,19 +568,6 @@ void renderShadowapSun(float angle) {
drawObjectDepth(models::books1Context, lightVP, glm::mat4());
drawObjectDepth(models::books2Context, lightVP, glm::mat4());
drawObjectDepth(models::cactusContext, lightVP, glm::mat4());
drawObjectDepth(models::fanContext, lightVP,glm::mat4());
drawObjectDepth(models::fanTopContext, lightVP, glm::mat4()*rotate);
drawObjectDepth(models::tableContext, lightVP, glm::mat4());
drawObjectDepth(models::handleContext, lightVP, glm::mat4());
drawObjectDepth(models::pillow1Context, lightVP, glm::mat4());
drawObjectDepth(models::pillow2Context, lightVP, glm::mat4());
drawObjectDepth(models::pillow3Context, lightVP, glm::mat4());
drawObjectDepth(models::painting1Context, lightVP, glm::mat4());
drawObjectDepth(models::painting2Context, lightVP, glm::mat4());
drawObjectDepth(models::mug2Context, lightVP, glm::mat4());
drawObjectDepth(models::bookContext, lightVP, glm::mat4());
drawObjectDepth(models::lampContext, lightVP, glm::mat4());
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glViewport(0, 0, WIDTH, HEIGHT);
}
@ -776,81 +617,6 @@ void renderShadowapSun2() {
drawObjectDepth(models::books1Context, lightVP2, glm::mat4());
drawObjectDepth(models::books2Context, lightVP2, glm::mat4());
drawObjectDepth(models::cactusContext, lightVP2, glm::mat4());
drawObjectDepth(models::fanContext, lightVP2, glm::mat4());
drawObjectDepth(models::fanTopContext, lightVP2, glm::mat4());
drawObjectDepth(models::tableContext, lightVP2, glm::mat4());
drawObjectDepth(models::handleContext, lightVP, glm::mat4());
drawObjectDepth(models::pillow1Context, lightVP2, glm::mat4());
drawObjectDepth(models::pillow2Context, lightVP2, glm::mat4());
drawObjectDepth(models::pillow3Context, lightVP2, glm::mat4());
drawObjectDepth(models::painting1Context, lightVP2, glm::mat4());
drawObjectDepth(models::painting2Context, lightVP2, glm::mat4());
drawObjectDepth(models::mug2Context, lightVP2, glm::mat4());
drawObjectDepth(models::bookContext, lightVP2, glm::mat4());
drawObjectDepth(models::lampContext, lightVP2, glm::mat4());
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glViewport(0, 0, WIDTH, HEIGHT);
}
void renderShadowapLamp() {
float time = glfwGetTime();
glViewport(0, 0, SHADOW_WIDTH, SHADOW_HEIGHT);
//uzupelnij o renderowanie glebokosci do tekstury
glUseProgram(programDepth);
//ustawianie przestrzeni rysowania
glViewport(0, 0, SHADOW_WIDTH, SHADOW_HEIGHT);
//bindowanie FBO
glBindFramebuffer(GL_FRAMEBUFFER, depthMapFBO3);
//czyszczenie mapy głębokości
glClear(GL_DEPTH_BUFFER_BIT);
//ustawianie programu
glUseProgram(programDepth);
drawObjectDepth(sphereContext, lightVP3, glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::scale(glm::vec3(0.3f)));
drawObjectDepth(sphereContext,
lightVP3, glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::eulerAngleY(time) * glm::translate(glm::vec3(1.f, 0, 0)) * glm::scale(glm::vec3(0.1f)));
drawObjectDepth(models::bedContext, lightVP3, glm::mat4());
drawObjectDepth(models::mattressContext, lightVP3, glm::mat4());
drawObjectDepth(models::bed_pillowContext, lightVP3, glm::mat4());
drawObjectDepth(models::floorContext, lightVP3, glm::mat4());
drawObjectDepth(models::desk_topContext, lightVP3, glm::mat4());
drawObjectDepth(models::desk_bottomContext, lightVP3, glm::mat4());
drawObjectDepth(models::framesContext, lightVP3, glm::mat4());
drawObjectDepth(models::wallContext, lightVP3, glm::mat4());
drawObjectDepth(models::foldingContext, lightVP3, glm::mat4());
drawObjectDepth(models::couchContext, lightVP3, glm::mat4());
drawObjectDepth(models::laptopContext, lightVP3, glm::mat4());
drawObjectDepth(models::doorContext, lightVP3, glm::mat4());
drawObjectDepth(models::chairContext, lightVP3, glm::mat4());
drawObjectDepth(models::roofContext, lightVP3, glm::mat4());
drawObjectDepth(models::blanketContext, lightVP3, glm::mat4());
drawObjectDepth(models::drawerContext, lightVP3, glm::mat4());
drawObjectDepth(models::clockContext, lightVP3, glm::mat4());
drawObjectDepth(models::plantContext, lightVP3, glm::mat4());
drawObjectDepth(models::c_tableContext, lightVP3, glm::mat4());
drawObjectDepth(models::foldingContext, lightVP3, glm::mat4());
drawObjectDepth(models::mugContext, lightVP3, glm::mat4());
drawObjectDepth(models::carContext, lightVP3, glm::mat4());
drawObjectDepth(models::books1Context, lightVP3, glm::mat4());
drawObjectDepth(models::books2Context, lightVP3, glm::mat4());
drawObjectDepth(models::cactusContext, lightVP3, glm::mat4());
drawObjectDepth(models::fanContext, lightVP3, glm::mat4());
drawObjectDepth(models::fanTopContext, lightVP3, glm::mat4());
drawObjectDepth(models::tableContext, lightVP3, glm::mat4());
drawObjectDepth(models::handleContext, lightVP3, glm::mat4());
drawObjectDepth(models::pillow1Context, lightVP3, glm::mat4());
drawObjectDepth(models::pillow2Context, lightVP3, glm::mat4());
drawObjectDepth(models::pillow3Context, lightVP3, glm::mat4());
drawObjectDepth(models::painting1Context, lightVP3, glm::mat4());
drawObjectDepth(models::painting2Context, lightVP3, glm::mat4());
drawObjectDepth(models::mug2Context, lightVP3, glm::mat4());
drawObjectDepth(models::bookContext, lightVP3, glm::mat4());
drawObjectDepth(models::lampContext, lightVP3, glm::mat4());
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glViewport(0, 0, WIDTH, HEIGHT);
}
@ -895,26 +661,6 @@ void initDepthMap2()
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
void initDepthMap3()
{
glGenFramebuffers(1, &depthMapFBO3);
glGenTextures(1, &depthMap3);
glBindTexture(GL_TEXTURE_2D, depthMap3);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
SHADOW_WIDTH, SHADOW_HEIGHT, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glBindFramebuffer(GL_FRAMEBUFFER, depthMapFBO3);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, depthMap3, 0);
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
void drawObjectColorWater(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec3 color, float time, GLuint textureID) {
glm::mat4 viewProjectionMatrix = createPerspectiveMatrix() * glm::mat4(glm::mat3(createCameraMatrix()));
@ -931,188 +677,16 @@ void drawObjectColorWater(Core::RenderContext& context, glm::mat4 modelMatrix, g
water.render();
}
void bubbleMovement(int i) {
float bubbleWobblingDivider = 100;
int x = floor(bubbleLocation[i].x);
int y = floor(bubbleLocation[i].y);
int z = floor(bubbleLocation[i].z);
float bubbleWobbling = 0.0005;
float bubbleDown = 0.05;
//printf(xDir ? "true\n" : "false\n");
//printf(zDir ? "true\n" : "false\n");
if (bubbleLocation[i].x >= bubbleOriginalLocation[i].x + bubbleWobbling * bubbleWobblingDivider) {
bubbleXdir[i] = false;
//printf("herex1\n");
}
else if (bubbleLocation[i].x < bubbleOriginalLocation[i].x - bubbleWobbling * bubbleWobblingDivider) {
bubbleXdir[i] = true;
//printf("herex2\n");
}
if (bubbleLocation[i].z >= bubbleOriginalLocation[i].z + bubbleWobbling * bubbleWobblingDivider) {
bubbleZdir[i] = false;
}
else if (bubbleLocation[i].z < bubbleOriginalLocation[i].z - bubbleWobbling * bubbleWobblingDivider) {
bubbleZdir[i] = true;
}
if (bubbleXdir[i]) {
bubbleLocation[i].x += bubbleWobbling;
}
else {
bubbleLocation[i].x -= bubbleWobbling;
}
if (bubbleZdir[i]) {
bubbleLocation[i].z += bubbleWobbling;
}
else {
bubbleLocation[i].z -= bubbleWobbling;
}
if (y <= -10.0) {
bubbleLocation[i].y = 10.0;
}
if (x <= (-1.0 + 2.9) && x > (-1.0 - 2.9) && z <= (-1.2 + 3.2) && z > (-1.2 - 3.2) && y <= (1.0 + 2.36)) {
bubbleLocation[i].y = 10.0;
}
bubbleLocation[i].y -= bubbleDown;
}
void bubbleMovementInRoom(int i) {
float bubbleWobblingDivider = 100;
int x = floor(bubbleLocationInRoom[i].x);
int y = floor(bubbleLocationInRoom[i].y);
int z = floor(bubbleLocationInRoom[i].z);
float bubbleWobbling = 0.0005;
float bubbleUp = 0.02;
//printf(xDir ? "true\n" : "false\n");
//printf(zDir ? "true\n" : "false\n");
if (bubbleLocationInRoom[i].x >= bubbleOriginalLocationInRoom[i].x + bubbleWobbling * bubbleWobblingDivider) {
bubbleXdirInRoom[i] = false;
//printf("herex1\n");
}
else if (bubbleLocationInRoom[i].x < bubbleOriginalLocationInRoom[i].x - bubbleWobbling * bubbleWobblingDivider) {
bubbleXdirInRoom[i] = true;
//printf("herex2\n");
}
if (bubbleLocationInRoom[i].z >= bubbleOriginalLocationInRoom[i].z + bubbleWobbling * bubbleWobblingDivider) {
bubbleZdirInRoom[i] = false;
}
else if (bubbleLocationInRoom[i].z < bubbleOriginalLocationInRoom[i].z - bubbleWobbling * bubbleWobblingDivider) {
bubbleZdirInRoom[i] = true;
}
if (bubbleXdirInRoom[i]) {
bubbleLocationInRoom[i].x += bubbleWobbling;
}
else {
bubbleLocationInRoom[i].x -= bubbleWobbling;
}
if (bubbleZdirInRoom[i]) {
bubbleLocationInRoom[i].z += bubbleWobbling;
}
else {
bubbleLocationInRoom[i].z -= bubbleWobbling;
}
if (y >= (1.0 + 1.9)) {
bubbleLocationInRoom[i].y = -1;
}
if (x <= (-1.0 + 2) && x > (-1.0 - 2) && z <= (-1.2 + 2.3) && z > (-1.2 - 2.3) && y <= (1.0 + 1.9)) {
int l = 0;
}
else {
bubbleLocationInRoom[i].y = -1.0;
}
bubbleLocationInRoom[i].y += bubbleUp;
}
void bubbleManager() {
for (int i = 0; i < bubbleQuantity; i++)
{
bubbleMovement(i);
glm::mat4 modelMatrix = glm::translate(bubbleLocation[i]);
// Scaling models
glm::vec3 scale = glm::vec3(0.01, 0.04, 0.02);
modelMatrix = glm::scale(modelMatrix, scale);
//glUseProgram(programTex);
//drawObjectTex(bubbleContext, modelMatrix, 0, 0, texture::water);
drawBubbleColor(bubbleContext, modelMatrix, glm::vec3(.3f, .55f, 0.96f));
// srand(time(NULL));
float MAX_NUM = 20.0;
bubbleLocation[i].x = (((float)rand() / (float)(RAND_MAX)) * MAX_NUM) - MAX_NUM / 2;
bubbleLocation[i].y = (((float)rand() / (float)(RAND_MAX)) * 10) - 5;
bubbleLocation[i].z = (((float)rand() / (float)(RAND_MAX)) * MAX_NUM) - MAX_NUM / 2;
bubbleOriginalLocation[i] = bubbleLocation[i];
bubbleZdir[i] = true;
bubbleXdir[i] = false;
}
}
void bubbleManagerInRoom() {
for (int i = 0; i < bubblenumber; i++)
{
bubbleMovementInRoom(i);
glm::mat4 modelMatrix = glm::translate(bubbleLocationInRoom[i]);
// Scaling models
glm::vec3 scale = glm::vec3(0.1, 0.1, 0.1);
modelMatrix = glm::scale(modelMatrix, scale);
//glUseProgram(programTex);
//drawObjectTex(bubbleContext, modelMatrix, 0, 0, texture::water);
//drawBubbleColor(bubbleContext, modelMatrix, glm::vec3(.3f, .55f, 0.96f));
drawBubble(modelMatrix);
}
}
void renderScene(GLFWwindow* window)
{
glClearColor(0.4f, 0.4f, 0.8f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
float time = glfwGetTime();
updateDeltaTime(time);
float angle = 0;
angle += static_cast<float>(glfwGetTime());
glm::mat4 p1 = glm::translate(glm::mat4(), -glm::vec3(-2.103f, 1.0699f, -2.3338f));
glm::mat4 p2 = glm::translate(glm::mat4(), glm::vec3(-2.103f, 1.0699f, -2.3338f));
glm::mat4 rotate = p2 * glm::rotate(glm::mat4(), glm::radians(angle * speed), glm::vec3(1, 0, 0)) * p1;
renderShadowapSun(angle);
renderShadowapSun();
renderShadowapSun2();
renderShadowapLamp();
//space lamp
glUseProgram(programSun);
@ -1124,13 +698,12 @@ void renderScene(GLFWwindow* window)
Core::DrawContext(sphereContext);
drawSkybox(models::cubeContext, createPerspectiveMatrix() * glm::mat4(glm::mat3(createCameraMatrix())), skyboxTexture);
glUseProgram(program);
glm::mat4 transform(1.0f);
//transform = glm::rotate(glm::mat4(), angle, glm::vec3(1.0f, 0.0f, 0.0f));
//drawObjectPBR(sphereContext, glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::scale(glm::vec3(0.3f)), glm::vec3(0.2, 0.7, 0.3), 0.3, 0.0);
//drawObjectPBR(models::fanContext, glm::mat4(), glm::vec3(0.01, 0.01, 0.01), 0.1, 0.2);
//drawObjectPBR(models::fanTopContext, glm::mat4()*rotate, glm::vec3(0.01, 0.01, 0.01), 0.1, 0.2);
drawObjectPBR(models::ceilingContext, glm::mat4(), glm::vec3(1,1,1), 0.5, 0);
drawObjectPBR(models::cableContext, glm::mat4(), glm::vec3(0.1, 0.1, 0.1), 0.3, 0.3);
drawObjectPBR(sphereContext, glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::scale(glm::vec3(0.3f)), glm::vec3(0.2, 0.7, 0.3), 0.3, 0.0);
drawObjectPBR(sphereContext,
glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::eulerAngleY(time) * glm::translate(glm::vec3(1.f, 0, 0)) * glm::scale(glm::vec3(0.1f)),
glm::vec3(0.5, 0.5, 0.5), 0.7, 0.0);
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));
@ -1146,27 +719,23 @@ void renderScene(GLFWwindow* window)
// glm::translate(cameraPos + 1.5 * cameraDir + cameraUp * -0.5f) * inveseCameraRotrationMatrix * glm::eulerAngleY(glm::pi<float>()),
// glm::vec3(0.3, 0.3, 0.5)
// );
drawObjectPBR(shipContext,
glm::translate(spaceshipPos) * specshipCameraRotrationMatrix * glm::eulerAngleY(glm::pi<float>()) * glm::scale(glm::vec3(0.03f)),
glm::vec3(0.3, 0.3, 0.5),
0.2, 1.0
);
//spotlightPos = spaceshipPos + 0.2 * spaceshipDir;
//spotlightConeDir = spaceshipDir;
spotlightPos = spaceshipPos + 0.2 * spaceshipDir;
spotlightConeDir = spaceshipDir;
glUseProgram(programTex);
//drawObjectTex(models::marbleBustContext, glm::translate(glm::mat4(), glm::vec3(0, 0, -0.2)), 0.2, 0, texture::rust);
//drawObjectTex(models::marbleBustContext, glm::translate(glm::mat4(), glm::vec3(0, 0, 0.2)), 0, 0.2, texture::rust);
//drawObjectTex(models::doorContext, glm::mat4(), 0, 0, texture::screen);
drawObjectTex(models::screenContext, glm::mat4(), 0, 0, texture::screen);
drawObjectTex(models::handleContext, glm::mat4(), 0, 0.2, texture::rust);
drawObjectTex(models::pillow1Context, glm::mat4(), 0.5, 0, texture::pillow1);
drawObjectTex(models::pillow2Context, glm::mat4(), 0.5, 0, texture::pillow2);
drawObjectTex(models::pillow3Context, glm::mat4(), 0.5, 0, texture::pillow3);
drawObjectTex(models::fanContext, glm::mat4(), 0.1, 0.2, texture::panels_albedo);
drawObjectTex(models::fanTopContext, glm::mat4() * rotate, 0.1, 0.2, texture::panels_albedo);
drawObjectTex(models::painting1Context, glm::mat4(), 0.5, 0.3, texture::painting1);
drawObjectTex(models::painting2Context, glm::mat4(), 0.5, 0.3, texture::painting2);
glUseProgram(programTexPBR);
drawObjectTexPBR(models::tableContext, glm::mat4(), texture::table_roughness, texture::table_metallic, texture::table_albedo, texture::table_normal, texture::table_ao);
//drawObjectTexPBR(models::deskContext, glm::mat4(), texture::table_roughness, texture::table_metallic, texture::table_albedo, texture::table_normal, texture::table_ao);
drawObjectTexPBR(models::bedContext, glm::mat4(), texture::wood_roughness, texture::wood_metallic, texture::wood_albedo, texture::wood_normal, texture::wood_ao);
drawObjectTexPBR(models::mattressContext, glm::mat4(), texture::sheets_roughness, texture::sheets_metallic, texture::sheets_albedo, texture::sheets_normal, texture::sheets_ao);
drawObjectTexPBR(models::bed_pillowContext, glm::mat4(), texture::sheets_roughness, texture::sheets_metallic, texture::sheets_albedo, texture::sheets_normal, texture::sheets_ao);
@ -1186,13 +755,8 @@ void renderScene(GLFWwindow* window)
drawObjectTexPBR(models::cactusContext, glm::mat4(), texture::cactus_roughness, texture::cactus_metallic, texture::cactus_albedo, texture::cactus_normal, texture::cactus_ao);
drawObjectTexPBR(models::books1Context, glm::mat4(), texture::books_roughness, texture::books_metallic, texture::books_albedo, texture::books_normal, texture::books_ao);
drawObjectTexPBR(models::books2Context, glm::mat4(), texture::books_roughness, texture::books_metallic, texture::books_albedo, texture::books_normal, texture::books_ao);
drawObjectTexPBR(models::mug2Context, glm::mat4(), texture::mug2_roughness, texture::mug2_metallic, texture::mug2_albedo, texture::mug2_normal, texture::mug2_ao);
drawObjectTexPBR(models::bookContext, glm::mat4(), texture::book_roughness, texture::book_metallic, texture::book_albedo, texture::book_normal, texture::book_ao);
drawObjectTexPBR(shipContext,
glm::translate(spaceshipPos) * specshipCameraRotrationMatrix * glm::eulerAngleY(glm::pi<float>()) * glm::scale(glm::vec3(0.03f)),
texture::spray_roughness, texture::spray_metallic, texture::spray_albedo, texture::spray_normal, texture::spray_ao
);
drawObjectTexPBR(models::lampContext, glm::mat4(), texture::lamp_roughness, texture::lamp_metallic, texture::lamp_albedo, texture::lamp_normal, texture::lamp_ao);
glUseProgram(programTexPBR_ARM);
//drawObjectTexPBR_ARM(models::chairContext, glm::mat4(), texture::rock_albedo, texture::rock_normal, texture::rock_arm);
@ -1209,23 +773,20 @@ void renderScene(GLFWwindow* window)
drawObjectTexPBR_ARM(models::c_tableContext, glm::mat4(), texture::c_table_albedo, texture::c_table_normal, texture::c_table_arm);
drawObjectTexPBR_ARM(models::vaseContext, glm::mat4(), texture::vase_albedo, texture::vase_normal, texture::vase_arm);
glUseProgram(programWater);
//drawObjectColorWater(waterContext, glm::translate(glm::mat4(1.0), glm::vec3(0.0, -1.0, 0.0)) * glm::scale(glm::vec3(30.0)), glm::vec3(0.1, 0.1, 0.95), time, texture::water);
drawObjectColorWater(waterContext, glm::translate(glm::mat4(1.0), glm::vec3(0.0f, -1.7f, 0.0f)), glm::vec4(0.1, 0.1, 0.95, 0.5), time, texture::water);
//test depth buffer
/*glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glUseProgram(programTest);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, depthMap3);
glBindTexture(GL_TEXTURE_2D, depthMap);
Core::DrawContext(models::testContext);*/
bubbleManagerInRoom();
bubbleManager();
glUseProgram(0);
glfwSwapBuffers(window);
}
@ -1265,7 +826,6 @@ void init(GLFWwindow* window)
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
initDepthMap();
initDepthMap2();
initDepthMap3();
PlaySound(TEXT("sound/ocean.wav"), NULL, SND_ASYNC|SND_LOOP);
glEnable(GL_DEPTH_TEST);
program = shaderLoader.CreateProgram("shaders/shader_9_1.vert", "shaders/shader_9_1.frag");
@ -1277,16 +837,14 @@ void init(GLFWwindow* window)
programTex = shaderLoader.CreateProgram("shaders/shader_tex.vert", "shaders/shader_tex.frag");
programTexPBR = shaderLoader.CreateProgram("shaders/shader_tex_pbr.vert", "shaders/shader_tex_pbr.frag");
programTexPBR_ARM = shaderLoader.CreateProgram("shaders/shader_tex_pbr_arm.vert", "shaders/shader_tex_pbr_arm.frag");
programBubble = shaderLoader.CreateProgram("shaders/shader_bubble.vert", "shaders/shader_bubble.frag");
bubblesColor = shaderLoader.CreateProgram("shaders/bubbles_shader_color.vert", "shaders/bubbles_shader_color.frag");
water.readOBJ("./models/plane2.obj");
texture::water = Core::LoadTexture("textures/test.png");
texture::rust = Core::LoadTexture("textures/rust.jpg");
texture::table_albedo = Core::LoadTexture("textures/table/albedo.png");
texture::table_metallic = Core::LoadTexture("textures/table/metallic.png");
texture::table_roughness = Core::LoadTexture("textures/table/roughness.png");
texture::table_ao = Core::LoadTexture("textures/table/ao.png");
texture::table_normal = Core::LoadTexture("textures/table/normal.png");
texture::table_albedo = Core::LoadTexture("textures/table_albedo.png");
texture::table_metallic = Core::LoadTexture("textures/table_metallic.png");
texture::table_roughness = Core::LoadTexture("textures/table_roughness.png");
texture::table_ao = Core::LoadTexture("textures/table_ao.png");
texture::table_normal = Core::LoadTexture("textures/table_normal.jpg");
texture::wood_albedo = Core::LoadTexture("textures/wood_albedo.jpg");
texture::wood_metallic = Core::LoadTexture("textures/wood_metallic.jpg");
texture::wood_roughness = Core::LoadTexture("textures/wood_roughness.jpg");
@ -1340,11 +898,11 @@ void init(GLFWwindow* window)
texture::paper_stack = Core::LoadTexture("textures/paperstack.png");
texture::white_paint_albedo = Core::LoadTexture("textures/white_wall/albedo.png");
texture::white_paint_metallic = Core::LoadTexture("textures/white_wall/metallic.png");
texture::white_paint_roughness = Core::LoadTexture("textures/white_wall/roughness.png");
texture::white_paint_ao = Core::LoadTexture("textures/white_wall/ao.png");
texture::white_paint_normal = Core::LoadTexture("textures/white_wall/normal.png");
texture::white_paint_albedo = Core::LoadTexture("textures/white_paint/albedo.png");
texture::white_paint_metallic = Core::LoadTexture("textures/white_paint/metallic.png");
texture::white_paint_roughness = Core::LoadTexture("textures/white_paint/roughness.png");
texture::white_paint_ao = Core::LoadTexture("textures/white_paint/ao.png");
texture::white_paint_normal = Core::LoadTexture("textures/white_paint/normal.png");
texture::drawer_albedo = Core::LoadTexture("textures/drawer/albedo.png");
texture::drawer_arm = Core::LoadTexture("textures/drawer/arm.png");
@ -1409,46 +967,12 @@ void init(GLFWwindow* window)
texture::cactus_roughness = Core::LoadTexture("textures/cactus/roughness.png");
texture::cactus_ao = Core::LoadTexture("textures/cactus/ao.png");
texture::cactus_normal = Core::LoadTexture("textures/cactus/normal.png");
texture::pillow1 = Core::LoadTexture("textures/pillow/black.png");
texture::pillow2 = Core::LoadTexture("textures/pillow/white.png");
texture::pillow3 = Core::LoadTexture("textures/pillow/yellow.png");
texture::painting1 = Core::LoadTexture("textures/painting1.png");
texture::painting2 = Core::LoadTexture("textures/painting2.png");
texture::mug2_albedo = Core::LoadTexture("textures/mug2/albedo.png");
texture::mug2_metallic = Core::LoadTexture("textures/mug2/metallic.png");
texture::mug2_roughness = Core::LoadTexture("textures/mug2/roughness.png");
texture::mug2_ao = Core::LoadTexture("textures/mug2/ao.png");
texture::mug2_normal = Core::LoadTexture("textures/mug2/normal.png");
texture::book_albedo = Core::LoadTexture("textures/book/albedo.png");
texture::book_metallic = Core::LoadTexture("textures/book/metallic.png");
texture::book_roughness = Core::LoadTexture("textures/book/roughness.png");
texture::book_ao = Core::LoadTexture("textures/book/ao.png");
texture::book_normal = Core::LoadTexture("textures/book/normal.png");
texture::spray_albedo = Core::LoadTexture("textures/spray/albedo.png");
texture::spray_metallic = Core::LoadTexture("textures/spray/metallic.png");
texture::spray_roughness = Core::LoadTexture("textures/spray/roughness.png");
texture::spray_ao = Core::LoadTexture("textures/spray/ao.png");
texture::spray_normal = Core::LoadTexture("textures/spray/normal.png");
texture::lamp_albedo = Core::LoadTexture("textures/lamp/albedo.png");
texture::lamp_metallic = Core::LoadTexture("textures/lamp/metallic.png");
texture::lamp_roughness = Core::LoadTexture("textures/lamp/roughness.png");
texture::lamp_ao = Core::LoadTexture("textures/lamp/ao.png");
texture::lamp_normal = Core::LoadTexture("textures/lamp/normal.png");
texture::metal = Core::LoadTexture("textures/metal.png");
loadModelToContext("models/bubble.obj", bubbleContext, false);
loadModelToContext("./models/sphere.obj", sphereContext, false);
loadModelToContext("./models/sphere_bubble.obj", models::sphereBubbleContext, false);
loadModelToContext("./models/spray.obj", shipContext, false);
loadModelToContext("./models/spaceship.obj", shipContext, false);
//loadModelToContext("./models/bed.obj", models::bedContext, true);
//loadModelToContext("./models/chair.obj", models::chairContext, true);
loadModelToContext("./models/desk.obj", models::deskContext, false);
loadModelToContext("./models/desk.obj", models::deskContext, true);
//loadModelToContext("./models/door.obj", models::doorContext, false);
//loadModelToContext("./models/drawer.obj", models::drawerContext, false);
loadModelToContext("./models/marbleBust.obj", models::marbleBustContext, false);
@ -1461,14 +985,14 @@ void init(GLFWwindow* window)
//loadModelToContext("./models/window.obj", models::windowContext, true);
loadModelToContext("./models/test.obj", models::testContext, false);
loadModelToContext("./models/cube.obj", models::cubeContext, false);
loadModelToContext("./models/tab.obj", models::tableContext, true);
//loadModelToContext("./models/table.obj", models::tableContext, false);
loadModelToContext("./models/wall.obj", models::wallContext, false);
loadModelToContext("./models/roof.obj", models::roofContext, false);
loadModelToContext("./models/window.obj", models::windowContext, false);
loadModelToContext("./models/window.obj", models::windowContext, true);
loadModelToContext("./models/ground.obj", models::floorContext, false);
loadModelToContext("./models/ground_001.obj", models::ceilingContext, false);
loadModelToContext("./models/bed_frame.obj", models::bedContext, true);
loadModelToContext("./models/bed_mattress.obj", models::mattressContext, false);
loadModelToContext("./models/bed_mattress.obj", models::mattressContext, true);
loadModelToContext("./models/bed_pillow.obj", models::bed_pillowContext, false);
loadModelToContext("./models/paplan.obj", models::blanketContext, false);
@ -1483,9 +1007,9 @@ void init(GLFWwindow* window)
loadModelToContext("./models/potted_plant_04.obj", models::plantContext, false);
loadModelToContext("./models/modern_coffee_table_01.obj", models::c_tableContext, false);
loadModelToContext("./models/20848_Folding_Screen_v3.obj", models::foldingContext, true);
loadModelToContext("./models/Foot_Rest_001.obj", models::couchContext, true);
loadModelToContext("./models/Foot_Rest_001.obj", models::couchContext, false);
loadModelToContext("./models/dor.obj", models::doorContext, false);
loadModelToContext("./models/uploads_files_1938755_KAUSTBY.obj", models::chairContext, true);
loadModelToContext("./models/uploads_files_1938755_KAUSTBY.obj", models::chairContext, false);
loadModelToContext("./models/ceramic_vase_01.obj", models::vaseContext, false);
loadModelToContext("./models/laptop.obj", models::laptopContext, false);
loadModelToContext("./models/screen.obj", models::screenContext, false);
@ -1494,32 +1018,10 @@ void init(GLFWwindow* window)
loadModelToContext("./models/cactus.obj", models::cactusContext, false);
loadModelToContext("./models/books1.obj", models::books1Context, false);
loadModelToContext("./models/books2.obj", models::books2Context, false);
loadModelToContext("./models/fan.obj", models::fanContext, false);
loadModelToContext("./models/fan_top.obj", models::fanTopContext, false);
loadModelToContext("./models/colission1.obj", models::colission1Context, true);
loadModelToContext("./models/colission2.obj", models::colission2Context, true);
loadModelToContext("./models/colission3.obj", models::colission3Context, true);
loadModelToContext("./models/colission4.obj", models::colission4Context, true);
loadModelToContext("./models/handle.obj", models::handleContext, false);
loadModelToContext("./models/pillow1.obj", models::pillow1Context, false);
loadModelToContext("./models/pillow2.obj", models::pillow2Context, false);
loadModelToContext("./models/pillow3.obj", models::pillow3Context, false);
loadModelToContext("./models/painting1.obj", models::painting1Context, false);
loadModelToContext("./models/painting2.obj", models::painting2Context, false);
loadModelToContext("./models/mug2.obj", models::mug2Context, false);
loadModelToContext("./models/book.obj", models::bookContext, false);
loadModelToContext("./models/lamp.obj", models::lampContext, false);
loadModelToContext("./models/cable.obj", models::cableContext, false);
collisionSystem.calculateSceneBounding();
loadModelToContext("./models/ceramic_vase_01.obj", models::vaseContext, true);
//collisionSystem.calculateSceneBounding();
skyboxTexture = loadSkybox(faces);
bubbleTexture0 = loadSkybox(facesBubble);
bubbleTexture1 = Core::LoadTexture("textures/bubbleNoise.jpg");
//drawSkybox(models::cubeContext, transformation, skyboxTexture);
/*glUseProgram(programSkybox);
glUniform1i(glGetUniformLocation(programSkybox, "skybox"), skyboxTexture);
@ -1560,44 +1062,20 @@ void processInput(GLFWwindow* window)
spaceshipDir = glm::vec3(glm::eulerAngleY(-angleSpeed) * glm::vec4(spaceshipDir, 0));
if (glfwGetKey(window, GLFW_KEY_H) == GLFW_PRESS) {
texture::screen = Core::LoadTexture("textures/main.jpg");
PlaySound(TEXT("sound/main.wav"), NULL, SND_ASYNC | SND_LOOP);
PlaySound(TEXT("sound/main.wav"), NULL, SND_ASYNC);
}
if (glfwGetKey(window, GLFW_KEY_J) == GLFW_PRESS) {
texture::screen = Core::LoadTexture("textures/heroes.jpg");
PlaySound(TEXT("sound/grass.wav"), NULL, SND_ASYNC | SND_LOOP);
PlaySound(TEXT("sound/grass.wav"), NULL, SND_ASYNC);
}
if (glfwGetKey(window, GLFW_KEY_K) == GLFW_PRESS) {
texture::screen = Core::LoadTexture("textures/necro.png");
PlaySound(TEXT("sound/necro.wav"), NULL, SND_ASYNC | SND_LOOP);
PlaySound(TEXT("sound/necro.wav"), NULL, SND_ASYNC);
}
if (glfwGetKey(window, GLFW_KEY_L) == GLFW_PRESS) {
texture::screen = Core::LoadTexture("textures/visual.png");
PlaySound(TEXT("sound/ocean.wav"), NULL, SND_ASYNC|SND_LOOP);
}
if (glfwGetKey(window, GLFW_KEY_N) == GLFW_PRESS) {
bubble = false;
}
if (glfwGetKey(window, GLFW_KEY_M) == GLFW_PRESS) {
bubble = true;
}
if (glfwGetKey(window, GLFW_KEY_B) == GLFW_PRESS) {
for (int i = 0; i < bubblenumber; i++)
{
// srand(time(NULL));
float MAX_NUM = 20.0;
bubbleLocationInRoom[i].x = (((float)rand() / (float)(RAND_MAX)) * MAX_NUM) - MAX_NUM / 2;
bubbleLocationInRoom[i].y = (((float)rand() / (float)(RAND_MAX)) * 10) - 5;
bubbleLocationInRoom[i].z = (((float)rand() / (float)(RAND_MAX)) * MAX_NUM) - MAX_NUM / 2;
bubbleOriginalLocationInRoom[i] = bubbleLocationInRoom[i];
bubbleZdirInRoom[i] = true;
bubbleXdirInRoom[i] = false;
}
}
cameraDir = spaceshipDir;
cameraPos = newSpaceshipPos - 0.5 * spaceshipDir + glm::vec3(0, 1, 0) * 0.2f;
@ -1621,15 +1099,6 @@ void processInput(GLFWwindow* window)
float z = collisionSystem.getRelativeZ(spaceshipPos.z);
printf("matrix[%ff][%ff]\n", z, x);
}
if (glfwGetKey(window, GLFW_KEY_I) == GLFW_PRESS) {
speed = 0;
}
if (glfwGetKey(window, GLFW_KEY_O) == GLFW_PRESS) {
speed = 300;
}
if (glfwGetKey(window, GLFW_KEY_P) == GLFW_PRESS) {
speed = 600;
}
//cameraDir = glm::normalize(-cameraPos);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 446 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 488 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 523 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 MiB

After

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 538 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 546 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 651 KiB

Some files were not shown because too many files have changed in this diff Show More