improvements #4

Merged
s464921 merged 2 commits from improvements into master 2023-02-11 13:26:36 +01:00
72 changed files with 344 additions and 94 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.

View File

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

Binary file not shown.

Binary file not shown.

View File

@ -1,60 +1,69 @@
 main.cpp
C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h(130,1): warning C4005: "APIENTRY": ponowna definicja makra
C:\Users\jedrz\Desktop\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"
C:\Users\jedrz\Desktop\graf\GRK_Project\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY”
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(87,16): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(88,14): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(90,17): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(91,15): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(100,9): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(101,9): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(111,29): warning C4244: "return": konwersja z "int" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\Collision_System.cpp(115,29): warning C4244: "return": konwersja z "int" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(270,30): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(284,17): warning C4101: "data": lokalna zmienna, do której nie istnieje odwołanie
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(309,38): warning C4305: "=": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(338,16): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(527,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(541,98): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(391,68): warning C4305: "argument": obcięcie z "double" do "T"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(544,68): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\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"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(576,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(590,99): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\grafika\GRK_Project\cw 9\src\ex_9_1.hpp(468,87): warning C4305: "argument": obcięcie z "double" do "T"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(593,69): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\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"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(685,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(694,108): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\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"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(702,87): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\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"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(702,223): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(705,59): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(706,37): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(726,2): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(825,108): warning C4305: "argument": obcięcie z "double" do "T"
with
[
T=float
]
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(1088,21): warning C4305: "-=": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\graf\GRK_Project\cw 9\src\ex_9_1.hpp(1090,21): warning C4305: "+=": obcięcie z "double" do "float"
Trwa generowanie kodu
1 of 656 functions ( 0.2%) were compiled, the rest were copied from previous compilation.
2 of 687 functions ( 0.3%) were compiled, the rest were copied from previous compilation.
0 functions were new in current compilation
7 functions had inline decision re-evaluated but remain unchanged
10 functions had inline decision re-evaluated but remain unchanged
Zakończono generowanie kodu
grk-cw9.vcxproj -> C:\Users\jedrz\Desktop\grafika\GRK_Project\Release\grk-cw9.exe
grk-cw9.vcxproj -> C:\Users\jedrz\Desktop\graf\GRK_Project\Release\grk-cw9.exe

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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

View File

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

View File

@ -4,12 +4,14 @@ float AMBIENT = 0.03;
float PI = 3.14;
uniform sampler2D depthMap;
uniform sampler2D depthMap2;
uniform vec3 cameraPos;
uniform sampler2D colorTexture;
uniform vec3 sunDir;
uniform vec3 sunDir2;
uniform vec3 sunColor;
uniform vec3 lightPos;
@ -39,6 +41,7 @@ in vec3 spotlightDirTS;
in vec3 sunDirTS;
in vec4 sunSpacePos;
in vec4 sunSpacePos2;
vec3 color;
@ -114,6 +117,16 @@ float calculateShadow() {
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()
{
@ -148,6 +161,8 @@ void main()
//ilumination=ilumination+PBRLight(sunDir,sunColor,normal,viewDir);
ilumination=ilumination+PBRLight(sunDir, sunColor * calculateShadow(), normal, viewDir);
//sun2
ilumination=ilumination+PBRLight(sunDir2, sunColor * calculateShadow2(), normal, viewDir);
outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1);
}

View File

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

View File

@ -8,6 +8,7 @@ float PI = 3.14;
uniform vec3 cameraPos;
uniform sampler2D depthMap;
uniform sampler2D depthMap2;
uniform sampler2D colorTexture;
uniform sampler2D metallicTexture;
uniform sampler2D roughnessTexture;
@ -15,6 +16,7 @@ uniform sampler2D aoTexture;
uniform sampler2D normalSampler;
uniform vec3 sunDir;
uniform vec3 sunDir2;
uniform vec3 sunColor;
uniform vec3 lightPos;
@ -46,6 +48,7 @@ float metallic;
float roughness;
in vec4 sunSpacePos;
in vec4 sunSpacePos2;
float DistributionGGX(vec3 normal, vec3 H, float roughness){
@ -119,6 +122,17 @@ float calculateShadow() {
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()
{
@ -157,6 +171,9 @@ void main()
//sun
//ilumination=ilumination+PBRLight(sunDir,sunColor,normal,viewDir);
ilumination=ilumination+PBRLight(sunDir, sunColor * calculateShadow(), normal, viewDir);
//outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1);
//sun2
ilumination=ilumination+PBRLight(sunDir2, sunColor * calculateShadow2(), normal, viewDir);
outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1);
}

View File

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

View File

@ -8,11 +8,13 @@ float PI = 3.14;
uniform vec3 cameraPos;
uniform sampler2D depthMap;
uniform sampler2D depthMap2;
uniform sampler2D colorTexture;
uniform sampler2D armTexture;
uniform sampler2D normalSampler;
uniform vec3 sunDir;
uniform vec3 sunDir2;
uniform vec3 sunColor;
uniform vec3 lightPos;
@ -44,6 +46,7 @@ float metallic;
float roughness;
in vec4 sunSpacePos;
in vec4 sunSpacePos2;
float DistributionGGX(vec3 normal, vec3 H, float roughness){
@ -118,6 +121,17 @@ 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()
{
color = texture2D(colorTexture, vecTex).xyz;
@ -156,5 +170,8 @@ void main()
//ilumination=ilumination+PBRLight(sunDir,sunColor,normal,viewDir);
ilumination=ilumination+PBRLight(sunDir, sunColor * calculateShadow(), normal, viewDir);
//sun2
ilumination=ilumination+PBRLight(sunDir2, sunColor * calculateShadow2(), normal, viewDir);
outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1);
}

View File

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

BIN
cw 9/sound/ocean.wav Normal file

Binary file not shown.

View File

@ -20,7 +20,7 @@
const unsigned int SHADOW_WIDTH = 1024, SHADOW_HEIGHT = 1024;
int WIDTH = 500, HEIGHT = 500;
int WIDTH = 1000, HEIGHT = 1000;
CollisionSystem collisionSystem;
@ -70,8 +70,14 @@ namespace models {
Core::RenderContext couchContext;
Core::RenderContext vaseContext;
Core::RenderContext laptopContext;
Core::RenderContext screenContext;
Core::RenderContext mugContext;
Core::RenderContext carContext;
Core::RenderContext books1Context;
Core::RenderContext books2Context;
Core::RenderContext cactusContext;
}
std::vector<std::string> faces = {
@ -178,10 +184,43 @@ namespace texture {
GLuint vase_albedo;
GLuint vase_arm;
GLuint vase_normal;
GLuint laptop_albedo;
GLuint laptop_metallic;
GLuint laptop_roughness;
GLuint laptop_ao;
GLuint laptop_normal;
GLuint mug_albedo;
GLuint mug_metallic;
GLuint mug_roughness;
GLuint mug_ao;
GLuint mug_normal;
GLuint car_albedo;
GLuint car_metallic;
GLuint car_roughness;
GLuint car_ao;
GLuint car_normal;
GLuint books_albedo;
GLuint books_metallic;
GLuint books_roughness;
GLuint books_ao;
GLuint books_normal;
GLuint cactus_albedo;
GLuint cactus_metallic;
GLuint cactus_roughness;
GLuint cactus_ao;
GLuint cactus_normal;
}
GLuint depthMapFBO;
GLuint depthMap;
GLuint depthMapFBO2;
GLuint depthMap2;
GLuint program;
GLuint programSun;
@ -201,15 +240,17 @@ Core::RenderContext shipContext;
Core::RenderContext sphereContext;
TriangleSoup water;
glm::vec3 sunPos = glm::vec3(-4.740971f, 2.149999f, 0.369280f);
glm::vec3 sunPos = glm::vec3(-4.740971f, 2.149999f, -0.069280f);
glm::vec3 sunDir = glm::vec3(-0.93633f, 0.351106, 0.003226f);
glm::vec3 sunPos2 = glm::vec3(4.040971f, 2.149999f, -0.739280f);
glm::vec3 sunDir2 = glm::vec3(0.93633f, 0.351106, -0.003226f);
glm::vec3 sunColor = glm::vec3(0.9f, 0.9f, 0.7f) * 5;
glm::vec3 cameraPos = glm::vec3(0.479490f, 1.250000f, -2.124680f);
glm::vec3 cameraDir = glm::vec3(-0.354510f, 0.000000f, 0.935054f);
glm::vec3 spaceshipPos = glm::vec3(0.065808f, 1.250000f, -2.189549f);
glm::vec3 spaceshipPos = glm::vec3(0.065808f, 1.250000f, -1.189549f);
glm::vec3 spaceshipDir = glm::vec3(-0.490263f, 0.000000f, 0.871578f);
GLuint VAO, VBO;
@ -217,6 +258,9 @@ float aspectRatio = 1.f;
float exposition = 1.f;
glm::mat4 lightVP = glm::ortho(-3.f, 2.3f, -1.3f, 3.f, -1.0f, 40.0f) * glm::lookAt(sunPos, sunPos - sunDir, glm::vec3(0, 1, 0));
glm::mat4 lightVP2 = glm::ortho(-3.f, 2.3f, -1.3f, 3.f, -1.0f, 40.0f) * glm::lookAt(sunPos2, sunPos2 - sunDir2, glm::vec3(0, 1, 0));
glm::vec3 pointlightPos = glm::vec3(0, 2, 0);
glm::vec3 pointlightColor = glm::vec3(0.9, 0.6, 0.6);
@ -325,6 +369,7 @@ void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec
glUniform3f(glGetUniformLocation(program, "cameraPos"), cameraPos.x, cameraPos.y, cameraPos.z);
glUniform3f(glGetUniformLocation(program, "sunDir"), sunDir.x, sunDir.y, sunDir.z);
glUniform3f(glGetUniformLocation(program, "sunDir2"), sunDir2.x, sunDir2.y, sunDir2.z);
glUniform3f(glGetUniformLocation(program, "sunColor"), sunColor.x, sunColor.y, sunColor.z);
glUniform3f(glGetUniformLocation(program, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z);
@ -335,9 +380,11 @@ void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec
glUniform3f(glGetUniformLocation(program, "spotlightColor"), spotlightColor.x, spotlightColor.y, spotlightColor.z);
glUniform1f(glGetUniformLocation(program, "spotlightPhi"), spotlightPhi);
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(program, "LightVP"), 1, GL_FALSE, (float*)&lightVP);
Core::SetActiveTexture(depthMap, "depthMap", program, 0);
glUniformMatrix4fv(glGetUniformLocation(program, "LightVP2"), 1, GL_FALSE, (float*)&lightVP2);
Core::SetActiveTexture(depthMap2, "depthMap2", program, 1);
Core::DrawContext(context);
}
@ -359,6 +406,7 @@ void drawObjectTex(Core::RenderContext& context, glm::mat4 modelMatrix, float ro
glUniform3f(glGetUniformLocation(programTex, "cameraPos"), cameraPos.x, cameraPos.y, cameraPos.z);
glUniform3f(glGetUniformLocation(programTex, "sunDir"), sunDir.x, sunDir.y, sunDir.z);
glUniform3f(glGetUniformLocation(programTex, "sunDir2"), sunDir2.x, sunDir2.y, sunDir2.z);
glUniform3f(glGetUniformLocation(programTex, "sunColor"), sunColor.x, sunColor.y, sunColor.z);
glUniform3f(glGetUniformLocation(programTex, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z);
@ -372,9 +420,11 @@ void drawObjectTex(Core::RenderContext& context, glm::mat4 modelMatrix, float ro
//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);
glUniformMatrix4fv(glGetUniformLocation(programTex, "LightVP2"), 1, GL_FALSE, (float*)&lightVP2);
Core::SetActiveTexture(depthMap2, "depthMap2", programTex, 2);
Core::DrawContext(context);
}
@ -396,6 +446,7 @@ void drawObjectTexPBR(Core::RenderContext& context, glm::mat4 modelMatrix, GLuin
glUniform3f(glGetUniformLocation(programTexPBR, "cameraPos"), cameraPos.x, cameraPos.y, cameraPos.z);
glUniform3f(glGetUniformLocation(programTexPBR, "sunDir"), sunDir.x, sunDir.y, sunDir.z);
glUniform3f(glGetUniformLocation(programTexPBR, "sunDir2"), sunDir2.x, sunDir2.y, sunDir2.z);
glUniform3f(glGetUniformLocation(programTexPBR, "sunColor"), sunColor.x, sunColor.y, sunColor.z);
glUniform3f(glGetUniformLocation(programTexPBR, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z);
@ -413,9 +464,11 @@ void drawObjectTexPBR(Core::RenderContext& context, glm::mat4 modelMatrix, GLuin
//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);
glUniformMatrix4fv(glGetUniformLocation(programTexPBR, "LightVP2"), 1, GL_FALSE, (float*)&lightVP2);
Core::SetActiveTexture(depthMap2, "depthMap2", programTexPBR, 6);
Core::DrawContext(context);
}
@ -437,6 +490,7 @@ void drawObjectTexPBR_ARM(Core::RenderContext& context, glm::mat4 modelMatrix, G
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, "sunDir2"), sunDir2.x, sunDir2.y, sunDir2.z);
glUniform3f(glGetUniformLocation(programTexPBR_ARM, "sunColor"), sunColor.x, sunColor.y, sunColor.z);
glUniform3f(glGetUniformLocation(programTexPBR_ARM, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z);
@ -452,9 +506,11 @@ void drawObjectTexPBR_ARM(Core::RenderContext& context, glm::mat4 modelMatrix, G
//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);
glUniformMatrix4fv(glGetUniformLocation(programTexPBR_ARM, "LightVP2"), 1, GL_FALSE, (float*)&lightVP2);
Core::SetActiveTexture(depthMap2, "depthMap2", programTexPBR_ARM, 4);
Core::DrawContext(context);
}
@ -482,29 +538,85 @@ void renderShadowapSun() {
//ustawianie programu
glUseProgram(programDepth);
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));
drawObjectDepth(sphereContext, lightVP, glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::scale(glm::vec3(0.3f)));
drawObjectDepth(sphereContext,
lightVP, glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::eulerAngleY(time) * glm::translate(glm::vec3(1.f, 0, 0)) * glm::scale(glm::vec3(0.1f)));
drawObjectDepth(models::bedContext, lightVP, glm::mat4());
drawObjectDepth(models::chairContext, lightVP, glm::mat4());
drawObjectDepth(models::deskContext, lightVP, glm::mat4());
drawObjectDepth(models::mattressContext, lightVP, glm::mat4());
drawObjectDepth(models::bed_pillowContext, lightVP, glm::mat4());
drawObjectDepth(models::floorContext, lightVP, glm::mat4());
drawObjectDepth(models::desk_topContext, lightVP, glm::mat4());
drawObjectDepth(models::desk_bottomContext, lightVP, glm::mat4());
drawObjectDepth(models::framesContext, lightVP, glm::mat4());
drawObjectDepth(models::wallContext, lightVP, glm::mat4());
drawObjectDepth(models::foldingContext, lightVP, glm::mat4());
drawObjectDepth(models::couchContext, lightVP, glm::mat4());
drawObjectDepth(models::laptopContext, lightVP, glm::mat4());
drawObjectDepth(models::doorContext, lightVP, glm::mat4());
drawObjectDepth(models::chairContext, lightVP, glm::mat4());
drawObjectDepth(models::roofContext, lightVP, glm::mat4());
drawObjectDepth(models::blanketContext, lightVP, glm::mat4());
drawObjectDepth(models::drawerContext, 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());
drawObjectDepth(models::roomContext, lightVP, glm::mat4());
drawObjectDepth(models::windowContext, lightVP, glm::mat4());
drawObjectDepth(models::clockContext, lightVP, glm::mat4());
drawObjectDepth(models::plantContext, lightVP, glm::mat4());
drawObjectDepth(models::c_tableContext, lightVP, glm::mat4());
drawObjectDepth(models::foldingContext, lightVP, glm::mat4());
drawObjectDepth(models::mugContext, lightVP, glm::mat4());
drawObjectDepth(models::carContext, lightVP, glm::mat4());
drawObjectDepth(models::books1Context, lightVP, glm::mat4());
drawObjectDepth(models::books2Context, lightVP, glm::mat4());
drawObjectDepth(models::cactusContext, lightVP, glm::mat4());
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glViewport(0, 0, WIDTH, HEIGHT);
}
void renderShadowapSun2() {
float time = glfwGetTime();
glViewport(0, 0, SHADOW_WIDTH, SHADOW_HEIGHT);
//uzupelnij o renderowanie glebokosci do tekstury
glUseProgram(programDepth);
//ustawianie przestrzeni rysowania
glViewport(0, 0, SHADOW_WIDTH, SHADOW_HEIGHT);
//bindowanie FBO
glBindFramebuffer(GL_FRAMEBUFFER, depthMapFBO2);
//czyszczenie mapy głębokości
glClear(GL_DEPTH_BUFFER_BIT);
//ustawianie programu
glUseProgram(programDepth);
drawObjectDepth(sphereContext, lightVP2, glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::scale(glm::vec3(0.3f)));
drawObjectDepth(sphereContext,
lightVP2, glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::eulerAngleY(time) * glm::translate(glm::vec3(1.f, 0, 0)) * glm::scale(glm::vec3(0.1f)));
drawObjectDepth(models::bedContext, lightVP2, glm::mat4());
drawObjectDepth(models::mattressContext, lightVP2, glm::mat4());
drawObjectDepth(models::bed_pillowContext, lightVP2, glm::mat4());
drawObjectDepth(models::floorContext, lightVP2, glm::mat4());
drawObjectDepth(models::desk_topContext, lightVP2, glm::mat4());
drawObjectDepth(models::desk_bottomContext, lightVP2, glm::mat4());
drawObjectDepth(models::framesContext, lightVP2, glm::mat4());
drawObjectDepth(models::wallContext, lightVP2, glm::mat4());
drawObjectDepth(models::foldingContext, lightVP2, glm::mat4());
drawObjectDepth(models::couchContext, lightVP2, glm::mat4());
drawObjectDepth(models::laptopContext, lightVP2, glm::mat4());
drawObjectDepth(models::doorContext, lightVP2, glm::mat4());
drawObjectDepth(models::chairContext, lightVP2, glm::mat4());
drawObjectDepth(models::roofContext, lightVP2, glm::mat4());
drawObjectDepth(models::blanketContext, lightVP2, glm::mat4());
drawObjectDepth(models::drawerContext, lightVP2, glm::mat4());
drawObjectDepth(models::clockContext, lightVP2, glm::mat4());
drawObjectDepth(models::plantContext, lightVP2, glm::mat4());
drawObjectDepth(models::c_tableContext, lightVP2, glm::mat4());
drawObjectDepth(models::foldingContext, lightVP2, glm::mat4());
drawObjectDepth(models::mugContext, lightVP2, glm::mat4());
drawObjectDepth(models::carContext, lightVP2, glm::mat4());
drawObjectDepth(models::books1Context, lightVP2, glm::mat4());
drawObjectDepth(models::books2Context, lightVP2, glm::mat4());
drawObjectDepth(models::cactusContext, lightVP2, glm::mat4());
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glViewport(0, 0, WIDTH, HEIGHT);
}
@ -529,6 +641,26 @@ void initDepthMap()
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
void initDepthMap2()
{
glGenFramebuffers(1, &depthMapFBO2);
glGenTextures(1, &depthMap2);
glBindTexture(GL_TEXTURE_2D, depthMap2);
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT,
SHADOW_WIDTH, SHADOW_HEIGHT, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glBindFramebuffer(GL_FRAMEBUFFER, depthMapFBO2);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, depthMap2, 0);
glDrawBuffer(GL_NONE);
glReadBuffer(GL_NONE);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
void drawObjectColorWater(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec3 color, float time, GLuint textureID) {
glm::mat4 viewProjectionMatrix = createPerspectiveMatrix() * glm::mat4(glm::mat3(createCameraMatrix()));
@ -554,6 +686,7 @@ void renderScene(GLFWwindow* window)
updateDeltaTime(time);
renderShadowapSun();
renderShadowapSun2();
//space lamp
glUseProgram(programSun);
@ -572,18 +705,6 @@ void renderScene(GLFWwindow* window)
glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::eulerAngleY(time) * glm::translate(glm::vec3(1.f, 0, 0)) * glm::scale(glm::vec3(0.1f)),
glm::vec3(0.5, 0.5, 0.5), 0.7, 0.0);
//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::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::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);
//drawObjectPBR(models::roomContext, glm::mat4(), glm::vec3(0.9f, 0.9f, 0.9f), 0.8f, 0.0f);
//drawObjectPBR(models::windowContext, glm::mat4(), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f);
glm::vec3 spaceshipSide = glm::normalize(glm::cross(spaceshipDir, glm::vec3(0.f, 1.f, 0.f)));
glm::vec3 spaceshipUp = glm::normalize(glm::cross(spaceshipSide, spaceshipDir));
glm::mat4 specshipCameraRotrationMatrix = glm::mat4({
@ -611,6 +732,7 @@ void renderScene(GLFWwindow* window)
//drawObjectTex(models::marbleBustContext, glm::translate(glm::mat4(), glm::vec3(0, 0, -0.2)), 0.2, 0, texture::rust);
//drawObjectTex(models::marbleBustContext, glm::translate(glm::mat4(), glm::vec3(0, 0, 0.2)), 0, 0.2, texture::rust);
//drawObjectTex(models::doorContext, glm::mat4(), 0, 0, texture::screen);
drawObjectTex(models::screenContext, glm::mat4(), 0, 0, texture::screen);
glUseProgram(programTexPBR);
//drawObjectTexPBR(models::deskContext, glm::mat4(), texture::table_roughness, texture::table_metallic, texture::table_albedo, texture::table_normal, texture::table_ao);
@ -627,7 +749,12 @@ void renderScene(GLFWwindow* window)
drawObjectTexPBR(models::couchContext, glm::mat4(), texture::couch_roughness, texture::couch_metallic, texture::couch_albedo, texture::couch_normal, texture::couch_ao);
drawObjectTexPBR(models::doorContext, glm::mat4(), texture::wood_roughness, texture::wood_metallic, texture::wood_albedo, texture::wood_normal, texture::wood_ao);
drawObjectTexPBR(models::chairContext, glm::mat4(), texture::wood_roughness, texture::wood_metallic, texture::wood_albedo, texture::wood_normal, texture::wood_ao);
drawObjectTexPBR(models::laptopContext, glm::mat4(), texture::laptop_roughness, texture::laptop_metallic, texture::laptop_albedo, texture::laptop_normal, texture::laptop_ao);
drawObjectTexPBR(models::mugContext, glm::mat4(), texture::mug_roughness, texture::mug_metallic, texture::mug_albedo, texture::mug_normal, texture::mug_ao);
drawObjectTexPBR(models::carContext, glm::mat4(), texture::car_roughness, texture::car_metallic, texture::car_albedo, texture::car_normal, texture::car_ao);
drawObjectTexPBR(models::cactusContext, glm::mat4(), texture::cactus_roughness, texture::cactus_metallic, texture::cactus_albedo, texture::cactus_normal, texture::cactus_ao);
drawObjectTexPBR(models::books1Context, glm::mat4(), texture::books_roughness, texture::books_metallic, texture::books_albedo, texture::books_normal, texture::books_ao);
drawObjectTexPBR(models::books2Context, glm::mat4(), texture::books_roughness, texture::books_metallic, texture::books_albedo, texture::books_normal, texture::books_ao);
@ -647,18 +774,6 @@ void renderScene(GLFWwindow* window)
drawObjectTexPBR_ARM(models::vaseContext, glm::mat4(), texture::vase_albedo, texture::vase_normal, texture::vase_arm);
glUseProgram(programWater);
//drawObjectColorWater(waterContext, glm::translate(glm::mat4(1.0), glm::vec3(0.0, -1.0, 0.0)) * glm::scale(glm::vec3(30.0)), glm::vec3(0.1, 0.1, 0.95), time, texture::water);
drawObjectColorWater(waterContext, glm::translate(glm::mat4(1.0), glm::vec3(0.0f, -1.7f, 0.0f)), glm::vec4(0.1, 0.1, 0.95, 0.5), time, texture::water);
@ -710,6 +825,8 @@ void init(GLFWwindow* window)
glm::mat4 transformation = viewProjectionMatrix * glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1));
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
initDepthMap();
initDepthMap2();
PlaySound(TEXT("sound/ocean.wav"), NULL, SND_ASYNC|SND_LOOP);
glEnable(GL_DEPTH_TEST);
program = shaderLoader.CreateProgram("shaders/shader_9_1.vert", "shaders/shader_9_1.frag");
programTest = shaderLoader.CreateProgram("shaders/test.vert", "shaders/test.frag");
@ -820,7 +937,36 @@ void init(GLFWwindow* window)
texture::vase_arm = Core::LoadTexture("textures/vase/arm.png");
texture::vase_normal = Core::LoadTexture("textures/vase/normal.png");
texture::laptop_albedo = Core::LoadTexture("textures/laptop/albedo.png");
texture::laptop_metallic = Core::LoadTexture("textures/laptop/metallic.png");
texture::laptop_roughness = Core::LoadTexture("textures/laptop/roughness.png");
texture::laptop_ao = Core::LoadTexture("textures/laptop/ao.png");
texture::laptop_normal = Core::LoadTexture("textures/laptop/normal.png");
texture::screen = Core::LoadTexture("textures/visual.png");
texture::mug_albedo = Core::LoadTexture("textures/mug/albedo.png");
texture::mug_metallic = Core::LoadTexture("textures/mug/metallic.png");
texture::mug_roughness = Core::LoadTexture("textures/mug/roughness.png");
texture::mug_ao = Core::LoadTexture("textures/mug/ao.png");
texture::mug_normal = Core::LoadTexture("textures/mug/normal.png");
texture::car_albedo = Core::LoadTexture("textures/car/albedo.jpg");
texture::car_metallic = Core::LoadTexture("textures/car/metallic.jpg");
texture::car_roughness = Core::LoadTexture("textures/car/roughness.jpg");
texture::car_ao = Core::LoadTexture("textures/car/ao.jpg");
texture::car_normal = Core::LoadTexture("textures/car/normal.jpg");
texture::books_albedo = Core::LoadTexture("textures/books/albedo.png");
texture::books_metallic = Core::LoadTexture("textures/books/metallic.png");
texture::books_roughness = Core::LoadTexture("textures/books/roughness.png");
texture::books_ao = Core::LoadTexture("textures/books/ao.png");
texture::books_normal = Core::LoadTexture("textures/books/normal.png");
texture::cactus_albedo = Core::LoadTexture("textures/cactus/albedo.png");
texture::cactus_metallic = Core::LoadTexture("textures/cactus/metallic.png");
texture::cactus_roughness = Core::LoadTexture("textures/cactus/roughness.png");
texture::cactus_ao = Core::LoadTexture("textures/cactus/ao.png");
texture::cactus_normal = Core::LoadTexture("textures/cactus/normal.png");
loadModelToContext("./models/sphere.obj", sphereContext, false);
loadModelToContext("./models/spaceship.obj", shipContext, false);
@ -840,32 +986,40 @@ void init(GLFWwindow* window)
loadModelToContext("./models/test.obj", models::testContext, false);
loadModelToContext("./models/cube.obj", models::cubeContext, false);
//loadModelToContext("./models/table.obj", models::tableContext, false);
loadModelToContext("./models/wall.obj", models::wallContext, true);
loadModelToContext("./models/roof.obj", models::roofContext, true);
loadModelToContext("./models/wall.obj", models::wallContext, false);
loadModelToContext("./models/roof.obj", models::roofContext, false);
loadModelToContext("./models/window.obj", models::windowContext, true);
loadModelToContext("./models/ground.obj", models::floorContext, false);
loadModelToContext("./models/ground_001.obj", models::ceilingContext, false);
loadModelToContext("./models/bed_frame.obj", models::bedContext, false);
loadModelToContext("./models/bed_mattress.obj", models::mattressContext, false);
loadModelToContext("./models/bed_frame.obj", models::bedContext, true);
loadModelToContext("./models/bed_mattress.obj", models::mattressContext, true);
loadModelToContext("./models/bed_pillow.obj", models::bed_pillowContext, false);
loadModelToContext("./models/paplan.obj", models::blanketContext, true);
loadModelToContext("./models/paplan.obj", models::blanketContext, false);
loadModelToContext("./models/PC_desk_bake_003.obj", models::desk_topContext, false);
loadModelToContext("./models/PC_desk_bake_003.obj", models::desk_topContext, true);
loadModelToContext("./models/PC_desk_bake_004.obj", models::desk_bottomContext, false);
loadModelToContext("./models/Cube_002.obj", models::paper_stack2Context, false);
loadModelToContext("./models/Cube_009.obj", models::paper_stack3Context, false);
loadModelToContext("./models/windows_v.obj", models::framesContext, false);
loadModelToContext("./models/Cylinder.obj", models::trashcanContext, true);
loadModelToContext("./models/Cylinder.obj", models::trashcanContext, false);
loadModelToContext("./models/drawer_cabinet.obj", models::drawerContext, true);
loadModelToContext("./models/alarm_clock_01.obj", models::clockContext, true);
loadModelToContext("./models/potted_plant_04.obj", models::plantContext, true);
loadModelToContext("./models/modern_coffee_table_01.obj", models::c_tableContext, true);
loadModelToContext("./models/20848_Folding_Screen_v3.obj", models::foldingContext, false);
loadModelToContext("./models/alarm_clock_01.obj", models::clockContext, false);
loadModelToContext("./models/potted_plant_04.obj", models::plantContext, false);
loadModelToContext("./models/modern_coffee_table_01.obj", models::c_tableContext, false);
loadModelToContext("./models/20848_Folding_Screen_v3.obj", models::foldingContext, true);
loadModelToContext("./models/Foot_Rest_001.obj", models::couchContext, false);
loadModelToContext("./models/dor.obj", models::doorContext, false);
loadModelToContext("./models/uploads_files_1938755_KAUSTBY.obj", models::chairContext, false);
loadModelToContext("./models/ceramic_vase_01.obj", models::vaseContext, true);
//collisionSystem.calculateSceneBounding();
loadModelToContext("./models/ceramic_vase_01.obj", models::vaseContext, false);
loadModelToContext("./models/laptop.obj", models::laptopContext, false);
loadModelToContext("./models/screen.obj", models::screenContext, false);
loadModelToContext("./models/mug.obj", models::mugContext, false);
loadModelToContext("./models/car.obj", models::carContext, false);
loadModelToContext("./models/cactus.obj", models::cactusContext, false);
loadModelToContext("./models/books1.obj", models::books1Context, false);
loadModelToContext("./models/books2.obj", models::books2Context, false);
collisionSystem.calculateSceneBounding();
skyboxTexture = loadSkybox(faces);
//drawSkybox(models::cubeContext, transformation, skyboxTexture);
@ -911,8 +1065,16 @@ void processInput(GLFWwindow* window)
PlaySound(TEXT("sound/main.wav"), NULL, SND_ASYNC);
}
if (glfwGetKey(window, GLFW_KEY_J) == GLFW_PRESS) {
texture::screen = Core::LoadTexture("textures/heroes.jpg");
PlaySound(TEXT("sound/grass.wav"), NULL, SND_ASYNC);
}
if (glfwGetKey(window, GLFW_KEY_K) == GLFW_PRESS) {
texture::screen = Core::LoadTexture("textures/necro.png");
PlaySound(TEXT("sound/necro.wav"), NULL, SND_ASYNC);
}
if (glfwGetKey(window, GLFW_KEY_L) == GLFW_PRESS) {
texture::screen = Core::LoadTexture("textures/visual.png");
PlaySound(nullptr, nullptr, 0);
PlaySound(TEXT("sound/ocean.wav"), NULL, SND_ASYNC|SND_LOOP);
}
cameraDir = spaceshipDir;

View File

@ -24,7 +24,7 @@ int main(int argc, char** argv)
#endif
// tworzenie okna za pomoca glfw
GLFWwindow* window = glfwCreateWindow(500, 500, "FirstWindow", NULL, NULL);
GLFWwindow* window = glfwCreateWindow(1000, 1000, "FirstWindow", NULL, NULL);
if (window == NULL)
{
std::cout << "Failed to create GLFW window" << std::endl;
@ -35,7 +35,7 @@ int main(int argc, char** argv)
// ladowanie OpenGL za pomoca glew
glewInit();
glViewport(0, 0, 500, 500);
glViewport(0, 0, 1000, 1000);
init(window);

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 620 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
cw 9/textures/car/ao.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 291 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
cw 9/textures/floor3/ao.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 853 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 MiB

BIN
cw 9/textures/floor4/ao.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 KiB

1
models.txt Normal file
View File

@ -0,0 +1 @@
https://drive.google.com/drive/folders/1H9mCPv32GYCW7wTFX0St0C-mWTQPUpZ-?usp=sharing