Compare commits
No commits in common. "master" and "zmiana" have entirely different histories.
1
.gitignore
vendored
@ -361,4 +361,3 @@ MigrationBackup/
|
|||||||
|
|
||||||
# Fody - auto-generated XML schema
|
# Fody - auto-generated XML schema
|
||||||
FodyWeavers.xsd
|
FodyWeavers.xsd
|
||||||
/cw 9/textures/test
|
|
||||||
|
10
Readme.md
@ -1,10 +0,0 @@
|
|||||||
|
|
||||||
# GRK Projekt
|
|
||||||
|
|
||||||
Water Causics / Particle Generator
|
|
||||||
|
|
||||||
Link do dokumentacji: https://uam-my.sharepoint.com/:w:/g/personal/julsad3_st_amu_edu_pl/Ea8GEqOLJMNLhxW9BBwQ2A0B0lOoyEtLEa4DNLNZkBfnqA?e=OCneeL&fbclid=IwAR3MKk2vUPXqkQhl-CC7CG04piLw_8zdY-GLTpl52MsLz2IEemNN9tcxXl4
|
|
||||||
|
|
||||||
Link do pobrania modeli: https://drive.google.com/drive/folders/1H9mCPv32GYCW7wTFX0St0C-mWTQPUpZ-?usp=sharing
|
|
||||||
|
|
||||||
Modele należy umieścić w cw 9/models.
|
|
@ -2,7 +2,7 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<ProjectOutputs>
|
<ProjectOutputs>
|
||||||
<ProjectOutput>
|
<ProjectOutput>
|
||||||
<FullPath>C:\Users\sjule\source\repos\GRK_Project\Debug\grk-cw9.exe</FullPath>
|
<FullPath>C:\Users\walcz\Desktop\GRK_Project2\Debug\grk-cw9.exe</FullPath>
|
||||||
</ProjectOutput>
|
</ProjectOutput>
|
||||||
</ProjectOutputs>
|
</ProjectOutputs>
|
||||||
<ContentFiles />
|
<ContentFiles />
|
||||||
|
@ -1,83 +1 @@
|
|||||||
main.cpp
|
grk-cw9.vcxproj -> C:\Users\walcz\Desktop\GRK_Project2\Debug\grk-cw9.exe
|
||||||
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\shared\minwindef.h(130,1): warning C4005: 'APIENTRY': macro redefinition
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123,1): message : see previous definition of 'APIENTRY'
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(87,16): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(88,14): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(90,17): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(91,15): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(100,9): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(101,9): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(111,29): warning C4244: 'return': conversion from 'int' to 'float', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\Collision_System.cpp(115,29): warning C4244: 'return': conversion from 'int' to 'float', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(337,30): warning C4305: 'initializing': truncation from 'double' to 'float'
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(375,17): warning C4101: 'data': unreferenced local variable
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(400,38): warning C4305: '=': truncation from 'double' to 'float'
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(429,16): warning C4305: 'initializing': truncation from 'double' to 'float'
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(642,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(650,73): warning C4244: 'argument': conversion from 'int' to 'GLfloat', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(650,66): warning C4244: 'argument': conversion from 'int' to 'GLfloat', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(662,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(680,98): warning C4305: 'argument': truncation from 'double' to 'T'
|
|
||||||
with
|
|
||||||
[
|
|
||||||
T=float
|
|
||||||
]
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(683,68): warning C4305: 'argument': truncation from 'double' to 'T'
|
|
||||||
with
|
|
||||||
[
|
|
||||||
T=float
|
|
||||||
]
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(728,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(742,99): warning C4305: 'argument': truncation from 'double' to 'T'
|
|
||||||
with
|
|
||||||
[
|
|
||||||
T=float
|
|
||||||
]
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(745,69): warning C4305: 'argument': truncation from 'double' to 'T'
|
|
||||||
with
|
|
||||||
[
|
|
||||||
T=float
|
|
||||||
]
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(790,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(804,99): warning C4305: 'argument': truncation from 'double' to 'T'
|
|
||||||
with
|
|
||||||
[
|
|
||||||
T=float
|
|
||||||
]
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(807,69): warning C4305: 'argument': truncation from 'double' to 'T'
|
|
||||||
with
|
|
||||||
[
|
|
||||||
T=float
|
|
||||||
]
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(931,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(932,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(933,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(936,31): warning C4305: 'initializing': truncation from 'double' to 'float'
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(937,25): warning C4305: 'initializing': truncation from 'double' to 'float'
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(991,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(992,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(993,8): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(996,31): warning C4305: 'initializing': truncation from 'double' to 'float'
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(997,23): warning C4305: 'initializing': truncation from 'double' to 'float'
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1099,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1122,87): warning C4305: 'argument': truncation from 'double' to 'T'
|
|
||||||
with
|
|
||||||
[
|
|
||||||
T=float
|
|
||||||
]
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1122,223): warning C4305: 'argument': truncation from 'double' to 'float'
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1151,73): warning C4305: 'argument': truncation from 'double' to 'float'
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1155,81): warning C4305: 'argument': truncation from 'double' to 'float'
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1156,93): warning C4305: 'argument': truncation from 'double' to 'float'
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1157,83): warning C4305: 'argument': truncation from 'double' to 'float'
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1158,83): warning C4305: 'argument': truncation from 'double' to 'float'
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1254,108): warning C4305: 'argument': truncation from 'double' to 'T'
|
|
||||||
with
|
|
||||||
[
|
|
||||||
T=float
|
|
||||||
]
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1592,21): warning C4305: '-=': truncation from 'double' to 'float'
|
|
||||||
C:\Users\sjule\source\repos\GRK_Project\cw 9\src\ex_9_1.hpp(1594,21): warning C4305: '+=': truncation from 'double' to 'float'
|
|
||||||
Box.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
|
|
||||||
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
|
|
||||||
grk-cw9.vcxproj -> C:\Users\sjule\source\repos\GRK_Project\Debug\grk-cw9.exe
|
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.34.31933:TargetPlatformVersion=10.0.22621.0:
|
PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.30.30705:TargetPlatformVersion=10.0.19041.0:
|
||||||
Debug|Win32|C:\Users\sjule\source\repos\GRK_Project\|
|
Debug|Win32|C:\Users\walcz\Desktop\GRK_Project2\|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<ProjectOutputs>
|
<ProjectOutputs>
|
||||||
<ProjectOutput>
|
<ProjectOutput>
|
||||||
<FullPath>C:\Users\jedrz\Desktop\projekt final\GRK_Project\Release\grk-cw9.exe</FullPath>
|
<FullPath>C:\Users\jedrz\Desktop\grafika\GRK_Project\Release\grk-cw9.exe</FullPath>
|
||||||
</ProjectOutput>
|
</ProjectOutput>
|
||||||
</ProjectOutputs>
|
</ProjectOutputs>
|
||||||
<ContentFiles />
|
<ContentFiles />
|
||||||
|
@ -1,86 +1,60 @@
|
|||||||
main.cpp
|
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:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h(130,1): warning C4005: "APIENTRY": ponowna definicja makra
|
||||||
C:\Users\jedrz\Desktop\projekt final\GRK_Project\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY”
|
C:\Users\jedrz\Desktop\grafika\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\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\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(166,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\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\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\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\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\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(388,98): warning C4305: "argument": obcięcie z "double" do "T"
|
||||||
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
|
with
|
||||||
[
|
[
|
||||||
T=float
|
T=float
|
||||||
]
|
]
|
||||||
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(690,68): warning C4305: "argument": obcięcie z "double" do "T"
|
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(391,68): warning C4305: "argument": obcięcie z "double" do "T"
|
||||||
with
|
with
|
||||||
[
|
[
|
||||||
T=float
|
T=float
|
||||||
]
|
]
|
||||||
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(735,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
|
C:\Users\jedrz\Desktop\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\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(749,99): warning C4305: "argument": obcięcie z "double" do "T"
|
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(460,108): warning C4305: "argument": obcięcie z "double" do "T"
|
||||||
with
|
with
|
||||||
[
|
[
|
||||||
T=float
|
T=float
|
||||||
]
|
]
|
||||||
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(752,69): warning C4305: "argument": obcięcie z "double" do "T"
|
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(468,87): warning C4305: "argument": obcięcie z "double" do "T"
|
||||||
with
|
with
|
||||||
[
|
[
|
||||||
T=float
|
T=float
|
||||||
]
|
]
|
||||||
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(797,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
|
C:\Users\jedrz\Desktop\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\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(811,99): warning C4305: "argument": obcięcie z "double" do "T"
|
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(471,59): warning C4305: "argument": obcięcie z "double" do "T"
|
||||||
with
|
with
|
||||||
[
|
[
|
||||||
T=float
|
T=float
|
||||||
]
|
]
|
||||||
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(814,69): warning C4305: "argument": obcięcie z "double" do "T"
|
C:\Users\jedrz\Desktop\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
|
with
|
||||||
[
|
[
|
||||||
T=float
|
T=float
|
||||||
]
|
]
|
||||||
C:\Users\jedrz\Desktop\projekt final\GRK_Project\cw 9\src\ex_9_1.hpp(938,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
|
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(684,21): warning C4305: "-=": obcięcie z "double" do "float"
|
||||||
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\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(686,21): warning C4305: "+=": obcięcie z "double" do "float"
|
||||||
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
|
Trwa generowanie kodu
|
||||||
99 of 727 functions (13.6%) were compiled, the rest were copied from previous compilation.
|
1 of 656 functions ( 0.2%) were compiled, the rest were copied from previous compilation.
|
||||||
0 functions were new in current compilation
|
0 functions were new in current compilation
|
||||||
24 functions had inline decision re-evaluated but remain unchanged
|
7 functions had inline decision re-evaluated but remain unchanged
|
||||||
Zakończono generowanie kodu
|
Zakończono generowanie kodu
|
||||||
grk-cw9.vcxproj -> C:\Users\jedrz\Desktop\projekt final\GRK_Project\Release\grk-cw9.exe
|
grk-cw9.vcxproj -> C:\Users\jedrz\Desktop\grafika\GRK_Project\Release\grk-cw9.exe
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.33.31629:TargetPlatformVersion=10.0.19041.0:
|
PlatformToolSet=v143:VCToolArchitecture=Native32Bit:VCToolsVersion=14.33.31629:TargetPlatformVersion=10.0.19041.0:
|
||||||
Release|Win32|C:\Users\jedrz\Desktop\projekt final\GRK_Project\|
|
Release|Win32|C:\Users\jedrz\Desktop\grafika\GRK_Project\|
|
||||||
|
BIN
cw 9/grk-cw9.rc
@ -44,8 +44,6 @@
|
|||||||
<None Include="shaders\shader_9_1.vert" />
|
<None Include="shaders\shader_9_1.vert" />
|
||||||
<None Include="shaders\shader_8_sun.frag" />
|
<None Include="shaders\shader_8_sun.frag" />
|
||||||
<None Include="shaders\shader_8_sun.vert" />
|
<None Include="shaders\shader_8_sun.vert" />
|
||||||
<None Include="shaders\shader_bubble.frag" />
|
|
||||||
<None Include="shaders\shader_bubble.vert" />
|
|
||||||
<None Include="shaders\shader_shadowap_sun.frag" />
|
<None Include="shaders\shader_shadowap_sun.frag" />
|
||||||
<None Include="shaders\shader_shadowap_sun.vert" />
|
<None Include="shaders\shader_shadowap_sun.vert" />
|
||||||
<None Include="shaders\shader_skybox.frag" />
|
<None Include="shaders\shader_skybox.frag" />
|
||||||
|
@ -154,11 +154,5 @@
|
|||||||
<None Include="shaders\shader_tex_pbr_arm.vert">
|
<None Include="shaders\shader_tex_pbr_arm.vert">
|
||||||
<Filter>Shader Files</Filter>
|
<Filter>Shader Files</Filter>
|
||||||
</None>
|
</None>
|
||||||
<None Include="shaders\shader_bubble.frag">
|
|
||||||
<Filter>Shader Files</Filter>
|
|
||||||
</None>
|
|
||||||
<None Include="shaders\shader_bubble.vert">
|
|
||||||
<Filter>Shader Files</Filter>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@ -1,14 +0,0 @@
|
|||||||
//{{NO_DEPENDENCIES}}
|
|
||||||
// Microsoft Visual C++ generated include file.
|
|
||||||
// Used by grk-cw9.rc
|
|
||||||
|
|
||||||
// Next default values for new objects
|
|
||||||
//
|
|
||||||
#ifdef APSTUDIO_INVOKED
|
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
|
||||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
|
||||||
#endif
|
|
||||||
#endif
|
|
@ -1,17 +1,15 @@
|
|||||||
#version 430 core
|
#version 430 core
|
||||||
|
|
||||||
float AMBIENT = 0.5;
|
float AMBIENT = 0.03;
|
||||||
float PI = 3.14;
|
float PI = 3.14;
|
||||||
|
|
||||||
uniform sampler2D depthMap;
|
uniform sampler2D depthMap;
|
||||||
uniform sampler2D depthMap2;
|
|
||||||
|
|
||||||
uniform vec3 cameraPos;
|
uniform vec3 cameraPos;
|
||||||
|
|
||||||
uniform vec3 color;
|
uniform vec3 color;
|
||||||
|
|
||||||
uniform vec3 sunDir;
|
uniform vec3 sunDir;
|
||||||
uniform vec3 sunDir2;
|
|
||||||
uniform vec3 sunColor;
|
uniform vec3 sunColor;
|
||||||
|
|
||||||
uniform vec3 lightPos;
|
uniform vec3 lightPos;
|
||||||
@ -40,7 +38,6 @@ in vec3 sunDirTS;
|
|||||||
|
|
||||||
in vec3 test;
|
in vec3 test;
|
||||||
in vec4 sunSpacePos;
|
in vec4 sunSpacePos;
|
||||||
in vec4 sunSpacePos2;
|
|
||||||
|
|
||||||
float DistributionGGX(vec3 normal, vec3 H, float roughness){
|
float DistributionGGX(vec3 normal, vec3 H, float roughness){
|
||||||
float a = roughness*roughness;
|
float a = roughness*roughness;
|
||||||
@ -115,16 +112,6 @@ 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()
|
void main()
|
||||||
{
|
{
|
||||||
@ -155,8 +142,6 @@ void main()
|
|||||||
//sun
|
//sun
|
||||||
ilumination=ilumination+PBRLight(sunDir, sunColor * calculateShadow(), 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);
|
outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1);
|
||||||
//outColor = vec4(roughness,metallic,0,1);
|
//outColor = vec4(roughness,metallic,0,1);
|
||||||
|
@ -9,7 +9,6 @@ layout(location = 4) in vec3 vertexBitangent;
|
|||||||
uniform mat4 transformation;
|
uniform mat4 transformation;
|
||||||
uniform mat4 modelMatrix;
|
uniform mat4 modelMatrix;
|
||||||
uniform mat4 LightVP;
|
uniform mat4 LightVP;
|
||||||
uniform mat4 LightVP2;
|
|
||||||
|
|
||||||
out vec3 vecNormal;
|
out vec3 vecNormal;
|
||||||
out vec3 worldPos;
|
out vec3 worldPos;
|
||||||
@ -24,7 +23,6 @@ out vec3 lightDirTS;
|
|||||||
out vec3 spotlightDirTS;
|
out vec3 spotlightDirTS;
|
||||||
out vec3 sunDirTS;
|
out vec3 sunDirTS;
|
||||||
out vec4 sunSpacePos;
|
out vec4 sunSpacePos;
|
||||||
out vec4 sunSpacePos2;
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
@ -44,5 +42,4 @@ void main()
|
|||||||
spotlightDirTS = TBN*SL;
|
spotlightDirTS = TBN*SL;
|
||||||
sunDirTS = TBN*sunDir;
|
sunDirTS = TBN*sunDir;
|
||||||
sunSpacePos=LightVP*modelMatrix*vec4(vertexPosition,1);
|
sunSpacePos=LightVP*modelMatrix*vec4(vertexPosition,1);
|
||||||
sunSpacePos2=LightVP2*modelMatrix*vec4(vertexPosition,1);
|
|
||||||
}
|
}
|
||||||
|
@ -1,299 +0,0 @@
|
|||||||
#version 430 core
|
|
||||||
uniform vec3 iResolution;
|
|
||||||
uniform sampler2D iChannel1;
|
|
||||||
uniform samplerCube iChannel0;
|
|
||||||
uniform float time;
|
|
||||||
|
|
||||||
|
|
||||||
//in float iDate;
|
|
||||||
in vec4 bubblePosition;
|
|
||||||
|
|
||||||
out vec4 fragColor;
|
|
||||||
|
|
||||||
/*
|
|
||||||
Fast Thin-Film Interference
|
|
||||||
|
|
||||||
This is a performance-optimized version of my previous
|
|
||||||
thin-film interference shader here: https://www.shadertoy.com/view/XddXRj
|
|
||||||
This version also fixes a platform-specific bug and has
|
|
||||||
a few other tweaks as well.
|
|
||||||
|
|
||||||
Thin-film interference and chromatic dispersion are simulated at
|
|
||||||
six different wavelengths and then downsampled to RGB.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// To see just the reflection (no refraction/transmission) uncomment this next line:
|
|
||||||
//#define REFLECTANCE_ONLY
|
|
||||||
|
|
||||||
// performance and raymarching options
|
|
||||||
#define INTERSECTION_PRECISION 0.01 // raymarcher intersection precision
|
|
||||||
#define ITERATIONS 20 // max number of iterations
|
|
||||||
#define AA_SAMPLES 1 // anti aliasing samples
|
|
||||||
#define BOUND 6.0 // cube bounds check
|
|
||||||
#define DIST_SCALE 0.9 // scaling factor for raymarching position update
|
|
||||||
|
|
||||||
// optical properties
|
|
||||||
#define DISPERSION 0.05 // dispersion amount
|
|
||||||
#define IOR 0.9 // base IOR value specified as a ratio
|
|
||||||
#define THICKNESS_SCALE 32.0 // film thickness scaling factor
|
|
||||||
#define THICKNESS_CUBEMAP_SCALE 0.1 // film thickness cubemap scaling factor
|
|
||||||
#define REFLECTANCE_SCALE 3.0 // reflectance scaling factor
|
|
||||||
#define REFLECTANCE_GAMMA_SCALE 2.0 // reflectance gamma scaling factor
|
|
||||||
#define FRESNEL_RATIO 0.7 // fresnel weight for reflectance
|
|
||||||
#define SIGMOID_CONTRAST 8.0 // contrast enhancement
|
|
||||||
|
|
||||||
#define TWO_PI 6.28318530718
|
|
||||||
#define WAVELENGTHS 6 // number of wavelengths, not a free parameter
|
|
||||||
|
|
||||||
// iq's cubemap function
|
|
||||||
vec3 fancyCube( sampler2D sam, in vec3 d, in float s, in float b )
|
|
||||||
{
|
|
||||||
vec3 colx = textureLod( sam, 0.5 + s*d.yz/d.x, b ).xyz;
|
|
||||||
vec3 coly = textureLod( sam, 0.5 + s*d.zx/d.y, b ).xyz;
|
|
||||||
vec3 colz = textureLod( sam, 0.5 + s*d.xy/d.z, b ).xyz;
|
|
||||||
|
|
||||||
vec3 n = d*d;
|
|
||||||
|
|
||||||
return (colx*n.x + coly*n.y + colz*n.z)/(n.x+n.y+n.z);
|
|
||||||
}
|
|
||||||
|
|
||||||
// iq's 3D noise function
|
|
||||||
float hash( float n ){
|
|
||||||
return fract(sin(n)*43758.5453);
|
|
||||||
}
|
|
||||||
|
|
||||||
float noise( in vec3 x ) {
|
|
||||||
vec3 p = floor(x);
|
|
||||||
vec3 f = fract(x);
|
|
||||||
|
|
||||||
f = f*f*(3.0-2.0*f);
|
|
||||||
float n = p.x + p.y*57.0 + 113.0*p.z;
|
|
||||||
return mix(mix(mix( hash(n+ 0.0), hash(n+ 1.0),f.x),
|
|
||||||
mix( hash(n+ 57.0), hash(n+ 58.0),f.x),f.y),
|
|
||||||
mix(mix( hash(n+113.0), hash(n+114.0),f.x),
|
|
||||||
mix( hash(n+170.0), hash(n+171.0),f.x),f.y),f.z);
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 noise3(vec3 x) {
|
|
||||||
return vec3( noise(x+vec3(123.456,.567,.37)),
|
|
||||||
noise(x+vec3(.11,47.43,19.17)),
|
|
||||||
noise(x) );
|
|
||||||
}
|
|
||||||
|
|
||||||
// a sphere with a little bit of warp
|
|
||||||
float sdf( vec3 p ) {
|
|
||||||
vec3 n = vec3(sin(time * 0.5), sin(time * 0.3), cos(time * 0.2));
|
|
||||||
vec3 q = 0.1 * (noise3(p + n) - 0.5);
|
|
||||||
|
|
||||||
return length(q + p) - 3.5;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 fresnel( vec3 rd, vec3 norm, vec3 n2 ) {
|
|
||||||
vec3 r0 = pow((1.0-n2)/(1.0+n2), vec3(2));
|
|
||||||
return r0 + (1. - r0)*pow(clamp(1. + dot(rd, norm), 0.0, 1.0), 5.);
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 calcNormal( in vec3 pos ) {
|
|
||||||
const float eps = INTERSECTION_PRECISION;
|
|
||||||
|
|
||||||
const vec3 v1 = vec3( 1.0,-1.0,-1.0);
|
|
||||||
const vec3 v2 = vec3(-1.0,-1.0, 1.0);
|
|
||||||
const vec3 v3 = vec3(-1.0, 1.0,-1.0);
|
|
||||||
const vec3 v4 = vec3( 1.0, 1.0, 1.0);
|
|
||||||
|
|
||||||
return normalize( v1*sdf( pos + v1*eps ) +
|
|
||||||
v2*sdf( pos + v2*eps ) +
|
|
||||||
v3*sdf( pos + v3*eps ) +
|
|
||||||
v4*sdf( pos + v4*eps ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
#define GAMMA_CURVE 50.0
|
|
||||||
#define GAMMA_SCALE 4.5
|
|
||||||
vec3 filmic_gamma(vec3 x) {
|
|
||||||
return log(GAMMA_CURVE * x + 1.0) / GAMMA_SCALE;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 filmic_gamma_inverse(vec3 y) {
|
|
||||||
return (1.0 / GAMMA_CURVE) * (exp(GAMMA_SCALE * y) - 1.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// sample weights for the cubemap given a wavelength i
|
|
||||||
// room for improvement in this function
|
|
||||||
#define GREEN_WEIGHT 2.8
|
|
||||||
vec3 texCubeSampleWeights(float i) {
|
|
||||||
vec3 w = vec3((1.0 - i) * (1.0 - i), GREEN_WEIGHT * i * (1.0 - i), i * i);
|
|
||||||
return w / dot(w, vec3(1.0));
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 sampleCubeMap(vec3 i, vec3 rd) {
|
|
||||||
vec3 col = textureLod(iChannel0, rd * vec3(1.0,-1.0,1.0), 0.0).xyz;
|
|
||||||
return vec3(
|
|
||||||
dot(texCubeSampleWeights(i.x), col),
|
|
||||||
dot(texCubeSampleWeights(i.y), col),
|
|
||||||
dot(texCubeSampleWeights(i.z), col)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 sampleCubeMap(vec3 i, vec3 rd0, vec3 rd1, vec3 rd2) {
|
|
||||||
vec3 col0 = textureLod(iChannel0, rd0 * vec3(1.0,-1.0,1.0), 0.0).xyz;
|
|
||||||
vec3 col1 = textureLod(iChannel0, rd1 * vec3(1.0,-1.0,1.0), 0.0).xyz;
|
|
||||||
vec3 col2 = textureLod(iChannel0, rd2 * vec3(1.0,-1.0,1.0), 0.0).xyz;
|
|
||||||
return vec3(
|
|
||||||
dot(texCubeSampleWeights(i.x), col0),
|
|
||||||
dot(texCubeSampleWeights(i.y), col1),
|
|
||||||
dot(texCubeSampleWeights(i.z), col2)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
vec3 sampleWeights(float i) {
|
|
||||||
return vec3((1.0 - i) * (1.0 - i), GREEN_WEIGHT * i * (1.0 - i), i * i);
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 resample(vec3 wl0, vec3 wl1, vec3 i0, vec3 i1) {
|
|
||||||
vec3 w0 = sampleWeights(wl0.x);
|
|
||||||
vec3 w1 = sampleWeights(wl0.y);
|
|
||||||
vec3 w2 = sampleWeights(wl0.z);
|
|
||||||
vec3 w3 = sampleWeights(wl1.x);
|
|
||||||
vec3 w4 = sampleWeights(wl1.y);
|
|
||||||
vec3 w5 = sampleWeights(wl1.z);
|
|
||||||
|
|
||||||
return i0.x * w0 + i0.y * w1 + i0.z * w2
|
|
||||||
+ i1.x * w3 + i1.y * w4 + i1.z * w5;
|
|
||||||
}
|
|
||||||
|
|
||||||
// downsample to RGB
|
|
||||||
vec3 resampleColor(vec3[WAVELENGTHS] rds, vec3 refl0, vec3 refl1, vec3 wl0, vec3 wl1) {
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef REFLECTANCE_ONLY
|
|
||||||
vec3 intensity0 = refl0;
|
|
||||||
vec3 intensity1 = refl1;
|
|
||||||
#else
|
|
||||||
vec3 cube0 = sampleCubeMap(wl0, rds[0], rds[1], rds[2]);
|
|
||||||
vec3 cube1 = sampleCubeMap(wl1, rds[3], rds[4], rds[5]);
|
|
||||||
|
|
||||||
vec3 intensity0 = filmic_gamma_inverse(cube0) + refl0;
|
|
||||||
vec3 intensity1 = filmic_gamma_inverse(cube1) + refl1;
|
|
||||||
#endif
|
|
||||||
vec3 col = resample(wl0, wl1, intensity0, intensity1);
|
|
||||||
|
|
||||||
return 1.4 * filmic_gamma(col / float(WAVELENGTHS));
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 resampleColorSimple(vec3 rd, vec3 wl0, vec3 wl1) {
|
|
||||||
vec3 cube0 = sampleCubeMap(wl0, rd);
|
|
||||||
vec3 cube1 = sampleCubeMap(wl1, rd);
|
|
||||||
|
|
||||||
vec3 intensity0 = filmic_gamma_inverse(cube0);
|
|
||||||
vec3 intensity1 = filmic_gamma_inverse(cube1);
|
|
||||||
vec3 col = resample(wl0, wl1, intensity0, intensity1);
|
|
||||||
|
|
||||||
return 1.4 * filmic_gamma(col / float(WAVELENGTHS));
|
|
||||||
}
|
|
||||||
|
|
||||||
// compute the wavelength/IOR curve values.
|
|
||||||
vec3 iorCurve(vec3 x) {
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 attenuation(float filmThickness, vec3 wavelengths, vec3 normal, vec3 rd) {
|
|
||||||
return 0.5 + 0.5 * cos(((THICKNESS_SCALE * filmThickness)/(wavelengths + 1.0)) * dot(normal, rd));
|
|
||||||
}
|
|
||||||
|
|
||||||
vec3 contrast(vec3 x) {
|
|
||||||
return 1.0 / (1.0 + exp(-SIGMOID_CONTRAST * (x - 0.5)));
|
|
||||||
}
|
|
||||||
|
|
||||||
void doCamera( out vec3 camPos, out vec3 camTar, in float time, in vec4 m ) {
|
|
||||||
camTar = vec3(0.0,0.0,0.0);
|
|
||||||
if (max(m.z, m.w) <= 0.0) {
|
|
||||||
float an = 1.5 + sin(time * 0.05) * 4.0;
|
|
||||||
camPos = vec3(6.5*sin(an), 0.0 ,6.5*cos(an));
|
|
||||||
} else {
|
|
||||||
float an = 10.0 * m.x - 5.0;
|
|
||||||
camPos = vec3(6.5*sin(an),10.0 * m.y - 5.0,6.5*cos(an));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mat3 calcLookAtMatrix( in vec3 ro, in vec3 ta, in float roll )
|
|
||||||
{
|
|
||||||
vec3 ww = normalize( ta - ro );
|
|
||||||
vec3 uu = normalize( cross(ww,vec3(sin(roll),cos(roll),0.0) ) );
|
|
||||||
vec3 vv = normalize( cross(uu,ww));
|
|
||||||
return mat3( uu, vv, ww );
|
|
||||||
}
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
vec2 p = (-iResolution.xy + 2.0*gl_FragCoord.xy)/iResolution.y;
|
|
||||||
//vec4 m = vec4(iMouse.xy/iResolution.xy, iMouse.zw);
|
|
||||||
|
|
||||||
// camera movement
|
|
||||||
//vec3 ro, ta;
|
|
||||||
//doCamera( ro, ta, iTime, m );
|
|
||||||
|
|
||||||
float dh = (0.666 / iResolution.y);
|
|
||||||
const float rads = TWO_PI / float(AA_SAMPLES);
|
|
||||||
|
|
||||||
vec3 col = vec3(0.0);
|
|
||||||
|
|
||||||
vec3 wavelengths0 = vec3(1.0, 0.8, 0.6);
|
|
||||||
vec3 wavelengths1 = vec3(0.4, 0.2, 0.0);
|
|
||||||
vec3 iors0 = IOR + iorCurve(wavelengths0) * DISPERSION;
|
|
||||||
vec3 iors1 = IOR + iorCurve(wavelengths1) * DISPERSION;
|
|
||||||
|
|
||||||
vec3 rds[WAVELENGTHS];
|
|
||||||
|
|
||||||
for (int samp = 0; samp < AA_SAMPLES; samp++) {
|
|
||||||
vec2 dxy = dh * vec2(cos(float(samp) * rads), sin(float(samp) * rads));
|
|
||||||
vec3 rd = normalize(vec3(p.xy + dxy, 0.2)); // 1.5 is the lens length
|
|
||||||
vec3 pos = vec3(-bubblePosition.z, -bubblePosition.y, bubblePosition.x);
|
|
||||||
bool hit = false;
|
|
||||||
for (int j = 0; j < ITERATIONS; j++) {
|
|
||||||
float t = DIST_SCALE * sdf(pos);
|
|
||||||
pos += t * rd;
|
|
||||||
hit = t < INTERSECTION_PRECISION;
|
|
||||||
if ( clamp(pos, -BOUND, BOUND) != pos || hit ) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hit) {
|
|
||||||
vec3 normal = calcNormal(pos);
|
|
||||||
|
|
||||||
float filmThickness = fancyCube( iChannel1, normal, THICKNESS_CUBEMAP_SCALE, 0.0 ).x + 0.1;
|
|
||||||
|
|
||||||
vec3 att0 = attenuation(filmThickness, wavelengths0, normal, rd);
|
|
||||||
vec3 att1 = attenuation(filmThickness, wavelengths1, normal, rd);
|
|
||||||
|
|
||||||
vec3 f0 = (1.0 - FRESNEL_RATIO) + FRESNEL_RATIO * fresnel(rd, normal, 1.0 / iors0);
|
|
||||||
vec3 f1 = (1.0 - FRESNEL_RATIO) + FRESNEL_RATIO * fresnel(rd, normal, 1.0 / iors1);
|
|
||||||
|
|
||||||
vec3 rrd = reflect(rd, normal);
|
|
||||||
|
|
||||||
vec3 cube0 = REFLECTANCE_GAMMA_SCALE * att0 * sampleCubeMap(wavelengths0, rrd);
|
|
||||||
vec3 cube1 = REFLECTANCE_GAMMA_SCALE * att1 * sampleCubeMap(wavelengths1, rrd);
|
|
||||||
|
|
||||||
vec3 refl0 = REFLECTANCE_SCALE * filmic_gamma_inverse(mix(vec3(0), cube0, f0));
|
|
||||||
vec3 refl1 = REFLECTANCE_SCALE * filmic_gamma_inverse(mix(vec3(0), cube1, f1));
|
|
||||||
|
|
||||||
rds[0] = refract(rd, normal, iors0.x);
|
|
||||||
rds[1] = refract(rd, normal, iors0.y);
|
|
||||||
rds[2] = refract(rd, normal, iors0.z);
|
|
||||||
rds[3] = refract(rd, normal, iors1.x);
|
|
||||||
rds[4] = refract(rd, normal, iors1.y);
|
|
||||||
rds[5] = refract(rd, normal, iors1.z);
|
|
||||||
|
|
||||||
col += resampleColor(rds, refl0, refl1, wavelengths0, wavelengths1);
|
|
||||||
} else {
|
|
||||||
col += resampleColorSimple(rd, wavelengths0, wavelengths1);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
col /= float(AA_SAMPLES);
|
|
||||||
|
|
||||||
fragColor = vec4( contrast(col), 1.0 );
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
#version 430 core
|
|
||||||
|
|
||||||
layout(location = 0) in vec3 vertexPosition;
|
|
||||||
layout(location = 1) in vec3 vertexNormal;
|
|
||||||
layout(location = 2) in vec2 vertexTexCoord;
|
|
||||||
|
|
||||||
uniform mat4 transformation;
|
|
||||||
//uniform float time;
|
|
||||||
|
|
||||||
out vec4 bubblePosition;
|
|
||||||
//out float iDate;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
bubblePosition = transformation * vec4(vertexPosition, 1.0);
|
|
||||||
//vec3 bubbling = sdf(bubblePosition2.xyz);
|
|
||||||
gl_Position = transformation * vec4(vertexPosition, 1.0);
|
|
||||||
//gl_Position = vec4(vertexPosition, 1.0);
|
|
||||||
}
|
|
@ -1,17 +1,15 @@
|
|||||||
#version 430 core
|
#version 430 core
|
||||||
|
|
||||||
float AMBIENT = 0.5;
|
float AMBIENT = 0.03;
|
||||||
float PI = 3.14;
|
float PI = 3.14;
|
||||||
|
|
||||||
uniform sampler2D depthMap;
|
uniform sampler2D depthMap;
|
||||||
uniform sampler2D depthMap2;
|
|
||||||
|
|
||||||
uniform vec3 cameraPos;
|
uniform vec3 cameraPos;
|
||||||
|
|
||||||
uniform sampler2D colorTexture;
|
uniform sampler2D colorTexture;
|
||||||
|
|
||||||
uniform vec3 sunDir;
|
uniform vec3 sunDir;
|
||||||
uniform vec3 sunDir2;
|
|
||||||
uniform vec3 sunColor;
|
uniform vec3 sunColor;
|
||||||
|
|
||||||
uniform vec3 lightPos;
|
uniform vec3 lightPos;
|
||||||
@ -41,7 +39,6 @@ in vec3 spotlightDirTS;
|
|||||||
in vec3 sunDirTS;
|
in vec3 sunDirTS;
|
||||||
|
|
||||||
in vec4 sunSpacePos;
|
in vec4 sunSpacePos;
|
||||||
in vec4 sunSpacePos2;
|
|
||||||
|
|
||||||
vec3 color;
|
vec3 color;
|
||||||
|
|
||||||
@ -117,16 +114,6 @@ float calculateShadow() {
|
|||||||
return (0.5*(diff)/abs(diff))+0.5;
|
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()
|
void main()
|
||||||
{
|
{
|
||||||
@ -161,8 +148,6 @@ void main()
|
|||||||
//ilumination=ilumination+PBRLight(sunDir,sunColor,normal,viewDir);
|
//ilumination=ilumination+PBRLight(sunDir,sunColor,normal,viewDir);
|
||||||
ilumination=ilumination+PBRLight(sunDir, sunColor * calculateShadow(), 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);
|
outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1);
|
||||||
}
|
}
|
@ -9,7 +9,6 @@ layout(location = 4) in vec3 vertexBitangent;
|
|||||||
uniform mat4 transformation;
|
uniform mat4 transformation;
|
||||||
uniform mat4 modelMatrix;
|
uniform mat4 modelMatrix;
|
||||||
uniform mat4 LightVP;
|
uniform mat4 LightVP;
|
||||||
uniform mat4 LightVP2;
|
|
||||||
|
|
||||||
out vec3 vecNormal;
|
out vec3 vecNormal;
|
||||||
out vec3 worldPos;
|
out vec3 worldPos;
|
||||||
@ -25,8 +24,6 @@ out vec3 spotlightDirTS;
|
|||||||
out vec3 sunDirTS;
|
out vec3 sunDirTS;
|
||||||
out vec2 vecTex;
|
out vec2 vecTex;
|
||||||
out vec4 sunSpacePos;
|
out vec4 sunSpacePos;
|
||||||
out vec4 sunSpacePos2;
|
|
||||||
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
@ -49,6 +46,5 @@ void main()
|
|||||||
spotlightDirTS = TBN*SL;
|
spotlightDirTS = TBN*SL;
|
||||||
sunDirTS = TBN*sunDir;
|
sunDirTS = TBN*sunDir;
|
||||||
sunSpacePos=LightVP*modelMatrix*vec4(vertexPosition,1);
|
sunSpacePos=LightVP*modelMatrix*vec4(vertexPosition,1);
|
||||||
sunSpacePos2=LightVP2*modelMatrix*vec4(vertexPosition,1);
|
|
||||||
|
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
#version 430 core
|
#version 430 core
|
||||||
|
|
||||||
float AMBIENT = 0.5;
|
float AMBIENT = 0.03;
|
||||||
float PI = 3.14;
|
float PI = 3.14;
|
||||||
|
|
||||||
|
|
||||||
@ -8,8 +8,6 @@ float PI = 3.14;
|
|||||||
uniform vec3 cameraPos;
|
uniform vec3 cameraPos;
|
||||||
|
|
||||||
uniform sampler2D depthMap;
|
uniform sampler2D depthMap;
|
||||||
uniform sampler2D depthMap2;
|
|
||||||
uniform sampler2D depthMap3;
|
|
||||||
uniform sampler2D colorTexture;
|
uniform sampler2D colorTexture;
|
||||||
uniform sampler2D metallicTexture;
|
uniform sampler2D metallicTexture;
|
||||||
uniform sampler2D roughnessTexture;
|
uniform sampler2D roughnessTexture;
|
||||||
@ -17,8 +15,6 @@ uniform sampler2D aoTexture;
|
|||||||
uniform sampler2D normalSampler;
|
uniform sampler2D normalSampler;
|
||||||
|
|
||||||
uniform vec3 sunDir;
|
uniform vec3 sunDir;
|
||||||
uniform vec3 sunDir2;
|
|
||||||
uniform vec3 lampDir;
|
|
||||||
uniform vec3 sunColor;
|
uniform vec3 sunColor;
|
||||||
|
|
||||||
uniform vec3 lightPos;
|
uniform vec3 lightPos;
|
||||||
@ -50,8 +46,6 @@ float metallic;
|
|||||||
float roughness;
|
float roughness;
|
||||||
|
|
||||||
in vec4 sunSpacePos;
|
in vec4 sunSpacePos;
|
||||||
in vec4 sunSpacePos2;
|
|
||||||
in vec4 lampSpacePos;
|
|
||||||
|
|
||||||
|
|
||||||
float DistributionGGX(vec3 normal, vec3 H, float roughness){
|
float DistributionGGX(vec3 normal, vec3 H, float roughness){
|
||||||
@ -125,30 +119,6 @@ float calculateShadow() {
|
|||||||
return (0.5*(diff)/abs(diff))+0.5;
|
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()
|
void main()
|
||||||
{
|
{
|
||||||
@ -167,8 +137,8 @@ void main()
|
|||||||
vec3 lightDir = normalize(lightDirTS);
|
vec3 lightDir = normalize(lightDirTS);
|
||||||
//vec3 lightDir = normalize(lightPos-worldPos);
|
//vec3 lightDir = normalize(lightPos-worldPos);
|
||||||
|
|
||||||
vec3 ao = texture2D(aoTexture, vecTex).xyz;
|
|
||||||
vec3 ambient = AMBIENT*ao*color;
|
vec3 ambient = texture2D(aoTexture, vecTex).xyz*color;
|
||||||
vec3 attenuatedlightColor = lightColor/pow(length(lightPos-worldPos),2);
|
vec3 attenuatedlightColor = lightColor/pow(length(lightPos-worldPos),2);
|
||||||
vec3 ilumination;
|
vec3 ilumination;
|
||||||
ilumination = ambient+PBRLight(lightDir,attenuatedlightColor,normal,viewDir);
|
ilumination = ambient+PBRLight(lightDir,attenuatedlightColor,normal,viewDir);
|
||||||
@ -187,12 +157,6 @@ void main()
|
|||||||
//sun
|
//sun
|
||||||
//ilumination=ilumination+PBRLight(sunDir,sunColor,normal,viewDir);
|
//ilumination=ilumination+PBRLight(sunDir,sunColor,normal,viewDir);
|
||||||
ilumination=ilumination+PBRLight(sunDir, sunColor * calculateShadow(), 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);
|
outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1);
|
||||||
}
|
}
|
@ -9,8 +9,6 @@ layout(location = 4) in vec3 vertexBitangent;
|
|||||||
uniform mat4 transformation;
|
uniform mat4 transformation;
|
||||||
uniform mat4 modelMatrix;
|
uniform mat4 modelMatrix;
|
||||||
uniform mat4 LightVP;
|
uniform mat4 LightVP;
|
||||||
uniform mat4 LightVP2;
|
|
||||||
uniform mat4 LightVP3;
|
|
||||||
|
|
||||||
out vec3 vecNormal;
|
out vec3 vecNormal;
|
||||||
out vec3 worldPos;
|
out vec3 worldPos;
|
||||||
@ -26,9 +24,6 @@ out vec3 spotlightDirTS;
|
|||||||
out vec3 sunDirTS;
|
out vec3 sunDirTS;
|
||||||
out vec2 vecTex;
|
out vec2 vecTex;
|
||||||
out vec4 sunSpacePos;
|
out vec4 sunSpacePos;
|
||||||
out vec4 sunSpacePos2;
|
|
||||||
out vec4 lampSpacePos;
|
|
||||||
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
@ -50,6 +45,5 @@ void main()
|
|||||||
spotlightDirTS = TBN*SL;
|
spotlightDirTS = TBN*SL;
|
||||||
sunDirTS = TBN*sunDir;
|
sunDirTS = TBN*sunDir;
|
||||||
sunSpacePos=LightVP*modelMatrix*vec4(vertexPosition,1);
|
sunSpacePos=LightVP*modelMatrix*vec4(vertexPosition,1);
|
||||||
sunSpacePos2=LightVP2*modelMatrix*vec4(vertexPosition,1);
|
|
||||||
lampSpacePos=LightVP3*modelMatrix*vec4(vertexPosition,1);
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#version 430 core
|
#version 430 core
|
||||||
|
|
||||||
float AMBIENT = 0.5;
|
float AMBIENT = 0.03;
|
||||||
float PI = 3.14;
|
float PI = 3.14;
|
||||||
|
|
||||||
|
|
||||||
@ -8,15 +8,11 @@ float PI = 3.14;
|
|||||||
uniform vec3 cameraPos;
|
uniform vec3 cameraPos;
|
||||||
|
|
||||||
uniform sampler2D depthMap;
|
uniform sampler2D depthMap;
|
||||||
uniform sampler2D depthMap2;
|
|
||||||
uniform sampler2D depthMap3;
|
|
||||||
uniform sampler2D colorTexture;
|
uniform sampler2D colorTexture;
|
||||||
uniform sampler2D armTexture;
|
uniform sampler2D armTexture;
|
||||||
uniform sampler2D normalSampler;
|
uniform sampler2D normalSampler;
|
||||||
|
|
||||||
uniform vec3 sunDir;
|
uniform vec3 sunDir;
|
||||||
uniform vec3 sunDir2;
|
|
||||||
uniform vec3 lampDir;
|
|
||||||
uniform vec3 sunColor;
|
uniform vec3 sunColor;
|
||||||
|
|
||||||
uniform vec3 lightPos;
|
uniform vec3 lightPos;
|
||||||
@ -48,8 +44,7 @@ float metallic;
|
|||||||
float roughness;
|
float roughness;
|
||||||
|
|
||||||
in vec4 sunSpacePos;
|
in vec4 sunSpacePos;
|
||||||
in vec4 sunSpacePos2;
|
|
||||||
in vec4 lampSpacePos;
|
|
||||||
|
|
||||||
float DistributionGGX(vec3 normal, vec3 H, float roughness){
|
float DistributionGGX(vec3 normal, vec3 H, float roughness){
|
||||||
float a = roughness*roughness;
|
float a = roughness*roughness;
|
||||||
@ -123,30 +118,6 @@ 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
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()
|
void main()
|
||||||
{
|
{
|
||||||
color = texture2D(colorTexture, vecTex).xyz;
|
color = texture2D(colorTexture, vecTex).xyz;
|
||||||
@ -164,8 +135,8 @@ void main()
|
|||||||
vec3 lightDir = normalize(lightDirTS);
|
vec3 lightDir = normalize(lightDirTS);
|
||||||
//vec3 lightDir = normalize(lightPos-worldPos);
|
//vec3 lightDir = normalize(lightPos-worldPos);
|
||||||
|
|
||||||
float ao = texture2D(armTexture, vecTex).x;
|
|
||||||
vec3 ambient = AMBIENT*ao*color;
|
vec3 ambient = texture2D(armTexture, vecTex).x*color;
|
||||||
vec3 attenuatedlightColor = lightColor/pow(length(lightPos-worldPos),2);
|
vec3 attenuatedlightColor = lightColor/pow(length(lightPos-worldPos),2);
|
||||||
vec3 ilumination;
|
vec3 ilumination;
|
||||||
ilumination = ambient+PBRLight(lightDir,attenuatedlightColor,normal,viewDir);
|
ilumination = ambient+PBRLight(lightDir,attenuatedlightColor,normal,viewDir);
|
||||||
@ -174,22 +145,16 @@ void main()
|
|||||||
|
|
||||||
//flashlight
|
//flashlight
|
||||||
//vec3 spotlightDir= normalize(spotlightDirTS);
|
//vec3 spotlightDir= normalize(spotlightDirTS);
|
||||||
//vec3 spotlightDir= normalize(spotlightPos-worldPos);
|
vec3 spotlightDir= normalize(spotlightPos-worldPos);
|
||||||
|
|
||||||
|
|
||||||
//float angle_atenuation = clamp((dot(-normalize(spotlightPos-worldPos),spotlightConeDir)-0.5)*3,0,1);
|
float angle_atenuation = clamp((dot(-normalize(spotlightPos-worldPos),spotlightConeDir)-0.5)*3,0,1);
|
||||||
//attenuatedlightColor = angle_atenuation*spotlightColor/pow(length(spotlightPos-worldPos),2);
|
attenuatedlightColor = angle_atenuation*spotlightColor/pow(length(spotlightPos-worldPos),2);
|
||||||
//ilumination=ilumination+PBRLight(spotlightDir,attenuatedlightColor,normal,viewDir);
|
ilumination=ilumination+PBRLight(spotlightDir,attenuatedlightColor,normal,viewDir);
|
||||||
|
|
||||||
//sun
|
//sun
|
||||||
//ilumination=ilumination+PBRLight(sunDir,sunColor,normal,viewDir);
|
//ilumination=ilumination+PBRLight(sunDir,sunColor,normal,viewDir);
|
||||||
ilumination=ilumination+PBRLight(sunDir, sunColor * calculateShadow(), 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);
|
outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1);
|
||||||
}
|
}
|
@ -9,8 +9,6 @@ layout(location = 4) in vec3 vertexBitangent;
|
|||||||
uniform mat4 transformation;
|
uniform mat4 transformation;
|
||||||
uniform mat4 modelMatrix;
|
uniform mat4 modelMatrix;
|
||||||
uniform mat4 LightVP;
|
uniform mat4 LightVP;
|
||||||
uniform mat4 LightVP2;
|
|
||||||
uniform mat4 LightVP3;
|
|
||||||
|
|
||||||
out vec3 vecNormal;
|
out vec3 vecNormal;
|
||||||
out vec3 worldPos;
|
out vec3 worldPos;
|
||||||
@ -26,8 +24,6 @@ out vec3 spotlightDirTS;
|
|||||||
out vec3 sunDirTS;
|
out vec3 sunDirTS;
|
||||||
out vec2 vecTex;
|
out vec2 vecTex;
|
||||||
out vec4 sunSpacePos;
|
out vec4 sunSpacePos;
|
||||||
out vec4 sunSpacePos2;
|
|
||||||
out vec4 lampSpacePos;
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
@ -49,6 +45,5 @@ void main()
|
|||||||
spotlightDirTS = TBN*SL;
|
spotlightDirTS = TBN*SL;
|
||||||
sunDirTS = TBN*sunDir;
|
sunDirTS = TBN*sunDir;
|
||||||
sunSpacePos=LightVP*modelMatrix*vec4(vertexPosition,1);
|
sunSpacePos=LightVP*modelMatrix*vec4(vertexPosition,1);
|
||||||
sunSpacePos2=LightVP2*modelMatrix*vec4(vertexPosition,1);
|
|
||||||
lampSpacePos=LightVP3*modelMatrix*vec4(vertexPosition,1);
|
|
||||||
}
|
}
|
||||||
|
@ -207,7 +207,7 @@ void main () {
|
|||||||
//vec4 light = vec4(1.0, 10.0, 0.0, 0.1);
|
//vec4 light = vec4(1.0, 10.0, 0.0, 0.1);
|
||||||
vec4 light = vec4(lightPos, 1);
|
vec4 light = vec4(lightPos, 1);
|
||||||
//light = light*rotMat;
|
//light = light*rotMat;
|
||||||
vec3 colorBlue = vec3(0.0,0.1,0.2);
|
vec3 colorBlue = vec3(0.0,0.1,0.3);
|
||||||
vec3 colorLightBlue = vec3(0.0, 0.04, 0.2);
|
vec3 colorLightBlue = vec3(0.0, 0.04, 0.2);
|
||||||
vec3 colorWhite = vec3(0.9, 0.9, 0.9);
|
vec3 colorWhite = vec3(0.9, 0.9, 0.9);
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ int main(int argc, char** argv)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// tworzenie okna za pomoca glfw
|
// tworzenie okna za pomoca glfw
|
||||||
GLFWwindow* window = glfwCreateWindow(1000, 1000, "FirstWindow", NULL, NULL);
|
GLFWwindow* window = glfwCreateWindow(500, 500, "FirstWindow", NULL, NULL);
|
||||||
if (window == NULL)
|
if (window == NULL)
|
||||||
{
|
{
|
||||||
std::cout << "Failed to create GLFW window" << std::endl;
|
std::cout << "Failed to create GLFW window" << std::endl;
|
||||||
@ -35,7 +35,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
// ladowanie OpenGL za pomoca glew
|
// ladowanie OpenGL za pomoca glew
|
||||||
glewInit();
|
glewInit();
|
||||||
glViewport(0, 0, 1000, 1000);
|
glViewport(0, 0, 500, 500);
|
||||||
|
|
||||||
init(window);
|
init(window);
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 5.6 MiB |
Before Width: | Height: | Size: 366 KiB |
Before Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 6.3 MiB |
Before Width: | Height: | Size: 2.0 MiB |
Before Width: | Height: | Size: 2.5 MiB |
Before Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 9.7 MiB |
Before Width: | Height: | Size: 620 KiB |
Before Width: | Height: | Size: 446 KiB |
Before Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 2.7 MiB |
Before Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 492 KiB |
Before Width: | Height: | Size: 2.9 MiB |
Before Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 257 KiB |
Before Width: | Height: | Size: 2.1 MiB |
Before Width: | Height: | Size: 295 KiB |
Before Width: | Height: | Size: 291 KiB |
Before Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 1.7 MiB |
Before Width: | Height: | Size: 853 KiB |
Before Width: | Height: | Size: 1.5 MiB |