Compare commits

..

37 Commits

Author SHA1 Message Date
382f4a24b5 Zaktualizuj 'Readme.md' 2023-02-13 17:12:39 +01:00
06dc058198 Dodanie 'R' 2023-02-13 17:12:10 +01:00
e4666be97a Usuń 'cw 9/Readme.md' 2023-02-13 17:11:54 +01:00
1cd78953da Usuń 'Re' 2023-02-13 17:11:22 +01:00
3f0bad6376 Dodanie 'Re' 2023-02-13 17:11:07 +01:00
340d6f26f2 Dodanie 'cw 9/Readme.md' 2023-02-13 17:09:50 +01:00
596f482622 Final version 2023-02-13 09:51:58 +01:00
XsedoX
79f13b93e5 Merge branch 'master' of https://git.wmi.amu.edu.pl/s464869/GRK_Project 2023-02-12 22:27:34 +01:00
XsedoX
acd60b813a skybox... zrobiłem ile mogłem 2023-02-12 22:27:27 +01:00
6e7b8b0359 Merge pull request 'ready for new bubble shader' (#10) from fix into master
Reviewed-on: #10
2023-02-12 21:29:40 +01:00
f38842f977 ready for new bubble shader 2023-02-12 21:29:00 +01:00
187fb7dafa Merge pull request 'fix' (#9) from fix into master
Reviewed-on: #9
2023-02-12 19:48:20 +01:00
AnielaWalczak
a5e49e770b ostatnia zmiana mam nadzieje ze działa xd 2023-02-12 18:49:15 +01:00
d0fe09283c minor fixes 2023-02-12 18:31:51 +01:00
d994de46eb To Aniela robiła 2023-02-12 18:18:56 +01:00
2344bae670 Merge pull request '100% final' (#7) from improvements_2 into master
Reviewed-on: #7
2023-02-12 14:48:52 +01:00
fabeef2cd6 100% final 2023-02-12 14:47:40 +01:00
c1fedc7af3 Merge pull request 'improvements_2' (#6) from improvements_2 into master
Reviewed-on: #6
2023-02-12 11:21:22 +01:00
18e6ebc7af final room version 2023-02-12 11:20:21 +01:00
1a04846f1e na dzis fajrant 2023-02-11 22:33:04 +01:00
c5abb02d90 ao fix + colissions with walls 2023-02-11 20:44:24 +01:00
0a7eb60b12 add interactive fan + shadows 2023-02-11 19:00:49 +01:00
4d3b1f67e4 Rozwiazanie konfliktow 2023-02-11 15:05:18 +01:00
XsedoX
03b4685e54 merge with bubble 2023-02-11 14:03:10 +01:00
XsedoX
10b5d3407b merge with master 2023-02-11 13:48:40 +01:00
AnielaWalczak
57fc609f7f nowe 2023-02-11 13:26:59 +01:00
8db50ad3ad Merge pull request 'improvements' (#4) from improvements into master
Reviewed-on: #4
2023-02-11 13:26:35 +01:00
1467ac2e30 added 2nd shadow map and some new objects 2023-02-11 12:55:02 +01:00
AnielaWalczak
de7216a411 deszcz poza pokojem 2023-02-10 22:58:05 +01:00
fad0a79c5c Add shadows and computer 2023-02-10 19:05:09 +01:00
e214a19f45 Merge pull request 'dodanie_obiektów' (#3) from dodanie_obiektów into master
Reviewed-on: #3
2023-02-10 18:07:42 +01:00
cbb0df4d56 Prześlij pliki do 'cw 9/models' 2023-02-10 17:26:53 +01:00
a112aff82a dodanie obiektów i tekstur 2023-02-10 17:17:51 +01:00
b580685a76 pbr 2023-02-09 17:18:49 +01:00
b4852f9fe1 Porzadki 2023-02-09 10:29:49 +01:00
5f35b93f8f Merge pull request 'System kolizji' (#2) from system-kolizji into master 2023-02-09 10:08:38 +01:00
Artur Ziętkiewicz
0346d04a0b System kolizji 2023-02-09 04:04:15 +01:00
274 changed files with 27416 additions and 168 deletions

Binary file not shown.

Binary file not shown.

10
Readme.md Normal file
View File

@ -0,0 +1,10 @@
# 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

@ -1,38 +1,83 @@
 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\ex_9_1.hpp(108,30): warning C4305: 'initializing': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(122,17): warning C4101: 'data': unreferenced local variable
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(147,38): warning C4305: '=': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(176,16): warning C4305: 'initializing': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(235,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(243,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(243,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(258,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(274,98): warning C4305: 'argument': truncation from 'double' to 'T'
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(277,68): warning C4305: 'argument': truncation from 'double' to 'T'
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(337,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(346,108): warning C4305: 'argument': truncation from 'double' to 'T'
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(391,2): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(438,108): warning C4305: 'argument': truncation from 'double' to 'T'
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(517,21): warning C4305: '-=': truncation from 'double' to 'float'
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(519,21): warning C4305: '+=': truncation from 'double' to '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

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\grk\Release\grk-cw9.exe</FullPath>
<FullPath>C:\Users\jedrz\Desktop\projekt final\GRK_Project\Release\grk-cw9.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />

Binary file not shown.

Binary file not shown.

View File

@ -1,50 +1,86 @@
 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\grk\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY”
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(96,30): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(110,17): warning C4101: "data": lokalna zmienna, do której nie istnieje odwołanie
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(135,38): warning C4305: "=": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(164,16): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(224,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(240,98): warning C4305: "argument": obcięcie z "double" do "T"
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"
with
[
T=float
]
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(243,68): warning C4305: "argument": obcięcie z "double" do "T"
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"
with
[
T=float
]
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(303,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(311,108): warning C4305: "argument": obcięcie z "double" do "T"
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"
with
[
T=float
]
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(319,87): warning C4305: "argument": obcięcie z "double" do "T"
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"
with
[
T=float
]
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(319,223): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(322,59): warning C4305: "argument": obcięcie z "double" do "T"
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"
with
[
T=float
]
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(323,37): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(355,2): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(403,108): warning C4305: "argument": obcięcie z "double" do "T"
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"
with
[
T=float
]
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(479,21): warning C4305: "-=": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grk\cw 9\src\ex_9_1.hpp(481,21): warning C4305: "+=": obcięcie z "double" do "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"
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"
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"
Trwa generowanie kodu
65 of 605 functions (10.7%) were compiled, the rest were copied from previous compilation.
18 functions were new in current compilation
18 functions had inline decision re-evaluated but remain unchanged
99 of 727 functions (13.6%) 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
Zakończono generowanie kodu
grk-cw9.vcxproj -> C:\Users\jedrz\Desktop\grk\Release\grk-cw9.exe
grk-cw9.vcxproj -> C:\Users\jedrz\Desktop\projekt final\GRK_Project\Release\grk-cw9.exe

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -13,6 +13,7 @@
<ItemGroup>
<ClCompile Include="src\Box.cpp" />
<ClCompile Include="src\Camera.cpp" />
<ClCompile Include="src\Collision_System.cpp" />
<ClCompile Include="src\main.cpp" />
<ClCompile Include="src\Render_Utils.cpp" />
<ClCompile Include="src\Shader_Loader.cpp" />
@ -49,6 +50,12 @@
<None Include="shaders\shader_shadowap_sun.vert" />
<None Include="shaders\shader_skybox.frag" />
<None Include="shaders\shader_skybox.vert" />
<None Include="shaders\shader_tex.frag" />
<None Include="shaders\shader_tex.vert" />
<None Include="shaders\shader_tex_pbr.frag" />
<None Include="shaders\shader_tex_pbr.vert" />
<None Include="shaders\shader_tex_pbr_arm.frag" />
<None Include="shaders\shader_tex_pbr_arm.vert" />
<None Include="shaders\shader_water.frag" />
<None Include="shaders\shader_water.vert" />
<None Include="shaders\test.frag" />

View File

@ -54,6 +54,9 @@
<ClCompile Include="src\TriangleSoup.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\Collision_System.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\objload.h">
@ -133,6 +136,24 @@
<None Include="shaders\shader_water.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_tex.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_tex.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_tex_pbr.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_tex_pbr.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_tex_pbr_arm.frag">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_tex_pbr_arm.vert">
<Filter>Shader Files</Filter>
</None>
<None Include="shaders\shader_bubble.frag">
<Filter>Shader Files</Filter>
</None>

9181
cw 9/models/Bed_Frame.obj Normal file

File diff suppressed because it is too large Load Diff

1490
cw 9/models/Bed_Mattress.obj Normal file

File diff suppressed because it is too large Load Diff

1024
cw 9/models/Bed_Pillow.obj Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
#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

@ -0,0 +1,16 @@
#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,15 +1,17 @@
#version 430 core
float AMBIENT = 0.03;
float AMBIENT = 0.5;
float PI = 3.14;
uniform sampler2D depthMap;
uniform sampler2D depthMap2;
uniform vec3 cameraPos;
uniform vec3 color;
uniform vec3 sunDir;
uniform vec3 sunDir2;
uniform vec3 sunColor;
uniform vec3 lightPos;
@ -38,6 +40,7 @@ in vec3 sunDirTS;
in vec3 test;
in vec4 sunSpacePos;
in vec4 sunSpacePos2;
float DistributionGGX(vec3 normal, vec3 H, float roughness){
float a = roughness*roughness;
@ -112,6 +115,16 @@ float calculateShadow() {
}
}
float calculateShadow2() {
vec4 sunSpacePosNormalized = (0.5 * sunSpacePos2 / (sunSpacePos2.w)) + 0.5;
float closestDepth = texture2D(depthMap2, sunSpacePosNormalized.xy).x;
float diff = (0.001+closestDepth) - sunSpacePosNormalized.z;
return (0.5*(diff)/abs(diff))+0.5;
}
void main()
{
@ -142,6 +155,8 @@ void main()
//sun
ilumination=ilumination+PBRLight(sunDir, sunColor * calculateShadow(), normal, viewDir);
//sun2
ilumination=ilumination+PBRLight(sunDir2, sunColor * calculateShadow2(), normal, viewDir);
outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1);
//outColor = vec4(roughness,metallic,0,1);

View File

@ -9,6 +9,7 @@ layout(location = 4) in vec3 vertexBitangent;
uniform mat4 transformation;
uniform mat4 modelMatrix;
uniform mat4 LightVP;
uniform mat4 LightVP2;
out vec3 vecNormal;
out vec3 worldPos;
@ -23,6 +24,7 @@ out vec3 lightDirTS;
out vec3 spotlightDirTS;
out vec3 sunDirTS;
out vec4 sunSpacePos;
out vec4 sunSpacePos2;
void main()
{
@ -42,4 +44,5 @@ void main()
spotlightDirTS = TBN*SL;
sunDirTS = TBN*sunDir;
sunSpacePos=LightVP*modelMatrix*vec4(vertexPosition,1);
sunSpacePos2=LightVP2*modelMatrix*vec4(vertexPosition,1);
}

View File

@ -1,8 +1,5 @@
#version 430 core
uniform vec3 iResolution;
//uniform vec3 cameraPos;
//uniform vec3 cameraDir;
uniform mat3 camMat;
uniform sampler2D iChannel1;
uniform samplerCube iChannel0;
uniform float time;
@ -236,7 +233,6 @@ void main()
// camera movement
//vec3 ro, ta;
//doCamera( ro, ta, iTime, m );
//mat3 camMat = calcLookAtMatrix( cameraPos, cameraDir, 0.0 );
float dh = (0.666 / iResolution.y);
const float rads = TWO_PI / float(AA_SAMPLES);
@ -252,8 +248,8 @@ void main()
for (int samp = 0; samp < AA_SAMPLES; samp++) {
vec2 dxy = dh * vec2(cos(float(samp) * rads), sin(float(samp) * rads));
vec3 rd = normalize(camMat * vec3(p.xy + dxy, 1.5)); // 1.5 is the lens length
vec3 pos = bubblePosition.xyz;
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);

View File

@ -14,6 +14,6 @@ void main()
{
bubblePosition = transformation * vec4(vertexPosition, 1.0);
//vec3 bubbling = sdf(bubblePosition2.xyz);
gl_Position = bubblePosition;
gl_Position = transformation * vec4(vertexPosition, 1.0);
//gl_Position = vec4(vertexPosition, 1.0);
}

View File

@ -0,0 +1,168 @@
#version 430 core
float AMBIENT = 0.5;
float PI = 3.14;
uniform sampler2D depthMap;
uniform sampler2D depthMap2;
uniform vec3 cameraPos;
uniform sampler2D colorTexture;
uniform vec3 sunDir;
uniform vec3 sunDir2;
uniform vec3 sunColor;
uniform vec3 lightPos;
uniform vec3 lightColor;
uniform vec3 spotlightPos;
uniform vec3 spotlightColor;
uniform vec3 spotlightConeDir;
uniform vec3 spotlightPhi;
uniform float metallic;
uniform float roughness;
uniform float exposition;
in vec3 vecNormal;
in vec3 worldPos;
in vec2 vecTex;
out vec4 outColor;
in vec3 viewDirTS;
in vec3 lightDirTS;
in vec3 spotlightDirTS;
in vec3 sunDirTS;
in vec4 sunSpacePos;
in vec4 sunSpacePos2;
vec3 color;
float DistributionGGX(vec3 normal, vec3 H, float roughness){
float a = roughness*roughness;
float a2 = a*a;
float NdotH = max(dot(normal, H), 0.0);
float NdotH2 = NdotH*NdotH;
float num = a2;
float denom = (NdotH2 * (a2 - 1.0) + 1.0);
denom = PI * denom * denom;
return num / denom;
}
float GeometrySchlickGGX(float NdotV, float roughness){
float r = (roughness + 1.0);
float k = (r*r) / 8.0;
float num = NdotV;
float denom = NdotV * (1.0 - k) + k;
return num / denom;
}
float GeometrySmith(vec3 normal, vec3 V, vec3 lightDir, float roughness){
float NdotV = max(dot(normal, V), 0.0);
float NdotL = max(dot(normal, lightDir), 0.0);
float ggx2 = GeometrySchlickGGX(NdotV, roughness);
float ggx1 = GeometrySchlickGGX(NdotL, roughness);
return ggx1 * ggx2;
}
vec3 fresnelSchlick(float cosTheta, vec3 F0){
return F0 + (1.0 - F0) * pow(clamp(1.0 - cosTheta, 0.0, 1.0), 5.0);
}
vec3 PBRLight(vec3 lightDir, vec3 radiance, vec3 normal, vec3 V){
float diffuse=max(0,dot(normal,lightDir));
//vec3 V = normalize(cameraPos-worldPos);
vec3 F0 = vec3(0.04);
F0 = mix(F0, color, metallic);
vec3 H = normalize(V + lightDir);
// cook-torrance brdf
float NDF = DistributionGGX(normal, H, roughness);
float G = GeometrySmith(normal, V, lightDir, roughness);
vec3 F = fresnelSchlick(max(dot(H, V), 0.0), F0);
vec3 kS = F;
vec3 kD = vec3(1.0) - kS;
kD *= 1.0 - metallic;
vec3 numerator = NDF * G * F;
float denominator = 4.0 * max(dot(normal, V), 0.0) * max(dot(normal, lightDir), 0.0) + 0.0001;
vec3 specular = numerator / denominator;
// add to outgoing radiance Lo
float NdotL = max(dot(normal, lightDir), 0.0);
return (kD * color / PI + specular) * radiance * NdotL;
}
float calculateShadow() {
vec4 sunSpacePosNormalized = (0.5 * sunSpacePos / (sunSpacePos.w)) + 0.5;
float closestDepth = texture2D(depthMap, sunSpacePosNormalized.xy).x;
float diff = (0.001+closestDepth) - sunSpacePosNormalized.z;
return (0.5*(diff)/abs(diff))+0.5;
}
float calculateShadow2() {
vec4 sunSpacePosNormalized = (0.5 * sunSpacePos2 / (sunSpacePos2.w)) + 0.5;
float closestDepth = texture2D(depthMap2, sunSpacePosNormalized.xy).x;
float diff = (0.001+closestDepth) - sunSpacePosNormalized.z;
return (0.5*(diff)/abs(diff))+0.5;
}
void main()
{
color = texture(colorTexture, vecTex).xyz;
//vec3 normal = vec3(0,0,1);
vec3 normal = normalize(vecNormal);
//vec3 viewDir = normalize(viewDirTS);
vec3 viewDir = normalize(cameraPos-worldPos);
//vec3 lightDir = normalize(lightDirTS);
vec3 lightDir = normalize(lightPos-worldPos);
vec3 ambient = AMBIENT*color;
vec3 attenuatedlightColor = lightColor/pow(length(lightPos-worldPos),2);
vec3 ilumination;
ilumination = ambient+PBRLight(lightDir,attenuatedlightColor,normal,viewDir);
//flashlight
//vec3 spotlightDir= normalize(spotlightDirTS);
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);
//sun
//ilumination=ilumination+PBRLight(sunDir,sunColor,normal,viewDir);
ilumination=ilumination+PBRLight(sunDir, sunColor * calculateShadow(), normal, viewDir);
//sun2
ilumination=ilumination+PBRLight(sunDir2, sunColor * calculateShadow2(), normal, viewDir);
outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1);
}

View File

@ -0,0 +1,54 @@
#version 430 core
layout(location = 0) in vec3 vertexPosition;
layout(location = 1) in vec3 vertexNormal;
layout(location = 2) in vec2 vertexTexCoord;
layout(location = 3) in vec3 vertexTangent;
layout(location = 4) in vec3 vertexBitangent;
uniform mat4 transformation;
uniform mat4 modelMatrix;
uniform mat4 LightVP;
uniform mat4 LightVP2;
out vec3 vecNormal;
out vec3 worldPos;
uniform vec3 lightPos;
uniform vec3 spotlightPos;
uniform vec3 cameraPos;
uniform vec3 sunDir;
out vec3 viewDirTS;
out vec3 lightDirTS;
out vec3 spotlightDirTS;
out vec3 sunDirTS;
out vec2 vecTex;
out vec4 sunSpacePos;
out vec4 sunSpacePos2;
void main()
{
vecTex = vertexTexCoord;
vecTex.y = 1.0 - vecTex.y;
worldPos = (modelMatrix* vec4(vertexPosition,1)).xyz;
vecNormal = (modelMatrix* vec4(vertexNormal,0)).xyz;
gl_Position = transformation * vec4(vertexPosition, 1.0);
vec3 w_tangent = normalize(mat3(modelMatrix)*vertexTangent);
vec3 w_bitangent = normalize(mat3(modelMatrix)*vertexBitangent);
mat3 TBN = transpose(mat3(w_tangent, w_bitangent, vecNormal));
vec3 V = normalize(cameraPos-worldPos);
viewDirTS = TBN*V;
vec3 L = normalize(lightPos-worldPos);
lightDirTS = TBN*L;
vec3 SL = normalize(spotlightPos-worldPos);
spotlightDirTS = TBN*SL;
sunDirTS = TBN*sunDir;
sunSpacePos=LightVP*modelMatrix*vec4(vertexPosition,1);
sunSpacePos2=LightVP2*modelMatrix*vec4(vertexPosition,1);
}

View File

@ -0,0 +1,198 @@
#version 430 core
float AMBIENT = 0.5;
float PI = 3.14;
uniform vec3 cameraPos;
uniform sampler2D depthMap;
uniform sampler2D depthMap2;
uniform sampler2D depthMap3;
uniform sampler2D colorTexture;
uniform sampler2D metallicTexture;
uniform sampler2D roughnessTexture;
uniform sampler2D aoTexture;
uniform sampler2D normalSampler;
uniform vec3 sunDir;
uniform vec3 sunDir2;
uniform vec3 lampDir;
uniform vec3 sunColor;
uniform vec3 lightPos;
uniform vec3 lightColor;
uniform vec3 spotlightPos;
uniform vec3 spotlightColor;
uniform vec3 spotlightConeDir;
uniform vec3 spotlightPhi;
uniform float exposition;
in vec3 vecNormal;
in vec3 worldPos;
in vec2 vecTex;
out vec4 outColor;
in vec3 viewDirTS;
in vec3 lightDirTS;
in vec3 spotlightDirTS;
in vec3 sunDirTS;
vec3 color;
float metallic;
float roughness;
in vec4 sunSpacePos;
in vec4 sunSpacePos2;
in vec4 lampSpacePos;
float DistributionGGX(vec3 normal, vec3 H, float roughness){
float a = roughness*roughness;
float a2 = a*a;
float NdotH = max(dot(normal, H), 0.0);
float NdotH2 = NdotH*NdotH;
float num = a2;
float denom = (NdotH2 * (a2 - 1.0) + 1.0);
denom = PI * denom * denom;
return num / denom;
}
float GeometrySchlickGGX(float NdotV, float roughness){
float r = (roughness + 1.0);
float k = (r*r) / 8.0;
float num = NdotV;
float denom = NdotV * (1.0 - k) + k;
return num / denom;
}
float GeometrySmith(vec3 normal, vec3 V, vec3 lightDir, float roughness){
float NdotV = max(dot(normal, V), 0.0);
float NdotL = max(dot(normal, lightDir), 0.0);
float ggx2 = GeometrySchlickGGX(NdotV, roughness);
float ggx1 = GeometrySchlickGGX(NdotL, roughness);
return ggx1 * ggx2;
}
vec3 fresnelSchlick(float cosTheta, vec3 F0){
return F0 + (1.0 - F0) * pow(clamp(1.0 - cosTheta, 0.0, 1.0), 5.0);
}
vec3 PBRLight(vec3 lightDir, vec3 radiance, vec3 normal, vec3 V){
float diffuse=max(0,dot(normal,lightDir));
//vec3 V = normalize(cameraPos-worldPos);
vec3 F0 = vec3(0.04);
F0 = mix(F0, color, metallic);
vec3 H = normalize(V + lightDir);
// cook-torrance brdf
float NDF = DistributionGGX(normal, H, roughness);
float G = GeometrySmith(normal, V, lightDir, roughness);
vec3 F = fresnelSchlick(max(dot(H, V), 0.0), F0);
vec3 kS = F;
vec3 kD = vec3(1.0) - kS;
kD *= 1.0 - metallic;
vec3 numerator = NDF * G * F;
float denominator = 4.0 * max(dot(normal, V), 0.0) * max(dot(normal, lightDir), 0.0) + 0.0001;
vec3 specular = numerator / denominator;
// add to outgoing radiance Lo
float NdotL = max(dot(normal, lightDir), 0.0);
return (kD * color / PI + specular) * radiance * NdotL;
}
float calculateShadow() {
vec4 sunSpacePosNormalized = (0.5 * sunSpacePos / (sunSpacePos.w)) + 0.5;
float closestDepth = texture2D(depthMap, sunSpacePosNormalized.xy).x;
float diff = (0.001+closestDepth) - sunSpacePosNormalized.z;
return (0.5*(diff)/abs(diff))+0.5;
}
float calculateShadow2() {
vec4 sunSpacePosNormalized = (0.5 * sunSpacePos2 / (sunSpacePos2.w)) + 0.5;
float closestDepth = texture2D(depthMap2, sunSpacePosNormalized.xy).x;
float diff = (0.001+closestDepth) - sunSpacePosNormalized.z;
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;
metallic = texture2D(metallicTexture, vecTex).r;
roughness = texture2D(roughnessTexture, vecTex).r;
//vec3 normal = vec3(0,0,1);
//vec3 normal = normalize(vecNormal);
vec3 normal = normalize((texture2D(normalSampler, vecTex).xyz) * 2 - 1);
//normal = normalize(normal * 2.0 - 1.0);
vec3 viewDir = normalize(viewDirTS);
//vec3 viewDir = normalize(cameraPos-worldPos);
vec3 lightDir = normalize(lightDirTS);
//vec3 lightDir = normalize(lightPos-worldPos);
vec3 ao = texture2D(aoTexture, vecTex).xyz;
vec3 ambient = AMBIENT*ao*color;
vec3 attenuatedlightColor = lightColor/pow(length(lightPos-worldPos),2);
vec3 ilumination;
ilumination = ambient+PBRLight(lightDir,attenuatedlightColor,normal,viewDir);
//flashlight
//vec3 spotlightDir= normalize(spotlightDirTS);
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);
//sun
//ilumination=ilumination+PBRLight(sunDir,sunColor,normal,viewDir);
ilumination=ilumination+PBRLight(sunDir, sunColor * calculateShadow(), normal, viewDir);
//outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1);
//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

@ -0,0 +1,55 @@
#version 430 core
layout(location = 0) in vec3 vertexPosition;
layout(location = 1) in vec3 vertexNormal;
layout(location = 2) in vec2 vertexTexCoord;
layout(location = 3) in vec3 vertexTangent;
layout(location = 4) in vec3 vertexBitangent;
uniform mat4 transformation;
uniform mat4 modelMatrix;
uniform mat4 LightVP;
uniform mat4 LightVP2;
uniform mat4 LightVP3;
out vec3 vecNormal;
out vec3 worldPos;
uniform vec3 lightPos;
uniform vec3 spotlightPos;
uniform vec3 cameraPos;
uniform vec3 sunDir;
out vec3 viewDirTS;
out vec3 lightDirTS;
out vec3 spotlightDirTS;
out vec3 sunDirTS;
out vec2 vecTex;
out vec4 sunSpacePos;
out vec4 sunSpacePos2;
out vec4 lampSpacePos;
void main()
{
vecTex = vec2(0, 1) + vertexTexCoord * vec2(1, -1);
worldPos = (modelMatrix* vec4(vertexPosition,1)).xyz;
vecNormal = (modelMatrix* vec4(vertexNormal,0)).xyz;
gl_Position = transformation * vec4(vertexPosition, 1.0);
vec3 w_tangent = normalize(mat3(modelMatrix)*vertexTangent);
vec3 w_bitangent = normalize(mat3(modelMatrix)*vertexBitangent);
mat3 TBN = transpose(mat3(w_tangent, w_bitangent, vecNormal));
vec3 V = normalize(cameraPos-worldPos);
viewDirTS = TBN*V;
vec3 L = normalize(lightPos-worldPos);
lightDirTS = TBN*L;
vec3 SL = normalize(spotlightPos-worldPos);
spotlightDirTS = TBN*SL;
sunDirTS = TBN*sunDir;
sunSpacePos=LightVP*modelMatrix*vec4(vertexPosition,1);
sunSpacePos2=LightVP2*modelMatrix*vec4(vertexPosition,1);
lampSpacePos=LightVP3*modelMatrix*vec4(vertexPosition,1);
}

View File

@ -0,0 +1,195 @@
#version 430 core
float AMBIENT = 0.5;
float PI = 3.14;
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;
uniform vec3 lightColor;
uniform vec3 spotlightPos;
uniform vec3 spotlightColor;
uniform vec3 spotlightConeDir;
uniform vec3 spotlightPhi;
uniform float exposition;
in vec3 vecNormal;
in vec3 worldPos;
in vec2 vecTex;
out vec4 outColor;
in vec3 viewDirTS;
in vec3 lightDirTS;
in vec3 spotlightDirTS;
in vec3 sunDirTS;
vec3 color;
float metallic;
float roughness;
in vec4 sunSpacePos;
in vec4 sunSpacePos2;
in vec4 lampSpacePos;
float DistributionGGX(vec3 normal, vec3 H, float roughness){
float a = roughness*roughness;
float a2 = a*a;
float NdotH = max(dot(normal, H), 0.0);
float NdotH2 = NdotH*NdotH;
float num = a2;
float denom = (NdotH2 * (a2 - 1.0) + 1.0);
denom = PI * denom * denom;
return num / denom;
}
float GeometrySchlickGGX(float NdotV, float roughness){
float r = (roughness + 1.0);
float k = (r*r) / 8.0;
float num = NdotV;
float denom = NdotV * (1.0 - k) + k;
return num / denom;
}
float GeometrySmith(vec3 normal, vec3 V, vec3 lightDir, float roughness){
float NdotV = max(dot(normal, V), 0.0);
float NdotL = max(dot(normal, lightDir), 0.0);
float ggx2 = GeometrySchlickGGX(NdotV, roughness);
float ggx1 = GeometrySchlickGGX(NdotL, roughness);
return ggx1 * ggx2;
}
vec3 fresnelSchlick(float cosTheta, vec3 F0){
return F0 + (1.0 - F0) * pow(clamp(1.0 - cosTheta, 0.0, 1.0), 5.0);
}
vec3 PBRLight(vec3 lightDir, vec3 radiance, vec3 normal, vec3 V){
float diffuse=max(0,dot(normal,lightDir));
//vec3 V = normalize(cameraPos-worldPos);
vec3 F0 = vec3(0.04);
F0 = mix(F0, color, metallic);
vec3 H = normalize(V + lightDir);
// cook-torrance brdf
float NDF = DistributionGGX(normal, H, roughness);
float G = GeometrySmith(normal, V, lightDir, roughness);
vec3 F = fresnelSchlick(max(dot(H, V), 0.0), F0);
vec3 kS = F;
vec3 kD = vec3(1.0) - kS;
kD *= 1.0 - metallic;
vec3 numerator = NDF * G * F;
float denominator = 4.0 * max(dot(normal, V), 0.0) * max(dot(normal, lightDir), 0.0) + 0.0001;
vec3 specular = numerator / denominator;
// add to outgoing radiance Lo
float NdotL = max(dot(normal, lightDir), 0.0);
return (kD * color / PI + specular) * radiance * NdotL;
}
float calculateShadow() {
vec4 sunSpacePosNormalized = (0.5 * sunSpacePos / (sunSpacePos.w)) + 0.5;
float closestDepth = texture2D(depthMap, sunSpacePosNormalized.xy).x;
float diff = (0.001+closestDepth) - sunSpacePosNormalized.z;
return (0.5*(diff)/abs(diff))+0.5;
}
float calculateShadow2() {
vec4 sunSpacePosNormalized = (0.5 * sunSpacePos2 / (sunSpacePos2.w)) + 0.5;
float closestDepth = texture2D(depthMap2, sunSpacePosNormalized.xy).x;
float diff = (0.001+closestDepth) - sunSpacePosNormalized.z;
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;
metallic = texture2D(armTexture, vecTex).y;
roughness = texture2D(armTexture, vecTex).z;
//vec3 normal = vec3(0,0,1);
//vec3 normal = normalize(vecNormal);
vec3 normal = normalize((texture2D(normalSampler, vecTex).xyz) * 2 - 1);
//normal = normalize(normal * 2.0 - 1.0);
vec3 viewDir = normalize(viewDirTS);
//vec3 viewDir = normalize(cameraPos-worldPos);
vec3 lightDir = normalize(lightDirTS);
//vec3 lightDir = normalize(lightPos-worldPos);
float ao = texture2D(armTexture, vecTex).x;
vec3 ambient = AMBIENT*ao*color;
vec3 attenuatedlightColor = lightColor/pow(length(lightPos-worldPos),2);
vec3 ilumination;
ilumination = ambient+PBRLight(lightDir,attenuatedlightColor,normal,viewDir);
//flashlight
//vec3 spotlightDir= normalize(spotlightDirTS);
//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);
//sun
//ilumination=ilumination+PBRLight(sunDir,sunColor,normal,viewDir);
ilumination=ilumination+PBRLight(sunDir, sunColor * calculateShadow(), normal, viewDir);
//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

@ -0,0 +1,54 @@
#version 430 core
layout(location = 0) in vec3 vertexPosition;
layout(location = 1) in vec3 vertexNormal;
layout(location = 2) in vec2 vertexTexCoord;
layout(location = 3) in vec3 vertexTangent;
layout(location = 4) in vec3 vertexBitangent;
uniform mat4 transformation;
uniform mat4 modelMatrix;
uniform mat4 LightVP;
uniform mat4 LightVP2;
uniform mat4 LightVP3;
out vec3 vecNormal;
out vec3 worldPos;
uniform vec3 lightPos;
uniform vec3 spotlightPos;
uniform vec3 cameraPos;
uniform vec3 sunDir;
out vec3 viewDirTS;
out vec3 lightDirTS;
out vec3 spotlightDirTS;
out vec3 sunDirTS;
out vec2 vecTex;
out vec4 sunSpacePos;
out vec4 sunSpacePos2;
out vec4 lampSpacePos;
void main()
{
vecTex = vec2(0, 1) + vertexTexCoord * vec2(1, -1);
worldPos = (modelMatrix* vec4(vertexPosition,1)).xyz;
vecNormal = (modelMatrix* vec4(vertexNormal,0)).xyz;
gl_Position = transformation * vec4(vertexPosition, 1.0);
vec3 w_tangent = normalize(mat3(modelMatrix)*vertexTangent);
vec3 w_bitangent = normalize(mat3(modelMatrix)*vertexBitangent);
mat3 TBN = transpose(mat3(w_tangent, w_bitangent, vecNormal));
vec3 V = normalize(cameraPos-worldPos);
viewDirTS = TBN*V;
vec3 L = normalize(lightPos-worldPos);
lightDirTS = TBN*L;
vec3 SL = normalize(spotlightPos-worldPos);
spotlightDirTS = TBN*SL;
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.3);
vec3 colorBlue = vec3(0.0,0.1,0.2);
vec3 colorLightBlue = vec3(0.0, 0.04, 0.2);
vec3 colorWhite = vec3(0.9, 0.9, 0.9);

BIN
cw 9/sound/grass.wav Normal file

Binary file not shown.

BIN
cw 9/sound/main.wav Normal file

Binary file not shown.

BIN
cw 9/sound/necro.wav Normal file

Binary file not shown.

BIN
cw 9/sound/ocean.wav Normal file

Binary file not shown.

View File

@ -0,0 +1,117 @@
#include "glew.h"
#include <GLFW/glfw3.h>
#include "glm.hpp"
#include "ext.hpp"
#include <iostream>
#include <cmath>
#include <vector>
#include "freeglut.h"
#include <assimp/Importer.hpp>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
#define matrixSize 1000
struct Bounding {
float minX, maxX, minZ, maxZ;
};
class CollisionSystem {
public:
bool matrix[matrixSize][matrixSize];
float toAddX, toAddZ, toMultiplyX, toMultiplyZ;
struct Bounding sceneBounding;
std::vector<Bounding> meshesBoundings;
CollisionSystem() {
for (int i = 0; i < matrixSize; i++) {
for (int j = 0; j < matrixSize; j++) {
matrix[i][j] = false;
}
}
}
void addMeshToMatrix(aiMesh* mesh) {
aiVector3D firstPosition = mesh->mVertices[0];
float meshMinX = firstPosition.x;
float meshMaxX = firstPosition.x;
float meshMinZ = firstPosition.z;
float meshMaxZ = firstPosition.z;
for (unsigned int i = 1; i < mesh->mNumVertices; i++)
{
aiVector3D vertex = mesh->mVertices[i];
if (vertex.x < meshMinX) meshMinX = vertex.x;
if (vertex.z < meshMinZ) meshMinZ = vertex.z;
if (vertex.x > meshMaxX) meshMaxX = vertex.x;
if (vertex.z > meshMaxZ) meshMaxZ = vertex.z;
}
Bounding meshBounding = {
meshMinX,
meshMaxX,
meshMinZ,
meshMaxZ
};
meshesBoundings.push_back(meshBounding);
}
void calculateSceneBounding() {
for (Bounding meshBounding : meshesBoundings) {
if (meshBounding.minX < sceneBounding.minX) {
sceneBounding.minX = meshBounding.minX;
}
if (meshBounding.maxX > sceneBounding.maxX) {
sceneBounding.maxX = meshBounding.maxX;
}
if (meshBounding.minZ < sceneBounding.minZ) {
sceneBounding.minZ = meshBounding.minZ;
}
if (meshBounding.maxZ > sceneBounding.maxZ) {
sceneBounding.maxZ = meshBounding.maxZ;
}
}
toAddX = -sceneBounding.minX;
toAddZ = -sceneBounding.minZ;
toMultiplyX = (1 / (sceneBounding.maxX + toAddX)) * matrixSize;
toMultiplyZ = (1 / (sceneBounding.maxZ + toAddZ)) * matrixSize;
for (Bounding meshBounding : meshesBoundings) {
int i_start = getRelativeZ(meshBounding.minZ);
int i_end = getRelativeZ(meshBounding.maxZ);
for (int i = i_start; i <= i_end; i++) {
int j_start = getRelativeX(meshBounding.minX);
int j_end = getRelativeX(meshBounding.maxX);
for (int j = j_start; j <= j_end; j++) {
matrix[i][j] = true;
}
}
}
}
bool canMove(glm::vec3 pos) {
int z = getRelativeZ(pos.z);
int x = getRelativeX(pos.x);
if (z < 0 || z >= matrixSize || x < 0 || x >= matrixSize) {
return true;
}
return !(matrix[z][x]);
}
float getRelativeX(float x) {
return (int)((x + toAddX) * toMultiplyX);
}
float getRelativeZ(float z) {
return (int)((z + toAddZ) * toMultiplyZ);
}
};

View File

@ -8,8 +8,6 @@
#include <assimp/scene.h>
#include <assimp/postprocess.h>
void Core::RenderContext::initFromAssimpMesh(aiMesh* mesh) {
vertexArray = 0;
vertexBuffer = 0;
@ -20,15 +18,19 @@ void Core::RenderContext::initFromAssimpMesh(aiMesh* mesh) {
//tex coord must be converted to 2d vecs
for (unsigned int i = 0; i < mesh->mNumVertices; i++)
{
float x, y;
if (mesh->mTextureCoords[0] != nullptr) {
textureCoord.push_back(mesh->mTextureCoords[0][i].x);
textureCoord.push_back(mesh->mTextureCoords[0][i].y);
}
else {
textureCoord.push_back(0.0f);
textureCoord.push_back(0.0f);
x = mesh->mTextureCoords[0][i].x;
y = mesh->mTextureCoords[0][i].y;
} else {
x = 0.0f;
y = 0.0f;
}
textureCoord.push_back(x);
textureCoord.push_back(y);
}
if (mesh->mTextureCoords[0] == nullptr) {
std::cout << "no uv coords\n";
}

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,7 @@
#include "ext.hpp"
#include <iostream>
#include <cmath>
#include <windows.h>
#include "ex_9_1.hpp"
@ -23,7 +24,7 @@ int main(int argc, char** argv)
#endif
// tworzenie okna za pomoca glfw
GLFWwindow* window = glfwCreateWindow(500, 500, "FirstWindow", NULL, NULL);
GLFWwindow* window = glfwCreateWindow(1000, 1000, "FirstWindow", NULL, NULL);
if (window == NULL)
{
std::cout << "Failed to create GLFW window" << std::endl;
@ -34,7 +35,7 @@ int main(int argc, char** argv)
// ladowanie OpenGL za pomoca glew
glewInit();
glViewport(0, 0, 500, 500);
glViewport(0, 0, 1000, 1000);
init(window);

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 MiB

BIN
cw 9/textures/bamboo/ao.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

BIN
cw 9/textures/bed/ao.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 MiB

BIN
cw 9/textures/book/ao.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

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