improvements_2 #6

Merged
s464921 merged 4 commits from improvements_2 into master 2023-02-12 11:21:23 +01:00
65 changed files with 232 additions and 78 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\graf\GRK_Project\Release\grk-cw9.exe</FullPath>
<FullPath>C:\Users\jedrz\Desktop\g\GRK_Project\Release\grk-cw9.exe</FullPath>
</ProjectOutput>
</ProjectOutputs>
<ContentFiles />

Binary file not shown.

Binary file not shown.

View File

@ -1,69 +1,85 @@
 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\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"
C:\Users\jedrz\Desktop\g\GRK_Project\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY”
C:\Users\jedrz\Desktop\g\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\g\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\g\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\g\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\g\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\g\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\g\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\g\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\g\GRK_Project\cw 9\src\ex_9_1.hpp(338,30): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(355,17): warning C4101: "data": lokalna zmienna, do której nie istnieje odwołanie
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(380,38): warning C4305: "=": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(409,16): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(614,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(622,73): warning C4244: "argument": konwersja z "int" do "GLfloat", możliwa utrata danych
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(622,66): warning C4244: "argument": konwersja z "int" do "GLfloat", możliwa utrata danych
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(637,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(655,98): 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(544,68): warning C4305: "argument": obcięcie z "double" do "T"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(658,68): 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(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"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(702,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(716,99): 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(593,69): warning C4305: "argument": obcięcie z "double" do "T"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(719,69): 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(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"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(822,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(823,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(824,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(827,31): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(828,25): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(884,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(885,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(886,8): warning C4244: "inicjowanie": konwersja z "float" do "int", możliwa utrata danych
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(889,31): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(890,25): warning C4305: "inicjowanie": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(996,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1009,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(702,87): warning C4305: "argument": obcięcie z "double" do "T"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1018,87): 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(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"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1018,223): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1047,73): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1051,81): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1052,93): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1053,83): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1054,83): warning C4305: "argument": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1149,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(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"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1470,66): warning C4244: "=": konwersja z "double" do "T", możliwa utrata danych
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"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1487,21): warning C4305: "-=": obcięcie z "double" do "float"
C:\Users\jedrz\Desktop\g\GRK_Project\cw 9\src\ex_9_1.hpp(1489,21): warning C4305: "+=": obcięcie z "double" do "float"
Trwa generowanie kodu
2 of 687 functions ( 0.3%) were compiled, the rest were copied from previous compilation.
1 of 717 functions ( 0.1%) were compiled, the rest were copied from previous compilation.
0 functions were new in current compilation
10 functions had inline decision re-evaluated but remain unchanged
7 functions had inline decision re-evaluated but remain unchanged
Zakończono generowanie kodu
grk-cw9.vcxproj -> C:\Users\jedrz\Desktop\graf\GRK_Project\Release\grk-cw9.exe
grk-cw9.vcxproj -> C:\Users\jedrz\Desktop\g\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\graf\GRK_Project\|
Release|Win32|C:\Users\jedrz\Desktop\g\GRK_Project\|

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
#version 430 core
float AMBIENT = 0.03;
float AMBIENT = 0.5;
float PI = 3.14;
@ -151,8 +151,8 @@ void main()
vec3 lightDir = normalize(lightDirTS);
//vec3 lightDir = normalize(lightPos-worldPos);
vec3 ambient = texture2D(aoTexture, vecTex).xyz*color;
vec3 ao = texture2D(aoTexture, vecTex).xyz;
vec3 ambient = AMBIENT*ao*color;
vec3 attenuatedlightColor = lightColor/pow(length(lightPos-worldPos),2);
vec3 ilumination;
ilumination = ambient+PBRLight(lightDir,attenuatedlightColor,normal,viewDir);

View File

@ -1,6 +1,6 @@
#version 430 core
float AMBIENT = 0.03;
float AMBIENT = 0.5;
float PI = 3.14;
@ -149,8 +149,8 @@ void main()
vec3 lightDir = normalize(lightDirTS);
//vec3 lightDir = normalize(lightPos-worldPos);
vec3 ambient = texture2D(armTexture, vecTex).x*color;
float ao = texture2D(armTexture, vecTex).x;
vec3 ambient = AMBIENT*ao*color;
vec3 attenuatedlightColor = lightColor/pow(length(lightPos-worldPos),2);
vec3 ilumination;
ilumination = ambient+PBRLight(lightDir,attenuatedlightColor,normal,viewDir);

View File

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

View File

@ -78,6 +78,20 @@ namespace models {
Core::RenderContext books1Context;
Core::RenderContext books2Context;
Core::RenderContext cactusContext;
Core::RenderContext fanContext;
Core::RenderContext fanTopContext;
Core::RenderContext colission1Context;
Core::RenderContext colission2Context;
Core::RenderContext colission3Context;
Core::RenderContext colission4Context;
Core::RenderContext handleContext;
Core::RenderContext pillow1Context;
Core::RenderContext pillow2Context;
Core::RenderContext pillow3Context;
Core::RenderContext painting1Context;
Core::RenderContext painting2Context;
Core::RenderContext mug2Context;
Core::RenderContext bookContext;
}
std::vector<std::string> faces = {
@ -224,6 +238,31 @@ namespace texture {
GLuint cactus_ao;
GLuint cactus_normal;
GLuint metal;
GLuint pillow1;
GLuint pillow2;
GLuint pillow3;
GLuint painting1;
GLuint painting2;
GLuint mug2_albedo;
GLuint mug2_metallic;
GLuint mug2_roughness;
GLuint mug2_ao;
GLuint mug2_normal;
GLuint book_albedo;
GLuint book_metallic;
GLuint book_roughness;
GLuint book_ao;
GLuint book_normal;
GLuint spray_albedo;
GLuint spray_metallic;
GLuint spray_roughness;
GLuint spray_ao;
GLuint spray_normal;
}
GLuint depthMapFBO;
@ -231,6 +270,8 @@ GLuint depthMap;
GLuint depthMapFBO2;
GLuint depthMap2;
int speed = 300;
GLuint program;
GLuint programSun;
GLuint programTest;
@ -267,7 +308,7 @@ glm::vec3 bubbleOriginalLocationInRoom[bubblenumber];
bool bubbleZdirInRoom[bubblenumber];
bool bubbleXdirInRoom[bubblenumber];
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);
@ -592,7 +633,7 @@ void drawBubble(glm::mat4 transformSphere) {
}
void renderShadowapSun() {
void renderShadowapSun(float angle) {
float time = glfwGetTime();
glViewport(0, 0, SHADOW_WIDTH, SHADOW_HEIGHT);
//uzupelnij o renderowanie glebokosci do tekstury
@ -607,6 +648,10 @@ void renderShadowapSun() {
//ustawianie programu
glUseProgram(programDepth);
glm::mat4 p1 = glm::translate(glm::mat4(), -glm::vec3(-2.103f, 1.0699f, -2.3338f));
glm::mat4 p2 = glm::translate(glm::mat4(), glm::vec3(-2.103f, 1.0699f, -2.3338f));
glm::mat4 rotate = p2 * glm::rotate(glm::mat4(), glm::radians(angle * speed), glm::vec3(1, 0, 0)) * p1;
drawObjectDepth(sphereContext, lightVP, glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::scale(glm::vec3(0.3f)));
drawObjectDepth(sphereContext,
@ -637,6 +682,18 @@ void renderShadowapSun() {
drawObjectDepth(models::books1Context, lightVP, glm::mat4());
drawObjectDepth(models::books2Context, lightVP, glm::mat4());
drawObjectDepth(models::cactusContext, lightVP, glm::mat4());
drawObjectDepth(models::fanContext, lightVP,glm::mat4());
drawObjectDepth(models::fanTopContext, lightVP, glm::mat4()*rotate);
drawObjectDepth(models::tableContext, lightVP, glm::mat4());
drawObjectDepth(models::handleContext, lightVP, glm::mat4());
drawObjectDepth(models::pillow1Context, lightVP, glm::mat4());
drawObjectDepth(models::pillow2Context, lightVP, glm::mat4());
drawObjectDepth(models::pillow3Context, lightVP, glm::mat4());
drawObjectDepth(models::painting1Context, lightVP, glm::mat4());
drawObjectDepth(models::painting2Context, lightVP, glm::mat4());
drawObjectDepth(models::mug2Context, lightVP, glm::mat4());
drawObjectDepth(models::bookContext, lightVP, glm::mat4());
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glViewport(0, 0, WIDTH, HEIGHT);
}
@ -686,6 +743,17 @@ void renderShadowapSun2() {
drawObjectDepth(models::books1Context, lightVP2, glm::mat4());
drawObjectDepth(models::books2Context, lightVP2, glm::mat4());
drawObjectDepth(models::cactusContext, lightVP2, glm::mat4());
drawObjectDepth(models::fanContext, lightVP2, glm::mat4());
drawObjectDepth(models::fanTopContext, lightVP2, glm::mat4());
drawObjectDepth(models::tableContext, lightVP2, glm::mat4());
drawObjectDepth(models::handleContext, lightVP, glm::mat4());
drawObjectDepth(models::pillow1Context, lightVP2, glm::mat4());
drawObjectDepth(models::pillow2Context, lightVP2, glm::mat4());
drawObjectDepth(models::pillow3Context, lightVP2, glm::mat4());
drawObjectDepth(models::painting1Context, lightVP2, glm::mat4());
drawObjectDepth(models::painting2Context, lightVP2, glm::mat4());
drawObjectDepth(models::mug2Context, lightVP2, glm::mat4());
drawObjectDepth(models::bookContext, lightVP2, glm::mat4());
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glViewport(0, 0, WIDTH, HEIGHT);
@ -927,8 +995,12 @@ void renderScene(GLFWwindow* window)
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
float time = glfwGetTime();
updateDeltaTime(time);
renderShadowapSun();
float angle = 0;
angle += static_cast<float>(glfwGetTime());
glm::mat4 p1 = glm::translate(glm::mat4(), -glm::vec3(-2.103f, 1.0699f, -2.3338f));
glm::mat4 p2 = glm::translate(glm::mat4(), glm::vec3(-2.103f, 1.0699f, -2.3338f));
glm::mat4 rotate = p2 * glm::rotate(glm::mat4(), glm::radians(angle * speed), glm::vec3(1, 0, 0)) * p1;
renderShadowapSun(angle);
renderShadowapSun2();
//space lamp
@ -941,9 +1013,12 @@ void renderScene(GLFWwindow* window)
Core::DrawContext(sphereContext);
drawSkybox(models::cubeContext, createPerspectiveMatrix() * glm::mat4(glm::mat3(createCameraMatrix())), skyboxTexture);
glUseProgram(program);
glm::mat4 transform(1.0f);
//transform = glm::rotate(glm::mat4(), angle, glm::vec3(1.0f, 0.0f, 0.0f));
drawObjectPBR(sphereContext, glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::scale(glm::vec3(0.3f)), glm::vec3(0.2, 0.7, 0.3), 0.3, 0.0);
//drawObjectPBR(models::fanContext, glm::mat4(), glm::vec3(0.01, 0.01, 0.01), 0.1, 0.2);
//drawObjectPBR(models::fanTopContext, glm::mat4()*rotate, glm::vec3(0.01, 0.01, 0.01), 0.1, 0.2);
drawObjectPBR(models::ceilingContext, glm::mat4(), glm::vec3(1,1,1), 0.5, 0);
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));
@ -959,11 +1034,7 @@ void renderScene(GLFWwindow* window)
// glm::translate(cameraPos + 1.5 * cameraDir + cameraUp * -0.5f) * inveseCameraRotrationMatrix * glm::eulerAngleY(glm::pi<float>()),
// glm::vec3(0.3, 0.3, 0.5)
// );
drawObjectPBR(shipContext,
glm::translate(spaceshipPos) * specshipCameraRotrationMatrix * glm::eulerAngleY(glm::pi<float>()) * glm::scale(glm::vec3(0.03f)),
glm::vec3(0.3, 0.3, 0.5),
0.2, 1.0
);
spotlightPos = spaceshipPos + 0.2 * spaceshipDir;
spotlightConeDir = spaceshipDir;
@ -973,9 +1044,17 @@ void renderScene(GLFWwindow* window)
//drawObjectTex(models::marbleBustContext, glm::translate(glm::mat4(), glm::vec3(0, 0, 0.2)), 0, 0.2, texture::rust);
//drawObjectTex(models::doorContext, glm::mat4(), 0, 0, texture::screen);
drawObjectTex(models::screenContext, glm::mat4(), 0, 0, texture::screen);
drawObjectTex(models::handleContext, glm::mat4(), 0, 0.2, texture::rust);
drawObjectTex(models::pillow1Context, glm::mat4(), 0.5, 0, texture::pillow1);
drawObjectTex(models::pillow2Context, glm::mat4(), 0.5, 0, texture::pillow2);
drawObjectTex(models::pillow3Context, glm::mat4(), 0.5, 0, texture::pillow3);
drawObjectTex(models::fanContext, glm::mat4(), 0.1, 0.2, texture::panels_albedo);
drawObjectTex(models::fanTopContext, glm::mat4() * rotate, 0.1, 0.2, texture::panels_albedo);
drawObjectTex(models::painting1Context, glm::mat4(), 0.5, 0.3, texture::painting1);
drawObjectTex(models::painting2Context, glm::mat4(), 0.5, 0.3, texture::painting2);
glUseProgram(programTexPBR);
//drawObjectTexPBR(models::deskContext, glm::mat4(), texture::table_roughness, texture::table_metallic, texture::table_albedo, texture::table_normal, texture::table_ao);
drawObjectTexPBR(models::tableContext, glm::mat4(), texture::table_roughness, texture::table_metallic, texture::table_albedo, texture::table_normal, texture::table_ao);
drawObjectTexPBR(models::bedContext, glm::mat4(), texture::wood_roughness, texture::wood_metallic, texture::wood_albedo, texture::wood_normal, texture::wood_ao);
drawObjectTexPBR(models::mattressContext, glm::mat4(), texture::sheets_roughness, texture::sheets_metallic, texture::sheets_albedo, texture::sheets_normal, texture::sheets_ao);
drawObjectTexPBR(models::bed_pillowContext, glm::mat4(), texture::sheets_roughness, texture::sheets_metallic, texture::sheets_albedo, texture::sheets_normal, texture::sheets_ao);
@ -995,8 +1074,12 @@ void renderScene(GLFWwindow* window)
drawObjectTexPBR(models::cactusContext, glm::mat4(), texture::cactus_roughness, texture::cactus_metallic, texture::cactus_albedo, texture::cactus_normal, texture::cactus_ao);
drawObjectTexPBR(models::books1Context, glm::mat4(), texture::books_roughness, texture::books_metallic, texture::books_albedo, texture::books_normal, texture::books_ao);
drawObjectTexPBR(models::books2Context, glm::mat4(), texture::books_roughness, texture::books_metallic, texture::books_albedo, texture::books_normal, texture::books_ao);
drawObjectTexPBR(models::mug2Context, glm::mat4(), texture::mug2_roughness, texture::mug2_metallic, texture::mug2_albedo, texture::mug2_normal, texture::mug2_ao);
drawObjectTexPBR(models::bookContext, glm::mat4(), texture::book_roughness, texture::book_metallic, texture::book_albedo, texture::book_normal, texture::book_ao);
drawObjectTexPBR(shipContext,
glm::translate(spaceshipPos) * specshipCameraRotrationMatrix * glm::eulerAngleY(glm::pi<float>()) * glm::scale(glm::vec3(0.03f)),
texture::spray_roughness, texture::spray_metallic, texture::spray_albedo, texture::spray_normal, texture::spray_ao
);
glUseProgram(programTexPBR_ARM);
//drawObjectTexPBR_ARM(models::chairContext, glm::mat4(), texture::rock_albedo, texture::rock_normal, texture::rock_arm);
@ -1083,11 +1166,11 @@ void init(GLFWwindow* window)
water.readOBJ("./models/plane2.obj");
texture::water = Core::LoadTexture("textures/test.png");
texture::rust = Core::LoadTexture("textures/rust.jpg");
texture::table_albedo = Core::LoadTexture("textures/table_albedo.png");
texture::table_metallic = Core::LoadTexture("textures/table_metallic.png");
texture::table_roughness = Core::LoadTexture("textures/table_roughness.png");
texture::table_ao = Core::LoadTexture("textures/table_ao.png");
texture::table_normal = Core::LoadTexture("textures/table_normal.jpg");
texture::table_albedo = Core::LoadTexture("textures/table/albedo.png");
texture::table_metallic = Core::LoadTexture("textures/table/metallic.png");
texture::table_roughness = Core::LoadTexture("textures/table/roughness.png");
texture::table_ao = Core::LoadTexture("textures/table/ao.png");
texture::table_normal = Core::LoadTexture("textures/table/normal.png");
texture::wood_albedo = Core::LoadTexture("textures/wood_albedo.jpg");
texture::wood_metallic = Core::LoadTexture("textures/wood_metallic.jpg");
texture::wood_roughness = Core::LoadTexture("textures/wood_roughness.jpg");
@ -1141,11 +1224,11 @@ void init(GLFWwindow* window)
texture::paper_stack = Core::LoadTexture("textures/paperstack.png");
texture::white_paint_albedo = Core::LoadTexture("textures/white_paint/albedo.png");
texture::white_paint_metallic = Core::LoadTexture("textures/white_paint/metallic.png");
texture::white_paint_roughness = Core::LoadTexture("textures/white_paint/roughness.png");
texture::white_paint_ao = Core::LoadTexture("textures/white_paint/ao.png");
texture::white_paint_normal = Core::LoadTexture("textures/white_paint/normal.png");
texture::white_paint_albedo = Core::LoadTexture("textures/white_wall/albedo.png");
texture::white_paint_metallic = Core::LoadTexture("textures/white_wall/metallic.png");
texture::white_paint_roughness = Core::LoadTexture("textures/white_wall/roughness.png");
texture::white_paint_ao = Core::LoadTexture("textures/white_wall/ao.png");
texture::white_paint_normal = Core::LoadTexture("textures/white_wall/normal.png");
texture::drawer_albedo = Core::LoadTexture("textures/drawer/albedo.png");
texture::drawer_arm = Core::LoadTexture("textures/drawer/arm.png");
@ -1210,9 +1293,36 @@ void init(GLFWwindow* window)
texture::cactus_roughness = Core::LoadTexture("textures/cactus/roughness.png");
texture::cactus_ao = Core::LoadTexture("textures/cactus/ao.png");
texture::cactus_normal = Core::LoadTexture("textures/cactus/normal.png");
texture::pillow1 = Core::LoadTexture("textures/pillow/black.png");
texture::pillow2 = Core::LoadTexture("textures/pillow/white.png");
texture::pillow3 = Core::LoadTexture("textures/pillow/yellow.png");
texture::painting1 = Core::LoadTexture("textures/painting1.png");
texture::painting2 = Core::LoadTexture("textures/painting2.png");
texture::mug2_albedo = Core::LoadTexture("textures/mug2/albedo.png");
texture::mug2_metallic = Core::LoadTexture("textures/mug2/metallic.png");
texture::mug2_roughness = Core::LoadTexture("textures/mug2/roughness.png");
texture::mug2_ao = Core::LoadTexture("textures/mug2/ao.png");
texture::mug2_normal = Core::LoadTexture("textures/mug2/normal.png");
texture::book_albedo = Core::LoadTexture("textures/book/albedo.png");
texture::book_metallic = Core::LoadTexture("textures/book/metallic.png");
texture::book_roughness = Core::LoadTexture("textures/book/roughness.png");
texture::book_ao = Core::LoadTexture("textures/book/ao.png");
texture::book_normal = Core::LoadTexture("textures/book/normal.png");
texture::spray_albedo = Core::LoadTexture("textures/spray/albedo.png");
texture::spray_metallic = Core::LoadTexture("textures/spray/metallic.png");
texture::spray_roughness = Core::LoadTexture("textures/spray/roughness.png");
texture::spray_ao = Core::LoadTexture("textures/spray/ao.png");
texture::spray_normal = Core::LoadTexture("textures/spray/normal.png");
texture::metal = Core::LoadTexture("textures/metal.png");
loadModelToContext("models/bubble.obj", bubbleContext, false);
loadModelToContext("./models/sphere.obj", sphereContext, false);
loadModelToContext("./models/spaceship.obj", shipContext, false);
loadModelToContext("./models/spray.obj", shipContext, false);
//loadModelToContext("./models/bed.obj", models::bedContext, true);
//loadModelToContext("./models/chair.obj", models::chairContext, true);
loadModelToContext("./models/desk.obj", models::deskContext, true);
@ -1228,14 +1338,14 @@ void init(GLFWwindow* window)
//loadModelToContext("./models/window.obj", models::windowContext, true);
loadModelToContext("./models/test.obj", models::testContext, false);
loadModelToContext("./models/cube.obj", models::cubeContext, false);
//loadModelToContext("./models/table.obj", models::tableContext, false);
loadModelToContext("./models/tab.obj", models::tableContext, true);
loadModelToContext("./models/wall.obj", models::wallContext, false);
loadModelToContext("./models/roof.obj", models::roofContext, false);
loadModelToContext("./models/window.obj", models::windowContext, true);
loadModelToContext("./models/window.obj", models::windowContext, false);
loadModelToContext("./models/ground.obj", models::floorContext, false);
loadModelToContext("./models/ground_001.obj", models::ceilingContext, false);
loadModelToContext("./models/bed_frame.obj", models::bedContext, true);
loadModelToContext("./models/bed_mattress.obj", models::mattressContext, true);
loadModelToContext("./models/bed_mattress.obj", models::mattressContext, false);
loadModelToContext("./models/bed_pillow.obj", models::bed_pillowContext, false);
loadModelToContext("./models/paplan.obj", models::blanketContext, false);
@ -1250,7 +1360,7 @@ void init(GLFWwindow* window)
loadModelToContext("./models/potted_plant_04.obj", models::plantContext, false);
loadModelToContext("./models/modern_coffee_table_01.obj", models::c_tableContext, false);
loadModelToContext("./models/20848_Folding_Screen_v3.obj", models::foldingContext, true);
loadModelToContext("./models/Foot_Rest_001.obj", models::couchContext, false);
loadModelToContext("./models/Foot_Rest_001.obj", models::couchContext, true);
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, false);
@ -1261,6 +1371,21 @@ void init(GLFWwindow* window)
loadModelToContext("./models/cactus.obj", models::cactusContext, false);
loadModelToContext("./models/books1.obj", models::books1Context, false);
loadModelToContext("./models/books2.obj", models::books2Context, false);
loadModelToContext("./models/fan.obj", models::fanContext, false);
loadModelToContext("./models/fan_top.obj", models::fanTopContext, false);
loadModelToContext("./models/colission1.obj", models::colission1Context, true);
loadModelToContext("./models/colission2.obj", models::colission2Context, true);
loadModelToContext("./models/colission3.obj", models::colission3Context, true);
loadModelToContext("./models/colission4.obj", models::colission4Context, true);
loadModelToContext("./models/handle.obj", models::handleContext, false);
loadModelToContext("./models/pillow1.obj", models::pillow1Context, false);
loadModelToContext("./models/pillow2.obj", models::pillow2Context, false);
loadModelToContext("./models/pillow3.obj", models::pillow3Context, false);
loadModelToContext("./models/painting1.obj", models::painting1Context, false);
loadModelToContext("./models/painting2.obj", models::painting2Context, false);
loadModelToContext("./models/mug2.obj", models::mug2Context, false);
loadModelToContext("./models/book.obj", models::bookContext, false);
collisionSystem.calculateSceneBounding();
@ -1308,21 +1433,21 @@ void processInput(GLFWwindow* window)
spaceshipDir = glm::vec3(glm::eulerAngleY(-angleSpeed) * glm::vec4(spaceshipDir, 0));
if (glfwGetKey(window, GLFW_KEY_H) == GLFW_PRESS) {
texture::screen = Core::LoadTexture("textures/main.jpg");
PlaySound(TEXT("sound/main.wav"), NULL, SND_ASYNC);
PlaySound(TEXT("sound/main.wav"), NULL, SND_ASYNC | SND_LOOP);
}
if (glfwGetKey(window, GLFW_KEY_J) == GLFW_PRESS) {
texture::screen = Core::LoadTexture("textures/heroes.jpg");
PlaySound(TEXT("sound/grass.wav"), NULL, SND_ASYNC);
PlaySound(TEXT("sound/grass.wav"), NULL, SND_ASYNC | SND_LOOP);
}
if (glfwGetKey(window, GLFW_KEY_K) == GLFW_PRESS) {
texture::screen = Core::LoadTexture("textures/necro.png");
PlaySound(TEXT("sound/necro.wav"), NULL, SND_ASYNC);
PlaySound(TEXT("sound/necro.wav"), NULL, SND_ASYNC | SND_LOOP);
}
if (glfwGetKey(window, GLFW_KEY_L) == GLFW_PRESS) {
texture::screen = Core::LoadTexture("textures/visual.png");
PlaySound(TEXT("sound/ocean.wav"), NULL, SND_ASYNC|SND_LOOP);
}
if (glfwGetKey(window, GLFW_KEY_K) == GLFW_PRESS) {
if (glfwGetKey(window, GLFW_KEY_R) == GLFW_PRESS) {
for (int i = 0; i < bubbleQuantity; i++)
{
// srand(time(NULL));
@ -1373,6 +1498,15 @@ void processInput(GLFWwindow* window)
float z = collisionSystem.getRelativeZ(spaceshipPos.z);
printf("matrix[%ff][%ff]\n", z, x);
}
if (glfwGetKey(window, GLFW_KEY_I) == GLFW_PRESS) {
speed = 0;
}
if (glfwGetKey(window, GLFW_KEY_O) == GLFW_PRESS) {
speed = 300;
}
if (glfwGetKey(window, GLFW_KEY_P) == GLFW_PRESS) {
speed = 600;
}
//cameraDir = glm::normalize(-cameraPos);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 MiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

BIN
cw 9/textures/metal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 MiB

After

Width:  |  Height:  |  Size: 2.9 MiB

BIN
cw 9/textures/painting1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 KiB

BIN
cw 9/textures/painting2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 MiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB