Modified shadows in project

This commit is contained in:
CybArciom 2023-01-30 10:54:44 +01:00
parent 097ce521b6
commit eb31b6db3d
7 changed files with 24 additions and 21 deletions

Binary file not shown.

Binary file not shown.

View File

@ -4,46 +4,46 @@ C:\Users\arciom\Desktop\GRK_game_scene\dependencies\glfw-3.3.8.bin.WIN32\include
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(100,30): warning C4305: 'initializing': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(132,38): warning C4305: '=': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(155,16): warning C4305: 'initializing': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(221,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(236,98): warning C4305: 'argument': truncation from 'double' to 'T'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(224,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(239,98): warning C4305: 'argument': truncation from 'double' to 'T'
with
[
T=float
]
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(239,68): warning C4305: 'argument': truncation from 'double' to 'T'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(242,68): warning C4305: 'argument': truncation from 'double' to 'T'
with
[
T=float
]
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(273,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(320,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(329,108): warning C4305: 'argument': truncation from 'double' to 'T'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(276,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(323,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(332,108): warning C4305: 'argument': truncation from 'double' to 'T'
with
[
T=float
]
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(337,87): warning C4305: 'argument': truncation from 'double' to 'T'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(340,87): warning C4305: 'argument': truncation from 'double' to 'T'
with
[
T=float
]
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(337,223): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(340,59): warning C4305: 'argument': truncation from 'double' to 'T'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(340,223): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(343,59): warning C4305: 'argument': truncation from 'double' to 'T'
with
[
T=float
]
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(341,37): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(372,2): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(379,20): warning C4018: '<': signed/unsigned mismatch
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(381,47): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(382,48): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(465,21): warning C4018: '<': signed/unsigned mismatch
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(467,49): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(624,21): warning C4305: '-=': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(626,21): warning C4305: '+=': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(654,21): warning C4018: '<': signed/unsigned mismatch
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(656,49): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(344,37): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(375,2): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(382,20): warning C4018: '<': signed/unsigned mismatch
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(384,47): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(385,48): warning C4305: 'argument': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(468,21): warning C4018: '<': signed/unsigned mismatch
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(470,49): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(627,21): warning C4305: '-=': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(629,21): warning C4305: '+=': truncation from 'double' to 'float'
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(657,21): warning C4018: '<': signed/unsigned mismatch
C:\Users\arciom\Desktop\GRK_game_scene\cw 9\src\ex_9_1.hpp(659,49): warning C4244: 'argument': conversion from 'double' to 'float', possible loss of data
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\arciom\Desktop\GRK_game_scene\Debug\grk-cw9.exe

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -191,6 +191,9 @@ void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec
glUniform3f(glGetUniformLocation(program, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z);
glUniform3f(glGetUniformLocation(program, "lightColor"), pointlightColor.x, pointlightColor.y, pointlightColor.z);
/*glUniform3f(glGetUniformLocation(program, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z);
glUniform3f(glGetUniformLocation(program, "lightColor"), pointlightColor.x, pointlightColor.y, pointlightColor.z);*/
glUniform3f(glGetUniformLocation(program, "spotlightConeDir"), spotlightConeDir.x, spotlightConeDir.y, spotlightConeDir.z);
glUniform3f(glGetUniformLocation(program, "spotlightPos"), spotlightPos.x, spotlightPos.y, spotlightPos.z);
glUniform3f(glGetUniformLocation(program, "spotlightColor"), spotlightColor.x, spotlightColor.y, spotlightColor.z);
@ -198,7 +201,7 @@ void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec
//For shadows
glm::mat4 lightVPSun = glm::ortho(-10.f, 10.f, -10.f, 10.f, 1.0f, 40.0f) * glm::lookAt(sunPos, sunPos - sunDir, glm::vec3(0, 1, 0));
glm::mat4 lightVPSun = 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, "LightVPSun"), 1, GL_FALSE, (float*)&lightVPSun);
glUniform1i(glGetUniformLocation(program, "depthMapSun"), 2);
glActiveTexture(GL_TEXTURE0 + 2);