This commit is contained in:
s464921 2023-02-09 17:18:49 +01:00
parent b4852f9fe1
commit b580685a76
90 changed files with 921 additions and 79 deletions

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\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\Debug\grk-cw9.exe</FullPath>
<FullPath>C:\Users\jedrz\Desktop\grafika\GRK_Project\Debug\grk-cw9.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />

View File

@ -1,67 +1,57 @@
 Collision_System.cpp
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h(130,1): warning C4005: 'APIENTRY': macro redefinition
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : see previous definition of 'APIENTRY'
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(87,16): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(88,14): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(90,17): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(91,15): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(100,9): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(101,9): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(111,29): warning C4244: 'return': conversion from 'int' to 'float', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(115,29): warning C4244: 'return': conversion from 'int' to 'float', possible loss of data
main.cpp
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h(130,1): warning C4005: 'APIENTRY': macro redefinition
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : see previous definition of 'APIENTRY'
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(87,16): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(88,14): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(90,17): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(91,15): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(100,9): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(101,9): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(111,29): warning C4244: 'return': conversion from 'int' to 'float', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\Collision_System.cpp(115,29): warning C4244: 'return': conversion from 'int' to 'float', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(99,30): warning C4305: 'initializing': truncation from 'double' to 'float'
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(113,17): warning C4101: 'data': unreferenced local variable
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(138,38): warning C4305: '=': truncation from 'double' to 'float'
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(167,16): warning C4305: 'initializing': truncation from 'double' to 'float'
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(227,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(243,98): warning C4305: 'argument': truncation from 'double' to 'T'
 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\grafika\GRK_Project\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY”
C:\Users\jedrz\Desktop\grafika\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\grafika\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\grafika\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\grafika\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\grafika\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\grafika\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\grafika\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\grafika\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\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(127,30): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(141,17): warning C4101: "data": lokalna zmienna, do której nie istnieje odwołanie
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(166,38): warning C4305: "=": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(195,16): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(372,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(388,98): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(246,68): warning C4305: 'argument': truncation from 'double' to 'T'
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(391,68): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(306,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(314,108): warning C4305: 'argument': truncation from 'double' to 'T'
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(452,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(460,108): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(322,87): warning C4305: 'argument': truncation from 'double' to 'T'
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(468,87): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(322,223): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(325,59): warning C4305: 'argument': truncation from 'double' to 'T'
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(468,223): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(471,59): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(326,37): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(358,2): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(411,108): warning C4305: 'argument': truncation from 'double' to 'T'
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(472,37): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(504,2): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(510,116): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(511,115): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(567,108): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(490,21): warning C4305: '-=': truncation from 'double' to 'float'
C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\cw 9\src\ex_9_1.hpp(492,21): warning C4305: '+=': truncation from 'double' to 'float'
Generating Code...
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\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\Debug\grk-cw9.exe
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(679,21): warning C4305: "-=": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(681,21): warning C4305: "+=": obcięcie z "double" do "float"
Box.obj : warning LNK4075: zignorowano opcję „/EDITANDCONTINUE” z powodu określenia opcji „/INCREMENTAL:NO”
LINK : warning LNK4098: domyślna biblioteka „MSVCRT” powoduje konflikt z innymi bibliotekami; użyj opcji /NODEFAULTLIB:biblioteka
grk-cw9.vcxproj -> C:\Users\jedrz\Desktop\grafika\GRK_Project\Debug\grk-cw9.exe

View File

@ -1,2 +1,2 @@
PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30037:TargetPlatformVersion=10.0.19041.0:
Debug|Win32|C:\Users\Artur\Desktop\studia\3\Grafika komputerowa\GRK_Project\|
PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.33.31629:TargetPlatformVersion=10.0.19041.0:
Debug|Win32|C:\Users\jedrz\Desktop\grafika\GRK_Project\|

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\grafika\GRK_Project\Release\grk-cw9.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />

Binary file not shown.

Binary file not shown.

View File

@ -1,50 +1,60 @@
 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\grafika\GRK_Project\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY”
C:\Users\jedrz\Desktop\grafika\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\grafika\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\grafika\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\grafika\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\grafika\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\grafika\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\grafika\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\grafika\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\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(127,30): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(141,17): warning C4101: "data": lokalna zmienna, do której nie istnieje odwołanie
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(166,38): warning C4305: "=": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(195,16): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(372,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(388,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\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(391,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\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(452,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(460,108): 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\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(468,87): 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\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(468,223): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(471,59): 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\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(472,37): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(504,2): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(510,116): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(511,115): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(568,108): 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\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(684,21): warning C4305: "-=": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(686,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
1 of 656 functions ( 0.2%) were compiled, the rest were copied from previous compilation.
0 functions were new in current compilation
7 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\grafika\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\grafika\GRK_Project\|

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -48,6 +48,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" />
@ -65,7 +71,7 @@
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>

View File

@ -136,5 +136,23 @@
<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>
</ItemGroup>
</Project>

View File

@ -0,0 +1,153 @@
#version 430 core
float AMBIENT = 0.03;
float PI = 3.14;
uniform sampler2D depthMap;
uniform vec3 cameraPos;
uniform sampler2D colorTexture;
uniform vec3 sunDir;
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;
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;
}
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);
outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1);
}

View File

@ -0,0 +1,50 @@
#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;
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;
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);
}

View File

@ -0,0 +1,162 @@
#version 430 core
float AMBIENT = 0.03;
float PI = 3.14;
uniform vec3 cameraPos;
uniform sampler2D depthMap;
uniform sampler2D colorTexture;
uniform sampler2D metallicTexture;
uniform sampler2D roughnessTexture;
uniform sampler2D aoTexture;
uniform sampler2D normalSampler;
uniform vec3 sunDir;
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;
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;
}
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 ambient = texture2D(aoTexture, vecTex).xyz*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);
}

View File

@ -0,0 +1,49 @@
#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;
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;
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);
}

View File

@ -0,0 +1,160 @@
#version 430 core
float AMBIENT = 0.03;
float PI = 3.14;
uniform vec3 cameraPos;
uniform sampler2D depthMap;
uniform sampler2D colorTexture;
uniform sampler2D armTexture;
uniform sampler2D normalSampler;
uniform vec3 sunDir;
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;
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;
}
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);
vec3 ambient = texture2D(armTexture, vecTex).x*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);
}

View File

@ -0,0 +1,49 @@
#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;
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;
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);
}

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.

View File

@ -40,6 +40,7 @@ namespace models {
Core::RenderContext windowContext;
Core::RenderContext testContext;
Core::RenderContext cubeContext;
Core::RenderContext tableContext;
}
std::vector<std::string> faces = {
@ -53,6 +54,31 @@ std::vector<std::string> faces = {
namespace texture {
GLuint water;
GLuint rust;
GLuint table_albedo;
GLuint table_metallic;
GLuint table_ao;
GLuint table_normal;
GLuint table_roughness;
GLuint wood_albedo;
GLuint wood_metallic;
GLuint wood_ao;
GLuint wood_normal;
GLuint wood_roughness;
GLuint metal_albedo;
GLuint metal_metallic;
GLuint metal_ao;
GLuint metal_normal;
GLuint metal_roughness;
GLuint panels_albedo;
GLuint panels_metallic;
GLuint panels_ao;
GLuint panels_normal;
GLuint panels_roughness;
GLuint screen;
GLuint rock_albedo;
GLuint rock_arm;
GLuint rock_normal;
}
GLuint depthMapFBO;
@ -62,6 +88,8 @@ GLuint program;
GLuint programSun;
GLuint programTest;
GLuint programTex;
GLuint programTexPBR;
GLuint programTexPBR_ARM;
GLuint programDepth;
GLuint programSkybox;
GLuint programWater;
@ -166,8 +194,8 @@ glm::mat4 createPerspectiveMatrix()
glm::mat4 perspectiveMatrix;
float n = 0.05;
float f = 20.;
float a1 = glm::min(aspectRatio, 1.f);
float a2 = glm::min(1 / aspectRatio, 1.f);
float a1 = min(aspectRatio, 1.f);
float a2 = min(1 / aspectRatio, 1.f);
perspectiveMatrix = glm::mat4({
1,0.,0.,0.,
0.,aspectRatio,0.,0.,
@ -215,6 +243,123 @@ void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec
Core::DrawContext(context);
}
void drawObjectTex(Core::RenderContext& context, glm::mat4 modelMatrix, float roughness, float metallic, GLuint texture) {
glm::mat4 viewProjectionMatrix = createPerspectiveMatrix() * createCameraMatrix();
glm::mat4 transformation = viewProjectionMatrix * modelMatrix;
glUniformMatrix4fv(glGetUniformLocation(programTex, "transformation"), 1, GL_FALSE, (float*)&transformation);
glUniformMatrix4fv(glGetUniformLocation(programTex, "modelMatrix"), 1, GL_FALSE, (float*)&modelMatrix);
glUniform1f(glGetUniformLocation(programTex, "exposition"), exposition);
glUniform1f(glGetUniformLocation(programTex, "roughness"), roughness);
glUniform1f(glGetUniformLocation(programTex, "metallic"), metallic);
//glUniform3f(glGetUniformLocation(programTex, "color"), color.x, color.y, color.z);
glUniform3f(glGetUniformLocation(programTex, "cameraPos"), cameraPos.x, cameraPos.y, cameraPos.z);
glUniform3f(glGetUniformLocation(programTex, "sunDir"), sunDir.x, sunDir.y, sunDir.z);
glUniform3f(glGetUniformLocation(programTex, "sunColor"), sunColor.x, sunColor.y, sunColor.z);
glUniform3f(glGetUniformLocation(programTex, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z);
glUniform3f(glGetUniformLocation(programTex, "lightColor"), pointlightColor.x, pointlightColor.y, pointlightColor.z);
glUniform3f(glGetUniformLocation(programTex, "spotlightConeDir"), spotlightConeDir.x, spotlightConeDir.y, spotlightConeDir.z);
glUniform3f(glGetUniformLocation(programTex, "spotlightPos"), spotlightPos.x, spotlightPos.y, spotlightPos.z);
glUniform3f(glGetUniformLocation(programTex, "spotlightColor"), spotlightColor.x, spotlightColor.y, spotlightColor.z);
glUniform1f(glGetUniformLocation(programTex, "spotlightPhi"), spotlightPhi);
Core::SetActiveTexture(texture, "colorTexture", programTex, 0);
//Core::DrawContext(context);
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));
glUniformMatrix4fv(glGetUniformLocation(programTex, "LightVP"), 1, GL_FALSE, (float*)&lightVP);
Core::SetActiveTexture(depthMap, "depthMap", programTex, 1);
Core::DrawContext(context);
}
void drawObjectTexPBR(Core::RenderContext& context, glm::mat4 modelMatrix, GLuint roughness, GLuint metallic, GLuint texture, GLuint normal, GLuint ao) {
glm::mat4 viewProjectionMatrix = createPerspectiveMatrix() * createCameraMatrix();
glm::mat4 transformation = viewProjectionMatrix * modelMatrix;
glUniformMatrix4fv(glGetUniformLocation(programTexPBR, "transformation"), 1, GL_FALSE, (float*)&transformation);
glUniformMatrix4fv(glGetUniformLocation(programTexPBR, "modelMatrix"), 1, GL_FALSE, (float*)&modelMatrix);
glUniform1f(glGetUniformLocation(programTexPBR, "exposition"), exposition);
//glUniform1f(glGetUniformLocation(programTex, "roughness"), roughness);
//glUniform1f(glGetUniformLocation(programTex, "metallic"), metallic);
//glUniform3f(glGetUniformLocation(programTex, "color"), color.x, color.y, color.z);
glUniform3f(glGetUniformLocation(programTexPBR, "cameraPos"), cameraPos.x, cameraPos.y, cameraPos.z);
glUniform3f(glGetUniformLocation(programTexPBR, "sunDir"), sunDir.x, sunDir.y, sunDir.z);
glUniform3f(glGetUniformLocation(programTexPBR, "sunColor"), sunColor.x, sunColor.y, sunColor.z);
glUniform3f(glGetUniformLocation(programTexPBR, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z);
glUniform3f(glGetUniformLocation(programTexPBR, "lightColor"), pointlightColor.x, pointlightColor.y, pointlightColor.z);
glUniform3f(glGetUniformLocation(programTexPBR, "spotlightConeDir"), spotlightConeDir.x, spotlightConeDir.y, spotlightConeDir.z);
glUniform3f(glGetUniformLocation(programTexPBR, "spotlightPos"), spotlightPos.x, spotlightPos.y, spotlightPos.z);
glUniform3f(glGetUniformLocation(programTexPBR, "spotlightColor"), spotlightColor.x, spotlightColor.y, spotlightColor.z);
glUniform1f(glGetUniformLocation(programTexPBR, "spotlightPhi"), spotlightPhi);
Core::SetActiveTexture(texture, "colorTexture", programTexPBR, 5);
Core::SetActiveTexture(metallic, "metallicTexture", programTexPBR, 2);
Core::SetActiveTexture(roughness, "roughnessTexture", programTexPBR, 3);
Core::SetActiveTexture(ao, "aoTexture", programTexPBR, 4);
Core::SetActiveTexture(normal, "normalSampler", programTexPBR, 1);
//Core::DrawContext(context);
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));
glUniformMatrix4fv(glGetUniformLocation(programTexPBR, "LightVP"), 1, GL_FALSE, (float*)&lightVP);
Core::SetActiveTexture(depthMap, "depthMap", programTexPBR, 0);
Core::DrawContext(context);
}
void drawObjectTexPBR_ARM(Core::RenderContext& context, glm::mat4 modelMatrix, GLuint texture, GLuint normal, GLuint arm) {
glm::mat4 viewProjectionMatrix = createPerspectiveMatrix() * createCameraMatrix();
glm::mat4 transformation = viewProjectionMatrix * modelMatrix;
glUniformMatrix4fv(glGetUniformLocation(programTexPBR_ARM, "transformation"), 1, GL_FALSE, (float*)&transformation);
glUniformMatrix4fv(glGetUniformLocation(programTexPBR_ARM, "modelMatrix"), 1, GL_FALSE, (float*)&modelMatrix);
glUniform1f(glGetUniformLocation(programTexPBR_ARM, "exposition"), exposition);
//glUniform1f(glGetUniformLocation(programTex, "roughness"), roughness);
//glUniform1f(glGetUniformLocation(programTex, "metallic"), metallic);
//glUniform3f(glGetUniformLocation(programTex, "color"), color.x, color.y, color.z);
glUniform3f(glGetUniformLocation(programTexPBR_ARM, "cameraPos"), cameraPos.x, cameraPos.y, cameraPos.z);
glUniform3f(glGetUniformLocation(programTexPBR_ARM, "sunDir"), sunDir.x, sunDir.y, sunDir.z);
glUniform3f(glGetUniformLocation(programTexPBR_ARM, "sunColor"), sunColor.x, sunColor.y, sunColor.z);
glUniform3f(glGetUniformLocation(programTexPBR_ARM, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z);
glUniform3f(glGetUniformLocation(programTexPBR_ARM, "lightColor"), pointlightColor.x, pointlightColor.y, pointlightColor.z);
glUniform3f(glGetUniformLocation(programTexPBR_ARM, "spotlightConeDir"), spotlightConeDir.x, spotlightConeDir.y, spotlightConeDir.z);
glUniform3f(glGetUniformLocation(programTexPBR_ARM, "spotlightPos"), spotlightPos.x, spotlightPos.y, spotlightPos.z);
glUniform3f(glGetUniformLocation(programTexPBR_ARM, "spotlightColor"), spotlightColor.x, spotlightColor.y, spotlightColor.z);
glUniform1f(glGetUniformLocation(programTexPBR_ARM, "spotlightPhi"), spotlightPhi);
Core::SetActiveTexture(texture, "colorTexture", programTexPBR_ARM, 3);
Core::SetActiveTexture(arm, "armTexture", programTexPBR_ARM, 2);
Core::SetActiveTexture(normal, "normalSampler", programTexPBR_ARM, 1);
//Core::DrawContext(context);
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));
glUniformMatrix4fv(glGetUniformLocation(programTexPBR_ARM, "LightVP"), 1, GL_FALSE, (float*)&lightVP);
Core::SetActiveTexture(depthMap, "depthMap", programTexPBR_ARM, 0);
Core::DrawContext(context);
}
void drawObjectDepth(Core::RenderContext context, glm::mat4 viewProjectionMatrix, glm::mat4 modelMatrix) {
glUniformMatrix4fv(glGetUniformLocation(programDepth, "viewProjectionMatrix"), 1, GL_FALSE, (float*)&viewProjectionMatrix);
@ -250,7 +395,8 @@ void renderShadowapSun() {
drawObjectDepth(models::deskContext, lightVP, glm::mat4());
drawObjectDepth(models::doorContext, lightVP, glm::mat4());
drawObjectDepth(models::drawerContext, lightVP, glm::mat4());
drawObjectDepth(models::marbleBustContext, lightVP, glm::mat4());
drawObjectDepth(models::marbleBustContext, lightVP, glm::translate(glm::mat4(), glm::vec3(0, 0, -0.2)));
drawObjectDepth(models::marbleBustContext, lightVP, glm::translate(glm::mat4(), glm::vec3(0, 0, 0.2)));
drawObjectDepth(models::materaceContext, lightVP, glm::mat4());
drawObjectDepth(models::pencilsContext, lightVP, glm::mat4());
drawObjectDepth(models::planeContext, lightVP, glm::mat4());
@ -326,11 +472,11 @@ void renderScene(GLFWwindow* window)
glm::vec3(0.5, 0.5, 0.5), 0.7, 0.0);
drawObjectPBR(models::bedContext, glm::mat4(), glm::vec3(0.03f, 0.03f, 0.03f), 0.2f, 0.0f);
drawObjectPBR(models::chairContext, glm::mat4(), glm::vec3(0.195239f, 0.37728f, 0.8f), 0.4f, 0.0f);
drawObjectPBR(models::deskContext, glm::mat4(), glm::vec3(0.428691f, 0.08022f, 0.036889f), 0.2f, 0.0f);
drawObjectPBR(models::doorContext, glm::mat4(), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f);
//drawObjectPBR(models::chairContext, glm::mat4(), glm::vec3(0.195239f, 0.37728f, 0.8f), 0.4f, 0.0f);
//drawObjectPBR(models::deskContext, glm::mat4(), glm::vec3(0.428691f, 0.08022f, 0.036889f), 0.2f, 0.0f);
//drawObjectPBR(models::doorContext, glm::mat4(), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f);
drawObjectPBR(models::drawerContext, glm::mat4(), glm::vec3(0.428691f, 0.08022f, 0.036889f), 0.2f, 0.0f);
drawObjectPBR(models::marbleBustContext, glm::mat4(), glm::vec3(1.f, 1.f, 1.f), 0.5f, 1.0f);
//drawObjectPBR(models::marbleBustContext, glm::mat4(), glm::vec3(1.f, 1.f, 1.f), 0.5f, 1.0f);
drawObjectPBR(models::materaceContext, glm::mat4(), glm::vec3(0.9f, 0.9f, 0.9f), 0.8f, 0.0f);
drawObjectPBR(models::pencilsContext, glm::mat4(), glm::vec3(0.10039f, 0.018356f, 0.001935f), 0.1f, 0.0f);
drawObjectPBR(models::planeContext, glm::mat4(), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f);
@ -360,6 +506,17 @@ void renderScene(GLFWwindow* window)
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);
glUseProgram(programTexPBR);
drawObjectTexPBR(models::deskContext, glm::mat4(), texture::table_roughness, texture::table_metallic, texture::table_albedo, texture::table_normal, texture::table_ao);
glUseProgram(programTexPBR_ARM);
drawObjectTexPBR_ARM(models::chairContext, glm::mat4(), texture::rock_albedo, texture::rock_normal, texture::rock_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);
@ -418,8 +575,36 @@ void init(GLFWwindow* window)
programDepth = shaderLoader.CreateProgram("shaders/shader_shadowap_sun.vert", "shaders/shader_shadowap_sun.frag");
programSkybox = shaderLoader.CreateProgram("shaders/shader_skybox.vert", "shaders/shader_skybox.frag");
programWater = shaderLoader.CreateProgram("shaders/shader_water.vert", "shaders/shader_water.frag");
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");
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.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");
texture::wood_ao = Core::LoadTexture("textures/wood_ao.jpg");
texture::wood_normal = Core::LoadTexture("textures/wood_normal.jpg");
texture::screen = Core::LoadTexture("textures/visual.png");
texture::metal_albedo = Core::LoadTexture("textures/metal_albedo.png");
texture::metal_metallic = Core::LoadTexture("textures/metal_metallic.png");
texture::metal_roughness = Core::LoadTexture("textures/metal_roughness.png");
texture::metal_ao = Core::LoadTexture("textures/metal_ao.png");
texture::metal_normal = Core::LoadTexture("textures/metal_normal.png");
texture::panels_albedo = Core::LoadTexture("textures/panels_albedo.png");
texture::panels_metallic = Core::LoadTexture("textures/panels_metallic.png");
texture::panels_roughness = Core::LoadTexture("textures/panels_roughness.png");
texture::panels_ao = Core::LoadTexture("textures/panels_ao.png");
texture::panels_normal = Core::LoadTexture("textures/panels_normal.png");
texture::rock_albedo = Core::LoadTexture("textures/rock_albedo.png");
texture::rock_arm = Core::LoadTexture("textures/rock_arm.png");
texture::rock_normal = Core::LoadTexture("textures/rock_normal.png");
loadModelToContext("./models/sphere.obj", sphereContext, false);
loadModelToContext("./models/spaceship.obj", shipContext, false);
loadModelToContext("./models/bed.obj", models::bedContext, true);
@ -437,6 +622,7 @@ 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/table.obj", models::tableContext, false);
collisionSystem.calculateSceneBounding();
skyboxTexture = loadSkybox(faces);
@ -478,6 +664,14 @@ void processInput(GLFWwindow* window)
spaceshipDir = glm::vec3(glm::eulerAngleY(angleSpeed) * glm::vec4(spaceshipDir, 0));
if (glfwGetKey(window, GLFW_KEY_D) == GLFW_PRESS)
spaceshipDir = glm::vec3(glm::eulerAngleY(-angleSpeed) * glm::vec4(spaceshipDir, 0));
if (glfwGetKey(window, GLFW_KEY_H) == GLFW_PRESS) {
texture::screen = Core::LoadTexture("textures/main.jpg");
PlaySound(TEXT("sound/main.wav"), NULL, SND_ASYNC);
}
if (glfwGetKey(window, GLFW_KEY_J) == GLFW_PRESS) {
texture::screen = Core::LoadTexture("textures/visual.png");
PlaySound(nullptr, nullptr, 0);
}
cameraDir = spaceshipDir;
cameraPos = newSpaceshipPos - 0.5 * spaceshipDir + glm::vec3(0, 1, 0) * 0.2f;

View File

@ -5,6 +5,7 @@
#include "ext.hpp"
#include <iostream>
#include <cmath>
#include <windows.h>
#include "ex_9_1.hpp"

BIN
cw 9/textures/heroes.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 786 KiB

BIN
cw 9/textures/main.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 MiB

BIN
cw 9/textures/metal_ao.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 MiB

BIN
cw 9/textures/necro.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 MiB

BIN
cw 9/textures/panels_ao.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 499 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 MiB

BIN
cw 9/textures/rock_arm.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

BIN
cw 9/textures/rock_arm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 MiB

BIN
cw 9/textures/table_ao.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
cw 9/textures/visual.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 KiB

BIN
cw 9/textures/wood_ao.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 419 KiB

BIN
cw 9/textures/x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB