diff --git a/.vs/dgrk-2023-planeta/v16/Browse.VC.db b/.vs/dgrk-2023-planeta/v16/Browse.VC.db new file mode 100644 index 0000000..503bcb0 Binary files /dev/null and b/.vs/dgrk-2023-planeta/v16/Browse.VC.db differ diff --git a/grk/.vs/grk-cw/v16/.suo b/grk/.vs/grk-cw/v16/.suo new file mode 100644 index 0000000..3a8cf6f Binary files /dev/null and b/grk/.vs/grk-cw/v16/.suo differ diff --git a/grk/.vs/grk-cw/v16/Browse.VC.db b/grk/.vs/grk-cw/v16/Browse.VC.db new file mode 100644 index 0000000..16d0bce Binary files /dev/null and b/grk/.vs/grk-cw/v16/Browse.VC.db differ diff --git a/grk/.vs/grk-cw/v16/Solution.VC.db b/grk/.vs/grk-cw/v16/Solution.VC.db new file mode 100644 index 0000000..f8e8668 Binary files /dev/null and b/grk/.vs/grk-cw/v16/Solution.VC.db differ diff --git a/grk/.vs/grk-cw/v16/ipch/AutoPCH/520a626c2b6c2b48/MAIN.ipch b/grk/.vs/grk-cw/v16/ipch/AutoPCH/520a626c2b6c2b48/MAIN.ipch new file mode 100644 index 0000000..bcc8f32 Binary files /dev/null and b/grk/.vs/grk-cw/v16/ipch/AutoPCH/520a626c2b6c2b48/MAIN.ipch differ diff --git a/grk/.vs/grk-cw/v16/ipch/AutoPCH/824b4bc7a8383263/STB_IMAGE_AUG.ipch b/grk/.vs/grk-cw/v16/ipch/AutoPCH/824b4bc7a8383263/STB_IMAGE_AUG.ipch new file mode 100644 index 0000000..59d0816 Binary files /dev/null and b/grk/.vs/grk-cw/v16/ipch/AutoPCH/824b4bc7a8383263/STB_IMAGE_AUG.ipch differ diff --git a/grk/.vs/grk-cw/v16/ipch/AutoPCH/94146b4b3cd713f7/VCTMP2860_995706.EX_6_1.7890A90E.ipch b/grk/.vs/grk-cw/v16/ipch/AutoPCH/94146b4b3cd713f7/VCTMP2860_995706.EX_6_1.7890A90E.ipch new file mode 100644 index 0000000..2a0a9f1 Binary files /dev/null and b/grk/.vs/grk-cw/v16/ipch/AutoPCH/94146b4b3cd713f7/VCTMP2860_995706.EX_6_1.7890A90E.ipch differ diff --git a/grk/.vs/grk-cw/v16/ipch/AutoPCH/952b43f8a9f56e47/VCTMP15004_135002.EX_6_1.D620D78E.ipch b/grk/.vs/grk-cw/v16/ipch/AutoPCH/952b43f8a9f56e47/VCTMP15004_135002.EX_6_1.D620D78E.ipch new file mode 100644 index 0000000..1b230f0 Binary files /dev/null and b/grk/.vs/grk-cw/v16/ipch/AutoPCH/952b43f8a9f56e47/VCTMP15004_135002.EX_6_1.D620D78E.ipch differ diff --git a/grk/.vs/grk-cw/v16/ipch/AutoPCH/be9255ac09a069c3/RENDER_UTILS.ipch b/grk/.vs/grk-cw/v16/ipch/AutoPCH/be9255ac09a069c3/RENDER_UTILS.ipch new file mode 100644 index 0000000..2b61ce7 Binary files /dev/null and b/grk/.vs/grk-cw/v16/ipch/AutoPCH/be9255ac09a069c3/RENDER_UTILS.ipch differ diff --git a/grk/Debug/grk-cw6.exe b/grk/Debug/grk-cw6.exe new file mode 100644 index 0000000..a889991 Binary files /dev/null and b/grk/Debug/grk-cw6.exe differ diff --git a/grk/Debug/grk-cw6.pdb b/grk/Debug/grk-cw6.pdb new file mode 100644 index 0000000..90708d3 Binary files /dev/null and b/grk/Debug/grk-cw6.pdb differ diff --git a/grk/cw 6/Debug/Box.obj b/grk/cw 6/Debug/Box.obj index fa8f834..4000b58 100644 Binary files a/grk/cw 6/Debug/Box.obj and b/grk/cw 6/Debug/Box.obj differ diff --git a/grk/cw 6/Debug/Camera.obj b/grk/cw 6/Debug/Camera.obj index 186c80f..576b57b 100644 Binary files a/grk/cw 6/Debug/Camera.obj and b/grk/cw 6/Debug/Camera.obj differ diff --git a/grk/cw 6/Debug/Render_Utils.obj b/grk/cw 6/Debug/Render_Utils.obj index 76359a2..8fef00e 100644 Binary files a/grk/cw 6/Debug/Render_Utils.obj and b/grk/cw 6/Debug/Render_Utils.obj differ diff --git a/grk/cw 6/Debug/SOIL.obj b/grk/cw 6/Debug/SOIL.obj index a6e0350..c608d02 100644 Binary files a/grk/cw 6/Debug/SOIL.obj and b/grk/cw 6/Debug/SOIL.obj differ diff --git a/grk/cw 6/Debug/Shader_Loader.obj b/grk/cw 6/Debug/Shader_Loader.obj index 03d7fd2..6d5c90e 100644 Binary files a/grk/cw 6/Debug/Shader_Loader.obj and b/grk/cw 6/Debug/Shader_Loader.obj differ diff --git a/grk/cw 6/Debug/Texture.obj b/grk/cw 6/Debug/Texture.obj index f41f455..737d9dc 100644 Binary files a/grk/cw 6/Debug/Texture.obj and b/grk/cw 6/Debug/Texture.obj differ diff --git a/grk/cw 6/Debug/grk-cw6.exe.recipe b/grk/cw 6/Debug/grk-cw6.exe.recipe index d9077bc..3a2fd02 100644 --- a/grk/cw 6/Debug/grk-cw6.exe.recipe +++ b/grk/cw 6/Debug/grk-cw6.exe.recipe @@ -2,7 +2,7 @@ - E:\micha\studia\grafika_komputerowa\grk\grk\Debug\grk-cw6.exe + D:\grk2024\dgrk-2023-planeta\grk\Debug\grk-cw6.exe diff --git a/grk/cw 6/Debug/grk-cw6.log b/grk/cw 6/Debug/grk-cw6.log index 989ad23..a1c34be 100644 --- a/grk/cw 6/Debug/grk-cw6.log +++ b/grk/cw 6/Debug/grk-cw6.log @@ -1,39 +1,39 @@ -C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(513,5): warning MSB8028: The intermediate directory (Debug\) contains files shared from another project (grk-cw3.vcxproj, grk-cw4.vcxproj, grk-cw5.vcxproj). This can lead to incorrect clean and rebuild behavior. +C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(491,5): warning MSB8028: Katalog pośredni (Debug\) zawiera pliki udostępnione z innego projektu (grk-cw3.vcxproj, grk-cw4.vcxproj, grk-cw5.vcxproj). Może to spowodować niepoprawne zachowanie podczas oczyszczania i ponownej kompilacji. main.cpp -C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h(130,1): warning C4005: 'APIENTRY': macro redefinition -E:\micha\studia\grafika_komputerowa\grk\grk\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : see previous definition of 'APIENTRY' -E:\micha\studia\grafika_komputerowa\grk\grk\cw 6\src\ex_6_1.hpp(96,16): warning C4305: 'initializing': truncation from 'double' to 'float' -E:\micha\studia\grafika_komputerowa\grk\grk\cw 6\src\ex_6_1.hpp(152,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data -E:\micha\studia\grafika_komputerowa\grk\grk\cw 6\src\ex_6_1.hpp(156,52): warning C4305: 'argument': truncation from 'double' to 'T' +C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h(130,1): warning C4005: "APIENTRY": ponowna definicja makra +D:\grk2024\dgrk-2023-planeta\grk\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY” +D:\grk2024\dgrk-2023-planeta\grk\cw 6\src\ex_6_1.hpp(96,16): warning C4305: "inicjowanie": obcięcie z "double" do "float" +D:\grk2024\dgrk-2023-planeta\grk\cw 6\src\ex_6_1.hpp(153,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych +D:\grk2024\dgrk-2023-planeta\grk\cw 6\src\ex_6_1.hpp(157,52): warning C4305: "argument": obcięcie z "double" do "T" with [ T=float ] -E:\micha\studia\grafika_komputerowa\grk\grk\cw 6\src\ex_6_1.hpp(160,50): warning C4305: 'argument': truncation from 'double' to 'T' +D:\grk2024\dgrk-2023-planeta\grk\cw 6\src\ex_6_1.hpp(161,50): warning C4305: "argument": obcięcie z "double" do "T" with [ T=float ] -E:\micha\studia\grafika_komputerowa\grk\grk\cw 6\src\ex_6_1.hpp(164,49): warning C4305: 'argument': truncation from 'double' to 'T' +D:\grk2024\dgrk-2023-planeta\grk\cw 6\src\ex_6_1.hpp(165,49): warning C4305: "argument": obcięcie z "double" do "T" with [ T=float ] -E:\micha\studia\grafika_komputerowa\grk\grk\cw 6\src\ex_6_1.hpp(168,48): warning C4305: 'argument': truncation from 'double' to 'T' +D:\grk2024\dgrk-2023-planeta\grk\cw 6\src\ex_6_1.hpp(169,48): warning C4305: "argument": obcięcie z "double" do "T" with [ T=float ] -E:\micha\studia\grafika_komputerowa\grk\grk\cw 6\src\ex_6_1.hpp(172,48): warning C4305: 'argument': truncation from 'double' to 'T' +D:\grk2024\dgrk-2023-planeta\grk\cw 6\src\ex_6_1.hpp(173,48): warning C4305: "argument": obcięcie z "double" do "T" with [ T=float ] -E:\micha\studia\grafika_komputerowa\grk\grk\cw 6\src\ex_6_1.hpp(176,48): warning C4305: 'argument': truncation from 'double' to 'T' +D:\grk2024\dgrk-2023-planeta\grk\cw 6\src\ex_6_1.hpp(177,48): warning C4305: "argument": obcięcie z "double" do "T" with [ T=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-cw6.vcxproj -> E:\micha\studia\grafika_komputerowa\grk\grk\Debug\grk-cw6.exe +Box.obj : warning LNK4075: zignorowano opcję „/EDITANDCONTINUE” z powodu określenia opcji „/INCREMENTAL:NO” +LINK : warning LNK4098: domyślna biblioteka „MSVCRT” powoduje konflikt z innymi bibliotekami; użyj opcji /NODEFAULTLIB:biblioteka + grk-cw6.vcxproj -> D:\grk2024\dgrk-2023-planeta\grk\Debug\grk-cw6.exe diff --git a/grk/cw 6/Debug/grk-cw6.tlog/CL.command.1.tlog b/grk/cw 6/Debug/grk-cw6.tlog/CL.command.1.tlog index d0e4c7d..2ad6daf 100644 Binary files a/grk/cw 6/Debug/grk-cw6.tlog/CL.command.1.tlog and b/grk/cw 6/Debug/grk-cw6.tlog/CL.command.1.tlog differ diff --git a/grk/cw 6/Debug/grk-cw6.tlog/CL.read.1.tlog b/grk/cw 6/Debug/grk-cw6.tlog/CL.read.1.tlog index 83011d4..21b7e5e 100644 Binary files a/grk/cw 6/Debug/grk-cw6.tlog/CL.read.1.tlog and b/grk/cw 6/Debug/grk-cw6.tlog/CL.read.1.tlog differ diff --git a/grk/cw 6/Debug/grk-cw6.tlog/CL.write.1.tlog b/grk/cw 6/Debug/grk-cw6.tlog/CL.write.1.tlog index 059b330..e42ea5b 100644 Binary files a/grk/cw 6/Debug/grk-cw6.tlog/CL.write.1.tlog and b/grk/cw 6/Debug/grk-cw6.tlog/CL.write.1.tlog differ diff --git a/grk/cw 6/Debug/grk-cw6.tlog/grk-cw6.lastbuildstate b/grk/cw 6/Debug/grk-cw6.tlog/grk-cw6.lastbuildstate index 1134c0c..e94550c 100644 --- a/grk/cw 6/Debug/grk-cw6.tlog/grk-cw6.lastbuildstate +++ b/grk/cw 6/Debug/grk-cw6.tlog/grk-cw6.lastbuildstate @@ -1,2 +1,2 @@ -PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: -Debug|Win32|E:\micha\studia\grafika_komputerowa\grk\grk\| +PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.28.29333:TargetPlatformVersion=10.0.19041.0: +Debug|Win32|D:\grk2024\dgrk-2023-planeta\grk\| diff --git a/grk/cw 6/Debug/grk-cw6.tlog/link.command.1.tlog b/grk/cw 6/Debug/grk-cw6.tlog/link.command.1.tlog index ce24eeb..d4d9121 100644 Binary files a/grk/cw 6/Debug/grk-cw6.tlog/link.command.1.tlog and b/grk/cw 6/Debug/grk-cw6.tlog/link.command.1.tlog differ diff --git a/grk/cw 6/Debug/grk-cw6.tlog/link.read.1.tlog b/grk/cw 6/Debug/grk-cw6.tlog/link.read.1.tlog index 9e27c7f..775c568 100644 Binary files a/grk/cw 6/Debug/grk-cw6.tlog/link.read.1.tlog and b/grk/cw 6/Debug/grk-cw6.tlog/link.read.1.tlog differ diff --git a/grk/cw 6/Debug/grk-cw6.tlog/link.write.1.tlog b/grk/cw 6/Debug/grk-cw6.tlog/link.write.1.tlog index 1342dc2..11fa7b7 100644 Binary files a/grk/cw 6/Debug/grk-cw6.tlog/link.write.1.tlog and b/grk/cw 6/Debug/grk-cw6.tlog/link.write.1.tlog differ diff --git a/grk/cw 6/Debug/image_DXT.obj b/grk/cw 6/Debug/image_DXT.obj index e311c2c..114bc33 100644 Binary files a/grk/cw 6/Debug/image_DXT.obj and b/grk/cw 6/Debug/image_DXT.obj differ diff --git a/grk/cw 6/Debug/image_helper.obj b/grk/cw 6/Debug/image_helper.obj index 9b7f75d..ecc1e28 100644 Binary files a/grk/cw 6/Debug/image_helper.obj and b/grk/cw 6/Debug/image_helper.obj differ diff --git a/grk/cw 6/Debug/main.obj b/grk/cw 6/Debug/main.obj index 1e9f2c0..ae5206c 100644 Binary files a/grk/cw 6/Debug/main.obj and b/grk/cw 6/Debug/main.obj differ diff --git a/grk/cw 6/Debug/stb_image_aug.obj b/grk/cw 6/Debug/stb_image_aug.obj index acaf221..de09b32 100644 Binary files a/grk/cw 6/Debug/stb_image_aug.obj and b/grk/cw 6/Debug/stb_image_aug.obj differ diff --git a/grk/cw 6/Debug/vc142.idb b/grk/cw 6/Debug/vc142.idb index 2b99e8e..d9afa96 100644 Binary files a/grk/cw 6/Debug/vc142.idb and b/grk/cw 6/Debug/vc142.idb differ diff --git a/grk/cw 6/Debug/vc142.pdb b/grk/cw 6/Debug/vc142.pdb index d388414..f0b7691 100644 Binary files a/grk/cw 6/Debug/vc142.pdb and b/grk/cw 6/Debug/vc142.pdb differ diff --git a/grk/cw 6/shaders/shader_5_1_tex.frag b/grk/cw 6/shaders/shader_5_1_tex.frag index deb0bdc..44feb1f 100644 --- a/grk/cw 6/shaders/shader_5_1_tex.frag +++ b/grk/cw 6/shaders/shader_5_1_tex.frag @@ -4,21 +4,35 @@ float AMBIENT = 0.1; uniform vec3 color; uniform vec3 lightPos; +uniform vec3 lightColor; in vec3 vecNormal; in vec3 worldPos; in vec2 vtc; - +vec4 textureColor; out vec4 outColor; +vec3 outputColor; uniform sampler2D colorTexture; +vec3 toneMapping(vec3 color){ + float exposure = 0.06; + vec3 mapped = 1 - exp(-color*exposure); + return mapped; +} + + void main() { vec3 lightDir = normalize(lightPos - worldPos); vec3 normal = normalize(vecNormal); float diffuse = max(0, dot(normal, lightDir)); + textureColor = texture2D(colorTexture, vtc); + vec3 distance = lightColor/(lightPos - worldPos)*(lightPos - worldPos); + outputColor = vec3(textureColor) * min(1, AMBIENT + diffuse)* distance; + //gamma correction + //outputColor = pow(outputColor, vec3(1.0/2.2)); - vec4 textureColor = texture2D(colorTexture, vtc); - outColor = vec4(vec3(textureColor) * min(1, AMBIENT + diffuse), 1.0); -} + outputColor = toneMapping(outputColor); + outColor = vec4(outputColor , 1.0); +} \ No newline at end of file diff --git a/grk/cw 6/src/ex_6_1.hpp b/grk/cw 6/src/ex_6_1.hpp index d8de76e..3eb965b 100644 --- a/grk/cw 6/src/ex_6_1.hpp +++ b/grk/cw 6/src/ex_6_1.hpp @@ -51,7 +51,7 @@ glm::vec3 shipDir = glm::vec3(1.f, 0.f, 0.f); float aspectRatio = 1.f; -glm::vec3 lightColor = glm::vec3(0.9, 0.7, 0.8); +glm::vec3 lightColor = glm::vec3(100.f, 100.f, 100.f); glm::mat4 createCameraMatrix() { @@ -117,7 +117,8 @@ void drawObjectTexture(Core::RenderContext& context, glm::mat4 modelMatrix, GLui glm::mat4 transformation = viewProjectionMatrix * modelMatrix; glUniformMatrix4fv(glGetUniformLocation(programTex, "transformation"), 1, GL_FALSE, (float*)&transformation); glUniformMatrix4fv(glGetUniformLocation(programTex, "modelMatrix"), 1, GL_FALSE, (float*)&modelMatrix); - glUniform3f(glGetUniformLocation(program, "lightPos"), 0.0, 0.0, 0.0); + glUniform3f(glGetUniformLocation(programTex, "lightPos"), 0.0, 0.0, 0.0); + glUniform3f(glGetUniformLocation(programTex, "lightColor"), lightColor.x, lightColor.y, lightColor.z); Core::DrawContext(context); glUseProgram(0); } diff --git a/grk/grk-cw.sln b/grk/grk-cw.sln index b9ce046..980da3a 100644 --- a/grk/grk-cw.sln +++ b/grk/grk-cw.sln @@ -1,10 +1,12 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.852 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31019.35 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grk-cw1", "cw 1\grk-cw1.vcxproj", "{1B448102-E76C-4347-BDC7-40D02A567DB6}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "grk-cw6", "cw 6\grk-cw6.vcxproj", "{3952C396-B1C6-44CD-96DD-C1AC15D32978}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x86 = Debug|x86 @@ -15,6 +17,10 @@ Global {1B448102-E76C-4347-BDC7-40D02A567DB6}.Debug|x86.Build.0 = Debug|Win32 {1B448102-E76C-4347-BDC7-40D02A567DB6}.Release|x86.ActiveCfg = Release|Win32 {1B448102-E76C-4347-BDC7-40D02A567DB6}.Release|x86.Build.0 = Release|Win32 + {3952C396-B1C6-44CD-96DD-C1AC15D32978}.Debug|x86.ActiveCfg = Debug|Win32 + {3952C396-B1C6-44CD-96DD-C1AC15D32978}.Debug|x86.Build.0 = Debug|Win32 + {3952C396-B1C6-44CD-96DD-C1AC15D32978}.Release|x86.ActiveCfg = Release|Win32 + {3952C396-B1C6-44CD-96DD-C1AC15D32978}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE